Launch offer: service fee 10% 4% until 31 Dec, just enough to cover card processing. See pricing

← REST API reference

Schedule a post

Schedule a video or photos to go out on one or more of the brand's own TikTok and Instagram accounts at a set time (at least 10 minutes and at most 60 days ahead). It posts publicly at that time, so it is for use once the person has seen the account, video, caption, time and (TikTok) audience and agreed. For TikTok the audience is the person's own choice from get_post_account. Not for creators' accounts.

View as Markdown
POSThttps://yapfactory.com/api/v1/posts
Who can use itBrands
Tieroutbound: Reaches other people: an email, a notification or a public post.
Scopeposts:write, or write
Idempotency-KeyRequired
Rate limitWrites: 20 a minute, of which outbound: 10 a minute
MCP toolschedule_post

This reaches other people or the public. If an agent makes the call, it should confirm the details with the person first.

Parameters

accounts
bodyrequired
object[]

The accounts to post to, from list_post_accounts. 1 to 10 items.

accounts[].accountId
bodyrequired
uuid

The account's id.

accounts[].mode
bodyoptional
"direct" | "drafts"

direct posts it; drafts sends it to the TikTok app's drafts for the person to finish (TikTok only). Default "direct".

media
bodyrequired
({ deliverableId } | { upload })[]

One video, one photo, or several photos (a carousel), in order. 1 to 35 items.

caption
bodyoptional
string

The words under the post, hashtags included. Up to 2200 characters. Default "".

publishAt
bodyrequired
datetime

When it goes out, ISO 8601 with a time zone, e.g. 2026-12-10T18:00:00Z.

timeZone
bodyoptional
string

The person's IANA time zone, for how times are shown to them, e.g. Europe/London. Up to 60 characters. Default "UTC".

tiktok
bodyoptional
object

Needed when posting directly to a TikTok account.

tiktok.privacy
bodyrequired
"PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY"

Who can see it: the person's choice, from get_post_account.

tiktok.allowComments
bodyoptional
boolean

Let people comment, if get_post_account says the account allows it. Default false.

tiktok.allowDuet
bodyoptional
boolean

Let people Duet it (videos only). Default false.

tiktok.allowStitch
bodyoptional
boolean

Let people Stitch it (videos only). Default false.

tiktok.disclose
bodyoptional
boolean

Disclose commercial content. Default false.

tiktok.yourBrand
bodyoptional
boolean

Promotional content for your own brand. Default false.

tiktok.brandedContent
bodyoptional
boolean

A paid partnership for another brand (can't be Only me). Default false.

instagram
bodyoptional
object
instagram.shareToFeed
bodyoptional
boolean

Reels also show in the main feed. Default true.

Posting your own file

  1. Ask for an upload link with POST /posts/uploads. It returns uploadUrl, method, headers and an upload object.
  2. Send the file's bytes to uploadUrl with that method and those headers. The link works once and for that size only.
  3. Schedule it: pass the upload object, unchanged, as an item in media.
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: video/mp4" \
  --data-binary @launch.mp4
media, with an uploaded file
{
  "media": [
    {
      "upload": {
        "key": "posts/…/launch.mp4",
        "url": "https://…/launch.mp4",
        "filename": "launch.mp4",
        "sizeBytes": 18400000
      }
    }
  ]
}

TikTok's rules

  • tiktok.privacy is required for a TikTok account in direct mode, and must be one of privacyOptions from GET /posts/accounts/{accountId}. The person chooses it; there's no default.
  • Comments, Duet and Stitch start off. Turn one on only if the same call says the account allows it.
  • mode: "drafts" sends the video to the TikTok app's drafts instead, for the person to finish there.

Example request

curl -X POST "https://yapfactory.com/api/v1/posts" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accounts": [
      {
        "accountId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
        "mode": "direct"
      }
    ],
    "media": [
      {
        "deliverableId": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d"
      }
    ],
    "caption": "Fell asleep before the alarm app even loaded.",
    "publishAt": "2026-12-10T18:00:00Z",
    "timeZone": "Europe/London",
    "tiktok": {
      "privacy": "PUBLIC_TO_EVERYONE",
      "allowComments": true,
      "disclose": true,
      "yourBrand": true
    }
  }'

Response

201 with the result in data: the same object the MCP tool returns.

{
  "data": {
    "posts": [
      {
        "id": "92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55",
        "accountId": "0cc175b9-c0f1-46a8-b1c3-99e2697726ae",
        "status": "scheduled",
        "publishAt": "2026-12-10T18:00:00.000Z",
        "url": "https://yapfactory.com/brand/accounts?tab=calendar&post=92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55"
      }
    ]
  }
}

An example: fields that don't apply are null, and new fields can be added at any time, so ignore ones you don't know. Every response carries Request-Id and the RateLimit-* headers.

Errors

CodeStatusWhen
invalid_request400A field failed validation (see meta.issues), an unknown query parameter, or no Idempotency-Key.
unauthorized401No token, or it's wrong, expired, revoked or from the other environment.
insufficient_scope403The token doesn't have posts:write (or write).
forbidden403Only for brands, or the account can't do this yet (email not confirmed, paused).
conflict409Its current state doesn't allow this. message says why, in words you can show.
idempotency_conflict409The same Idempotency-Key came with a different body.
rate_limited429Over the limit. Wait for Retry-After seconds.
internal500Our fault. Retry later, and send us the requestId if it keeps happening.

Every error has the same shape. See Errors for what to do about each one.