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 Markdownhttps://yapfactory.com/api/v1/posts| Who can use it | Brands |
| Tier | outbound: Reaches other people: an email, a notification or a public post. |
| Scope | posts:write, or write |
| Idempotency-Key | Required |
| Rate limit | Writes: 20 a minute, of which outbound: 10 a minute |
| MCP tool | schedule_post |
This reaches other people or the public. If an agent makes the call, it should confirm the details with the person first.
Parameters
accountsThe accounts to post to, from list_post_accounts. 1 to 10 items.
accounts[].accountIdThe account's id.
accounts[].modedirect posts it; drafts sends it to the TikTok app's drafts for the person to finish (TikTok only). Default "direct".
mediaOne video, one photo, or several photos (a carousel), in order. 1 to 35 items.
captionThe words under the post, hashtags included. Up to 2200 characters. Default "".
publishAtWhen it goes out, ISO 8601 with a time zone, e.g. 2026-12-10T18:00:00Z.
timeZoneThe person's IANA time zone, for how times are shown to them, e.g. Europe/London. Up to 60 characters. Default "UTC".
tiktokNeeded when posting directly to a TikTok account.
tiktok.privacyWho can see it: the person's choice, from get_post_account.
tiktok.allowCommentsLet people comment, if get_post_account says the account allows it. Default false.
tiktok.allowDuetLet people Duet it (videos only). Default false.
tiktok.allowStitchLet people Stitch it (videos only). Default false.
tiktok.discloseDisclose commercial content. Default false.
tiktok.yourBrandPromotional content for your own brand. Default false.
tiktok.brandedContentA paid partnership for another brand (can't be Only me). Default false.
instagraminstagram.shareToFeedReels also show in the main feed. Default true.
Posting your own file
- Ask for an upload link with
POST /posts/uploads. It returnsuploadUrl,method,headersand anuploadobject. - Send the file's bytes to
uploadUrlwith that method and those headers. The link works once and for that size only. - Schedule it: pass the
uploadobject, unchanged, as an item inmedia.
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: video/mp4" \
--data-binary @launch.mp4{
"media": [
{
"upload": {
"key": "posts/…/launch.mp4",
"url": "https://…/launch.mp4",
"filename": "launch.mp4",
"sizeBytes": 18400000
}
}
]
}TikTok's rules
tiktok.privacyis required for a TikTok account indirectmode, and must be one ofprivacyOptionsfromGET /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
| Code | Status | When |
|---|---|---|
invalid_request | 400 | A field failed validation (see meta.issues), an unknown query parameter, or no Idempotency-Key. |
unauthorized | 401 | No token, or it's wrong, expired, revoked or from the other environment. |
insufficient_scope | 403 | The token doesn't have posts:write (or write). |
forbidden | 403 | Only for brands, or the account can't do this yet (email not confirmed, paused). |
conflict | 409 | Its current state doesn't allow this. message says why, in words you can show. |
idempotency_conflict | 409 | The same Idempotency-Key came with a different body. |
rate_limited | 429 | Over the limit. Wait for Retry-After seconds. |
internal | 500 | Our 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.