GET
https://www.app.ocoya.com/api/_public/v1/campaigns/{campaignId}
Get a campaign
curl --request GET \
  --url https://www.app.ocoya.com/api/_public/v1/campaigns/{campaignId} \
  --header 'X-API-Key: <api-key>'
{
  "id": "cmayxcmpn00087aps2m7hjs9z",
  "type": "social",
  "name": "Summer launch campaign",
  "prompt": "Summer launch campaign for our ecommerce analytics dashboard.",
  "goal": "launch",
  "status": "GENERATED",
  "duration": 7,
  "startDate": "2026-11-02",
  "postsPerDay": 1,
  "plannedPostCount": 7,
  "postCount": 7,
  "postLength": "medium",
  "channelIds": [
    "clh49poxf008x8kov4ncbjty9"
  ],
  "generation": {
    "status": "GENERATING",
    "phase": "posts",
    "current": 3,
    "total": 7,
    "completed": 2,
    "failed": 0,
    "error": "<string>",
    "startedAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z",
    "completedAt": "2024-01-01T00:00:00Z"
  },
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z",
  "posts": [
    {
      "sequence": 1,
      "title": null,
      "captionPreview": "Our analytics dashboard is live. Here is what it shows you on day one...",
      "scheduledAt": "2024-01-01T00:00:00Z",
      "approved": true,
      "postGroupId": "cmajvvb9q0003ja5vh0538j6r",
      "status": "SCHEDULED",
      "mediaCount": 1
    }
  ]
}

Authorizations

X-API-Keystringheaderrequired

Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.

Path Parameters

campaignIdstringrequired

Ocoya campaign ID, from GET /campaigns or POST /campaigns.

Example:"cmayxcmpn00087aps2m7hjs9z"

Query Parameters

brandIdstringrequired

Ocoya brand ID. Get one from GET /brands.

Example:"cmayvq3hk00017apshay5qezu"

Response

application/json

Success

idstring

Campaign ID.

Example:"cmayxcmpn00087aps2m7hjs9z"
typeenum<string>

Kind of campaign: social posts, blog articles, or an email (internal for now).

Available options: social, blog, email
Example:"social"
namestring

The campaign's name in the app: its prompt, or Untitled campaign.

Example:"Summer launch campaign"
promptstring

The brief the campaign was generated from.

Example:
"Summer launch campaign for our ecommerce analytics dashboard."
goalstring | null

Campaign objective, when one was set.

Example:"launch"
statusenum<string>

GENERATING while posts are being written, GENERATED when they are ready to review, SCHEDULED once the campaign runs (shown as Running in the app), ERROR when generation failed.

Available options: GENERATING, GENERATED, SCHEDULED, ERROR
Example:"GENERATED"
durationinteger | null

Campaign length in days.

Example:7
startDatestring | null

Day of the first post, YYYY-MM-DD, when one was set.

Example:"2026-11-02"
postsPerDaynumber | null

Posting frequency, when one was set: 0.5 is every other day.

Example:1
plannedPostCountinteger | null

Posts the campaign was asked for.

Example:7
postCountinteger

Posts generated so far.

Example:7
postLengthstring | null

Caption length the posts were written at.

Example:"medium"
channelIdsstring[]

Channels the campaign posts to.

Example:
[
  "clh49poxf008x8kov4ncbjty9"
]
generationobject | null

Generation progress. null for a campaign made before progress was recorded.

Show child attributesHide child attributes
generation.statusstring

GENERATING while posts are being written, then GENERATED, or ERROR when every post failed.

Example:"GENERATING"
generation.phasestring

Step of the generation: queued, posts, complete or error.

Example:"posts"
generation.currentinteger

Post being written, from 1.

Example:3
generation.totalinteger

Posts to write.

Example:7
generation.completedinteger

Posts written so far.

Example:2
generation.failedinteger

Posts that could not be written.

Example:0
generation.errorstring

Why generation failed, when it did.

generation.startedAtstring
Example:"2024-01-01T00:00:00Z"
generation.updatedAtstring
Example:"2024-01-01T00:00:00Z"
generation.completedAtstring
Example:"2024-01-01T00:00:00Z"
createdAtstring

When the campaign was created.

Example:"2024-01-01T00:00:00Z"
updatedAtstring

When the campaign last changed.

Example:"2024-01-01T00:00:00Z"
postsobject[]

The campaign's posts, in order.

Show child attributesHide child attributes
posts.sequenceinteger

Position in the campaign, from 1.

Example:1
posts.titlestring | null

Title, for a blog article.

posts.captionPreviewstring

The caption, cut to 280 characters.

Example:
"Our analytics dashboard is live. Here is what it shows you on day one..."
posts.scheduledAtstring | null

When the post is planned or scheduled to publish.

Example:"2024-01-01T00:00:00Z"
posts.approvedboolean

Whether the post was approved in the campaign review.

Example:true
posts.postGroupIdstring | null

The saved post, once the campaign has saved it. Read it in full with GET /post/{postId}. null until then.

Example:"cmajvvb9q0003ja5vh0538j6r"
posts.statusenum<string> | null

Status of the saved post. null while it is not saved yet.

Available options: GENERATING, DRAFT, PENDING_CLIENT_APPROVAL, PENDING_INTERNAL_APPROVAL, SCHEDULED, POSTED, NEEDS_ATTENTION, ERROR
Example:"SCHEDULED"
posts.mediaCountinteger

Images or videos on the post.

Example:1