Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.
API Reference
Get a campaign
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 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
Response
application/json
Success
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.
Was this page helpful?