PATCH
https://www.app.ocoya.com/api/_public/v1/post/{postId}
Update post
curl --request PATCH \
  --url https://www.app.ocoya.com/api/_public/v1/post/{postId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "caption": "Launching our summer campaign today.",
  "scheduledAt": "2024-01-01T00:00:00Z",
  "publishNow": true,
  "mediaUrls": [
    "https://example.com/image.jpg"
  ],
  "addMediaUrls": [
    "https://example.com/image.jpg"
  ],
  "clearMedia": false,
  "socialProfileIds": [
    "clh49poxf008x8kov4ncbjty9"
  ],
  "addSocialProfileIds": [
    "clh49poxf008x8kov4ncbjty9"
  ],
  "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.

Path Parameters

postIdstringrequired

Ocoya post ID.

Example:"cmajvvb9q0003ja5vh0538j6r"

Body

application/json
captionstring

New caption to apply to existing post variations.

Example:"Launching our summer campaign today."
scheduledAtstring | null

ISO 8601 datetime when the post should be scheduled, or null to make it unscheduled.

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

Publish the existing post immediately without creating a new post.

Example:true
mediaUrlsstring[]

Full replacement set of publicly reachable image or video URLs. Maximum 10. Use an empty array to remove all media.

Maximum array length: 10
Example:
[
  "https://example.com/image.jpg"
]
addMediaUrlsstring[]

Publicly reachable image or video URLs to add without removing existing media. Maximum 10 total.

Example:
[
  "https://example.com/image.jpg"
]
clearMediaboolean

Remove all media from the post. Ignored when mediaUrls is provided.

Example:false
socialProfileIdsstring[]

Full replacement set of connected social profile IDs that should receive the post. Get IDs from GET /social-profiles.

Example:
[
  "clh49poxf008x8kov4ncbjty9"
]
addSocialProfileIdsstring[]

Connected social profile IDs to add without removing profiles already attached to the post.

Example:
[
  "clh49poxf008x8kov4ncbjty9"
]
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

Success

postGroupIdstring

ID of the post.

Example:"cmajvvb9q0003ja5vh0538j6r"