What You Need
Before you send requests, you need:- An Ocoya API key
- A workspace ID
- Social profile IDs if you want to create or schedule posts
Get An API Key
Create or copy an API key from your Ocoya API settings. Create API keyBase URL
All REST API examples use:Send Your First Request
The fastest way to verify your API key is working is to call/me.
Typical Publishing Flow
Connect social profiles
If the workspace has no connected profiles yet, call
GET /social-profiles/connection-url and open the returned authUrl in a browser.List social profiles
Call
GET /social-profiles?workspaceId=WORKSPACE_ID to find connected profile IDs.Resolve optional context
Call
GET /brand-kits?workspaceId=WORKSPACE_ID and GET /hashtag-libraries?workspaceId=WORKSPACE_ID when an AI draft should use saved brand or hashtag context.Create a draft or scheduled post
Call
POST /post?workspaceId=WORKSPACE_ID with a caption, media URLs, target social profile IDs, and optional scheduledAt.Create an AI draft
Call
POST /post/ai?workspaceId=WORKSPACE_ID with a prompt when you want Ocoya to generate the caption first.Create A Post
UsescheduledAt when you want a scheduled post. Omit it when you want a draft.
Connect A Social Profile
UseGET /social-profiles/connection-url when you need a browser URL for connecting a new social profile.
cURL
authUrl while signed in to Ocoya. Instagram returns a Facebook OAuth URL first because Instagram Business profiles are connected through Facebook Pages.
Create An AI Draft
UsePOST /post/ai when you want Ocoya to generate the caption from a prompt before creating the draft.
Use brandId, hashtagLibraryId, and referenceDesignIds when you want the draft to use saved brand kit, hashtag library, or Studio template context.
cURL