Skip to main content
POST
https://app.ocoya.com/api/_public/v1
/
post
/
ai
Create an AI-generated draft post
curl --request POST \
  --url https://app.ocoya.com/api/_public/v1/post/ai \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "prompt": "Write a launch post for our new analytics dashboard."
}
'

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

Prompt describing the post Ocoya should generate. Minimum 10 characters.

Minimum string length: 10
Example:

"Write a launch post for our new analytics dashboard."

brandId
string

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

Example:

"cmayw38dz00047apsue9nw4tf"

tone
enum<string>

Caption tone for the AI draft.

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

"professional"

length
enum<string>

Target caption length for the AI draft.

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

"medium"

socialProfileIds
string[]

Connected social profile IDs that should receive the post. Get IDs from GET /social-profiles.

Example:
["clh49poxf008x8kov4ncbjty9"]
hashtagLibraryId
string

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

Example:

"cmayw7l5200067apsmz2tv7e8"

generateImage
boolean

Whether to generate one square image for the AI draft.

Example:

true

referenceUrls
string[]

Optional image URLs to use as visual references when generateImage is true. Ocoya uses these images for style, composition, layout, and subject guidance; they are not attached directly to the post.

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

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

Example:
["design_123"]

Response

Created