Campaigns

Returns one campaign with its brief, status, generation progress and posts. Each saved post has a postGroupId you can use with the post endpoints.

get/campaigns/{campaignId}

Request

  • Base URL
    https://www.app.ocoya.com/api/_public/v1
  • Auth
    API key in header X-API-Key

Path parameters

campaignIdstring required
Example:cmayxcmpn00087aps2m7hjs9z

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

Query parameters

brandIdstring required
Example:cmayvq3hk00017apshay5qezu

Ocoya brand ID. Get one from GET /brands.

Response

Success

idstring required

Campaign ID.

type'social' | 'blog' | 'email' required

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

namestring required

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

promptstring required

The brief the campaign was generated from.

goalstring nullable required

Campaign objective, when one was set.

status'GENERATING' | 'GENERATED' | 'SCHEDULED' | 'ERROR' required

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.

durationinteger nullable required

Campaign length in days.

startDatestring nullable required

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

postsPerDaynumber nullable required

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

plannedPostCountinteger nullable required

Posts the campaign was asked for.

postCountinteger required

Posts generated so far.

postLengthstring nullable required

Caption length the posts were written at.

channelIdsstring[] required

Channels the campaign posts to.

createdAtstring required

When the campaign was created.

updatedAtstring required

When the campaign last changed.

Example response

{
  "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,
    "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,
      "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
    }
  ]
}

Changes