POST
https://www.app.ocoya.com/api/_public/v1/seo/ai
Create an AI-generated draft SEO post
curl --request POST \
  --url https://www.app.ocoya.com/api/_public/v1/seo/ai \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "prompt": "How small cafés can use Instagram to fill quiet afternoons",
  "length": "medium",
  "generateThumbnail": true,
  "thumbnailAspectRatio": "4:5",
  "referenceUrls": [
    "<string>"
  ],
  "channelIds": [
    "clh49poxf008x8kov4ncbjty9"
  ],
  "cms": {
    "webflow": {
      "status": "draft"
    },
    "framer": {
      "status": "draft"
    },
    "wix": {
      "status": "draft"
    }
  }
}
'
{
  "postGroupId": "cmajvvb9q0003ja5vh0538j6r",
  "status": "GENERATING",
  "scheduledAt": null
}

Authorizations

X-API-Keystringheaderrequired

Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.

Query Parameters

brandIdstringrequired

Ocoya brand ID. Get one from GET /brands.

Example:"cmayvq3hk00017apshay5qezu"

Body

application/json
promptstringrequired

What the post is about: a topic, a question or a brief.

Minimum string length: 10
Example:"How small cafés can use Instagram to fill quiet afternoons"
lengthenum<string>

short 600-900 words, medium 900-1,400 (default), long 1,400-2,000, extra_long 2,000-3,000.

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

Also make an AI thumbnail. Costs the image's credits.

Example:true
thumbnailAspectRatioenum<string>

16:9 (default), 1:1 or 4:5.

Available options: 4:5, 1:1, 16:9
referenceUrlsstring[]

Image URLs that steer the thumbnail.

Maximum array length: 3
channelIdsstring[]

Blog or site channels to publish to: WordPress, DEV, Notion, Webflow, Framer, Wix or Webhook. Get IDs from GET /channels.

Example:
[
  "clh49poxf008x8kov4ncbjty9"
]
cmsobject

Per-CMS settings, applied when the post has a channel on that CMS. Each is live unless set. WordPress and DEV always publish live.

Show child attributesHide child attributes
cms.webflowobject
Show child attributesHide child attributes
cms.webflow.statusenum<string>required

live publishes the item at once, draft keeps it a draft on the site.

Available options: live, draft
Example:"draft"
cms.framerobject
Show child attributesHide child attributes
cms.framer.statusenum<string>required

live publishes the item at once, draft keeps it a draft on the site.

Available options: live, draft
Example:"draft"
cms.wixobject
Show child attributesHide child attributes
cms.wix.statusenum<string>required

live publishes the item at once, draft keeps it a draft on the site.

Available options: live, draft
Example:"draft"

Response

application/json

Queued. Returns immediately with status GENERATING.

postGroupIdstring

ID of the post. Fetch it later with GET /post to see the finished draft.

Example:"cmajvvb9q0003ja5vh0538j6r"
statusstring

GENERATING until the caption and media are ready.

Example:"GENERATING"
scheduledAtstring | null

When the post is scheduled, or null for a draft.