Skip to main content
POST
Create an AI-generated campaign

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
prompt
string
required

Campaign prompt 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. When campaign media is generated, brand kit logos and icons are treated as protected reference assets. 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"

socialProfileIds
string[]

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

Example:
generateMedia
boolean

Whether to generate images for campaign posts.

Example:

true

imageCount
integer

Number of images to generate for each campaign post, from 1 to 5. Values above 1 create carousel-style post creatives. Defaults to 1.

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

3

referenceUrls
string[]

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

Example:
referenceDesignIds
string[]

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

Example:

Response

Campaign generation queued

campaignId
string
Example:

"cmayxcmpn00087aps2m7hjs9z"

status
string
Example:

"GENERATING"

queued
boolean
Example:

true

generation
object

Campaign generation progress metadata.