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"
  ],
  "videoThumbnailUrl": "https://yourmediaurl.com/cover.jpg",
  "channelIds": [
    "clh49poxf008x8kov4ncbjty9"
  ],
  "scheduledAt": "2024-01-01T00:00:00Z",
  "options": {
    "facebook": {
      "type": "reel"
    },
    "instagram": {
      "type": "reel"
    },
    "tiktok": {
      "privacyLevel": "PUBLIC_TO_EVERYONE",
      "allowComment": true
    }
  },
  "approvers": [
    "jane@example.com"
  ]
}
'
{
  "postGroupId": "cmajvvb9q0003ja5vh0538j6r",
  "approval": {}
}

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. To tag a LinkedIn company Page, write @[Exact Page Name](urn:li:organization:<id>): GET /linkedin/organizations answers it as mention. Or write @https://www.linkedin.com/company/<vanity>, which is looked up when the post is published. LinkedIn shows a tag; every other network shows "@Name". Limited availability: internal beta for now.

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"
]
videoThumbnailUrlstring

A public image URL to use as the cover of the video in mediaUrls (for example a Video Studio video's thumbnailUrl). Instagram shows it as the Reel's cover.

Example:"https://yourmediaurl.com/cover.jpg"
channelIdsstring[]

Channel IDs that should receive the post. Get IDs from GET /channels.

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 channel on that network. On update, only the fields you send change.

The values are returned by GET /post in each post's options (type, tiktok.profiles keyed by social profile ID, or title and pinterest.link; a YouTube title is the YouTube post's title).

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 channel on the post. A TikTok channel 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
options.pinterestobject

Applied to every Pinterest channel on the post.

Show child attributesHide child attributes
options.pinterest.titlestring

The Pin title, up to 100 characters. Left out, the Pin has no title.

Maximum string length: 100
Example:"Summer linen collection"

Where the Pin takes people. Left out or empty, the first link in the caption is used.

Example:"https://example.com/summer"
options.youtubeobject

Applied to every YouTube channel on the post.

Show child attributesHide child attributes
options.youtube.titlestring

The video title, up to 100 characters. Left out, the first line of the caption is used.

Maximum string length: 100
Example:"How we bake 300 cinnamon rolls before 9 a.m."
approversstring[]

Email addresses of brand members who must approve the post before it goes out, as POST /post/{postId}/approval does in the same call: the post is saved as PENDING_INTERNAL_APPROVAL and goes out at scheduledAt only once approved. Everyone named must be a member of the brand, or no post is created. The answer then has approval.

Maximum array length: 10
Example:
[
  "jane@example.com"
]

Response

application/json

Created. With approvers, also approval, as GET /post/{postId}/approval returns it.

postGroupIdstring

ID of the post.

Example:"cmajvvb9q0003ja5vh0538j6r"
approvalobject

With approvers only: the approval, as GET /post/{postId}/approval returns it.