Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.
API Reference
Create an AI-generated draft post
Generates a post caption and creates a draft post. Optionally attaches social profiles, a reusable hashtag library, and one AI-generated image.
Create an AI-generated draft post
curl --request POST \
--url https://www.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.",
"tone": "professional",
"postLength": "medium",
"socialProfileIds": [
"clh49poxf008x8kov4ncbjty9"
],
"hashtagLibraryId": "cmayw7l5200067apsmz2tv7e8",
"generateImage": true,
"imageCount": 3,
"referenceUrls": [
"https://example.com/reference.png"
],
"referenceDesignIds": [
"design_123"
]
}
'{
"postGroupId": "cmajvvb9q0003ja5vh0538j6r",
"status": "GENERATING",
"scheduledAt": null
}Authorizations
Body
application/json
Connected social profile IDs that should receive the post. Get IDs from GET /social-profiles.
Hashtag library ID used for hashtag context. Get IDs from GET /hashtag-libraries.
Number of generated images when generateImage is true. Use 1 for a single image or 2-10 for a carousel.
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.
Response
application/json
Queued. Returns immediately with status GENERATING; fetch the post later to see the completed draft.
Was this page helpful?