Skip to main content
POST
https://app.ocoya.com/api/_public/v1
/
campaigns
Create an AI-generated campaign
curl --request POST \
  --url https://app.ocoya.com/api/_public/v1/campaigns \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "topic": "Summer launch campaign for our ecommerce analytics dashboard."
}
'
{
  "campaignId": "cmayxcmpn00087aps2m7hjs9z",
  "status": "GENERATING",
  "queued": true,
  "generation": {}
}

Authorizations

X-API-Key
string
header
required

Query Parameters

workspaceId
string
required

Ocoya workspace ID. Get one from GET /workspaces.

Example:

"cmayvq3hk00017apshay5qezu"

Body

application/json
topic
string
required

Campaign topic or brief.

Minimum string length: 3
Example:

"Summer launch campaign for our ecommerce analytics dashboard."

goal
enum<string>

Campaign objective.

Available options:
awareness,
leads,
launch,
offer,
education,
event
Example:

"launch"

audience
enum<string>

Primary campaign audience.

Available options:
business_owners,
founders_executives,
marketing_teams,
buyers_customers,
local_community,
investors,
first_time_buyers,
existing_customers
Example:

"marketing_teams"

duration
integer

Campaign duration in days, from 1 to 30. Defaults to 7.

Required range: 1 <= x <= 30
Example:

10

count
integer

Number of posts to generate, from 3 to 30. Defaults to 5.

Required range: 3 <= x <= 30
Example:

6

postLength
enum<string>

Target caption length for each generated campaign post.

Available options:
short,
medium,
long,
extra_long
Example:

"medium"

tone
enum<string>

Caption tone for campaign posts.

Available options:
professional,
friendly,
educational,
bold,
founder_led
Example:

"professional"

brandId
string

Brand kit ID used for brand context. Get IDs from GET /brand-kits.

Example:

"cmayw38dz00047apsue9nw4tf"

hashtagLibraryId
string

Hashtag library ID used for hashtag context. Get IDs from GET /hashtag-libraries.

Example:

"cmayw7l5200067apsmz2tv7e8"

hashtagLibraryName
string

Hashtag library name to search when the ID is not known.

Example:

"Launch Hashtags"

socialProfileIds
string[]

Connected social profile IDs to attach when generated campaign posts are saved. Get IDs from GET /social-profiles.

Example:
["clh49poxf008x8kov4ncbjty9"]
generateMedia
boolean

Whether to generate one image for each campaign post.

Example:

true

referenceUrls
string[]

Optional image URLs to use as visual references when generateMedia is true. Maximum 3.

Example:
["https://example.com/reference.png"]
referenceDesignIds
string[]

Optional Studio design IDs to use as visual references when generateMedia is true. Get IDs from GET /studio-templates. Maximum 3.

Example:
["design_123"]

Response

Campaign generation queued

campaignId
string
Example:

"cmayxcmpn00087aps2m7hjs9z"

status
string
Example:

"GENERATING"

queued
boolean
Example:

true

generation
object

Campaign generation progress metadata.