POST
https://www.app.ocoya.com/api/_public/v1/post
Create a scheduled or a draft post
curl --request POST \
  --url https://www.app.ocoya.com/api/_public/v1/post \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "caption": "Happy new year everyone!",
  "mediaUrls": [
    "https://yourmediaurl.com"
  ],
  "socialProfileIds": [
    "clh49poxf008x8kov4ncbjty9"
  ],
  "scheduledAt": "2024-01-01T00:00:00Z",
  "options": {
    "facebook": {
      "type": "reel"
    },
    "instagram": {
      "type": "reel"
    },
    "tiktok": {
      "privacyLevel": "PUBLIC_TO_EVERYONE",
      "allowComment": true
    }
  }
}
'
{
  "postGroupId": "cmajvvb9q0003ja5vh0538j6r"
}

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
captionstring

Text caption for the post.

Example:"Happy new year everyone!"
mediaUrlsstring[]

Publicly accessible media URLs to attach to the post. Maximum 10.

Maximum array length: 10
Example:
[
  "https://yourmediaurl.com"
]
socialProfileIdsstring[]

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

Example:
[
  "clh49poxf008x8kov4ncbjty9"
]
scheduledAtstring

ISO 8601 datetime when the post should be scheduled. Omit to save as draft.

Example:"2024-01-01T00:00:00Z"
optionsobject

Settings for individual networks, keyed by network. Each one only applies when the post has a profile on that network. On update, only the fields you send change.

The values are returned by GET /post in each post's options (type, or tiktok.profiles keyed by social profile ID).

Example:
{
  "facebook": {
    "type": "reel"
  },
  "instagram": {
    "type": "reel"
  },
  "tiktok": {
    "privacyLevel": "PUBLIC_TO_EVERYONE",
    "allowComment": true
  }
}
Show child attributesHide child attributes
options.facebookobject
Show child attributesHide child attributes
options.facebook.typeenum<string>

Publish as a regular post or as a Reel. A Reel needs exactly one vertical video.

Available options: post, reel
Example:"reel"
options.instagramobject
Show child attributesHide child attributes
options.instagram.typeenum<string>

Publish to the feed, as a Reel, or as a Story. A single video sent as post already publishes as a Reel that also appears on the profile grid; reel publishes it to the Reels tab only.

Available options: post, reel, story
Example:"post"
options.tiktokobject

Applied to every TikTok profile on the post. A TikTok profile added later without these settings takes them from one already on the post.

Show child attributesHide child attributes
options.tiktok.privacyLevelenum<string>

Who can see the post. Required before a TikTok post can publish; there is no default, as TikTok requires the creator to choose. Some accounts do not offer every level (private accounts cannot use PUBLIC_TO_EVERYONE); an unavailable level fails the post when it publishes.

Available options: PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY
Example:"PUBLIC_TO_EVERYONE"
options.tiktok.allowCommentboolean

Let viewers comment. Defaults to false. Ignored when the creator has turned comments off in TikTok.

Example:true
options.tiktok.allowDuetboolean

Let viewers Duet the video. Defaults to false. Videos only.

Example:false
options.tiktok.allowStitchboolean

Let viewers Stitch the video. Defaults to false. Videos only.

Example:false
options.tiktok.autoAddMusicboolean

Let TikTok add music. Photo posts only. Defaults to false.

Example:false
options.tiktok.titlestring

Title for a photo post. Videos use the caption.

options.tiktok.isAigcboolean

Label the post as AI-generated content. Defaults to false.

Example:false
options.tiktok.commercialContentboolean

The post promotes a brand, product or service. Needs brandOrganic or brandContent.

Example:false
options.tiktok.brandOrganicboolean

Promotes your own brand.

Example:false
options.tiktok.brandContentboolean

Paid partnership promoting a third party. Not allowed with SELF_ONLY.

Example:false

Response

application/json

Created

postGroupIdstring

ID of the post.

Example:"cmajvvb9q0003ja5vh0538j6r"