# Schedule a post

Schedules a post on one of your accounts. POST /posts.

`POST https://api.tiktornado.com/api/v1/posts`

Scope: `posts:write`. Needs an `Idempotency-Key` header.

Schedules a post on one of your accounts. It shows in the tiktornado app like any other post, with the same rules:

- When: exactly one of `scheduledFor` (more than 10 minutes ahead), `postNow: true` (at once) and `queue: true` (the account's next free posting time for this kind, see `PUT /accounts/{accountId}/queue`).
- At most 15 videos and 15 photo posts per account in any 24 hours.
- Captions up to 2,200 characters for a video and 4,000 for photos.
- One video, or 1 to 35 photos. Each is a `mediaRef` from `POST /uploads`, or a public `https` link straight to the file.
- Every media item is checked before the post is saved: its type, size and whether it can be read.

The answer carries the time the post was saved for: the one you chose, now for `postNow`, or the slot the queue picked. Its status is `scheduling` until TikTok's scheduler has the post. Follow it with `GET /posts`. A queued post is an ordinary scheduled post from then on: edit or cancel it like any other.

A post sent with `postNow: true` is locked from the start: it can't be edited or cancelled. If it fails, it can be edited like any failed post.

`toDrafts: true` sends the post to the account's TikTok drafts at `scheduledFor` instead of publishing it. You then add the caption and settings and post it in the TikTok app. TikTok holds at most 5 drafts waiting per account: past that the post fails with reason `tiktok_drafts_full` until a draft is posted or deleted in the TikTok app.

## Header parameters

- `Idempotency-Key` string, required: A unique string you make up for this change, for example a UUID: 1 to 255 visible ASCII characters, no spaces. Send the same key with the same body to retry safely. Missing or malformed: 400 `idempotency_key_required`, before anything runs. Matches `^[\x21-\x7e]{1,255}$`.

## Request body

Exactly one of `scheduledFor`, `postNow: true` and `queue: true`.

- `accountId` string, required: An id, letters and digits only. Matches `^[A-Za-z0-9]{1,64}$`.
- `kind` string, required: `video`: one video. `photo`: 1 to 35 photos. One of `video`, `photo`.
- `caption` string: The caption, hashtags included. Up to 2,200 characters for a video and 4,000 for photos (`caption_too_long`). Counted as UTF-16 code units, the way JavaScript's `length` counts, spaces included, so most emoji count as 2 or more. A reply's 150 characters are counted differently, as the characters you see after trimming. At most 4,000 characters.
- `mediaRefs` array of strings, required: One video, or 1 to 35 photos, in order, no item twice. Each is a `mediaRef` from `POST /uploads`, passed back exactly as you got it, or a public `https` link straight to the file (no login, no IP address). 1 to 35 items. No item twice. Each: At most 2,048 characters.
- `scheduledFor` string: When to publish, ISO 8601 with a time zone, for example `2026-12-02T15:00:00Z`. More than 10 minutes from now (`schedule_too_soon`), so a time exactly 10 minutes ahead is refused. Matches `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})$`.
- `postNow` boolean: `true` to post as soon as it is saved, instead of at `scheduledFor` (leave `scheduledFor` out). Locked from the start: it can't be edited or cancelled unless it fails. `false` if left out.
- `queue` boolean: `true` to give the post the account's next free posting time for its kind, picked when it is saved (leave `scheduledFor` out). The answer's `scheduledFor` says which. `queue_empty` when the account has no posting times, `queue_full` when none is free in the next 4 weeks. `false` if left out.
- `toDrafts` boolean: `true` to send the post to the account's TikTok drafts at `scheduledFor` instead of publishing it. The post then takes no `settings`. `false` if left out. It can't be changed later.
- `settings` object: TikTok's post settings, every one optional. Left out, TikTok's usual behavior applies: public, comments, duets and stitches on, no disclosure, no music. Call `GET /accounts/{accountId}/post-options` first to see what the account may set. A post with `toDrafts: true` takes no settings (`drafts_no_settings`): you set them in the TikTok app. A setting that doesn't fit the post is refused with its reason, for example `setting_videos_only` or `setting_photos_only`. The flags `aiGenerated`, `autoMusic` and `adsOnly` set to `false` are the same as left out. Every text value is at most 2,048 characters.
  - `privacy` string: Photos only: who can see the post. Videos are always public (`everyone`). `everyone` if left out. Not `only_me` with `brandedContent` other than `none` (`branded_private`). One of `everyone`, `friends`, `followers`, `only_me`.
  - `allowComments` boolean: Videos and photos. `false` turns comments off. On if left out.
  - `allowDuets` boolean: Videos only. `false` turns duets off. On if left out.
  - `allowStitches` boolean: Videos only. `false` turns stitches off. On if left out.
  - `brandedContent` string: Videos and photos: the commercial content disclosure. `your_brand` promotes your own business, `paid_partnership` promotes another brand, `both` is both at once. `none` if left out. One of `none`, `your_brand`, `paid_partnership`, `both`.
  - `aiGenerated` boolean: Videos only. `true` labels the video as made with AI. A photo post can't carry the label (`ai_label_photo`).
  - `coverAtMs` integer: Videos only. The frame to use as the cover, in milliseconds from the start. Not with `coverImageRef`. 0 to 600,000.
  - `coverImageRef` string: Videos only. A custom cover image: a `mediaRef` from `POST /uploads`, or a public `https` link straight to a JPEG, PNG or WebP up to 20 MB. Not with `coverAtMs`. At most 2,048 characters.
  - `coverPhotoIndex` integer: Photos only. Which photo is the cover, `0` for the first. It must be one of the post's photos. 0 to 34.
  - `music` object: Videos and photos: a track from TikTok's commercial music, added to the post. Not with `autoMusic` (`music_conflict`). The volumes, `startMs` and `endMs` are for videos only.
    - `trackId` string, required: A track's `id` from `GET /accounts/{accountId}/music` for this account. 1 to 200 characters.
    - `volume` integer: Videos only. The track's volume, 0 to 100. 50 if left out. 0 to 100.
    - `startMs` integer: Videos only. Where in the track to start, in milliseconds. 0 if left out. At least 0.
    - `endMs` integer: Videos only. Where in the track to stop, in milliseconds, after `startMs`. The video's end if left out. At least 1.
    - `videoSoundVolume` integer: Videos only. The video's own sound under the track, 0 to 100. 50 if left out. 0 to 100.
  - `autoMusic` boolean: Photos only. `true` lets TikTok add a recommended track. Not with `music`, and not with `brandedContent` other than `none` (`auto_music_branded`).
  - `location` object: Videos only. A place to tag, as `GET /accounts/{accountId}/locations` gives it.
    - `id` string, required: The place's `id`. 1 to 200 characters.
    - `name` string, required: The place's `name`. 1 to 200 characters.
  - `adsOnly` boolean: Videos only. `true` keeps the video off the profile, for use as an ad.

## Examples

### A video with music, a cover frame and a place

```bash
curl -X POST 'https://api.tiktornado.com/api/v1/posts' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "caption": "Leg day, no excuses #fitness #gym",
    "mediaRefs": [
      "https://media.example.com/uploads/7f3a9c/leg-day.mp4"
    ],
    "scheduledFor": "2026-12-02T15:00:00Z",
    "settings": {
      "allowDuets": false,
      "brandedContent": "your_brand",
      "coverAtMs": 1500,
      "music": {
        "trackId": "7312345678901234567",
        "volume": 40,
        "videoSoundVolume": 80
      },
      "location": {
        "id": "1234567890",
        "name": "Barcelona"
      }
    }
  }'
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "caption": "Leg day, no excuses #fitness #gym",
    "mediaRefs": [
      "https://media.example.com/uploads/7f3a9c/leg-day.mp4"
    ],
    "scheduledFor": "2026-12-02T15:00:00Z",
    "settings": {
      "allowDuets": false,
      "brandedContent": "your_brand",
      "coverAtMs": 1500,
      "music": {
        "trackId": "7312345678901234567",
        "volume": 40,
        "videoSoundVolume": 80
      },
      "location": {
        "id": "1234567890",
        "name": "Barcelona"
      }
    }
  }),
});
const data = await response.json();
```

```python
import os
import uuid

import requests

response = requests.post(
    "https://api.tiktornado.com/api/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
        "kind": "video",
        "caption": "Leg day, no excuses #fitness #gym",
        "mediaRefs": [
            "https://media.example.com/uploads/7f3a9c/leg-day.mp4",
        ],
        "scheduledFor": "2026-12-02T15:00:00Z",
        "settings": {
            "allowDuets": False,
            "brandedContent": "your_brand",
            "coverAtMs": 1500,
            "music": {
                "trackId": "7312345678901234567",
                "volume": 40,
                "videoSoundVolume": 80,
            },
            "location": {
                "id": "1234567890",
                "name": "Barcelona",
            },
        },
    },
)
data = response.json()
```

### A video posted at once

```bash
curl -X POST 'https://api.tiktornado.com/api/v1/posts' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "caption": "Morning run done",
    "mediaRefs": [
      "https://media.example.com/uploads/2b81de/morning-run.mp4"
    ],
    "postNow": true
  }'
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "caption": "Morning run done",
    "mediaRefs": [
      "https://media.example.com/uploads/2b81de/morning-run.mp4"
    ],
    "postNow": true
  }),
});
const data = await response.json();
```

```python
import os
import uuid

import requests

response = requests.post(
    "https://api.tiktornado.com/api/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
        "kind": "video",
        "caption": "Morning run done",
        "mediaRefs": [
            "https://media.example.com/uploads/2b81de/morning-run.mp4",
        ],
        "postNow": True,
    },
)
data = response.json()
```

### Photos for followers, with automatic music

```bash
curl -X POST 'https://api.tiktornado.com/api/v1/posts' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "photo",
    "caption": "Meal prep for the week",
    "mediaRefs": [
      "https://media.example.com/uploads/c4e017/prep-1.jpg",
      "https://media.example.com/uploads/c4e017/prep-2.jpg",
      "https://media.example.com/uploads/c4e017/prep-3.jpg"
    ],
    "scheduledFor": "2026-12-03T12:00:00+01:00",
    "settings": {
      "privacy": "followers",
      "coverPhotoIndex": 1,
      "autoMusic": true
    }
  }'
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "photo",
    "caption": "Meal prep for the week",
    "mediaRefs": [
      "https://media.example.com/uploads/c4e017/prep-1.jpg",
      "https://media.example.com/uploads/c4e017/prep-2.jpg",
      "https://media.example.com/uploads/c4e017/prep-3.jpg"
    ],
    "scheduledFor": "2026-12-03T12:00:00+01:00",
    "settings": {
      "privacy": "followers",
      "coverPhotoIndex": 1,
      "autoMusic": true
    }
  }),
});
const data = await response.json();
```

```python
import os
import uuid

import requests

response = requests.post(
    "https://api.tiktornado.com/api/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
        "kind": "photo",
        "caption": "Meal prep for the week",
        "mediaRefs": [
            "https://media.example.com/uploads/c4e017/prep-1.jpg",
            "https://media.example.com/uploads/c4e017/prep-2.jpg",
            "https://media.example.com/uploads/c4e017/prep-3.jpg",
        ],
        "scheduledFor": "2026-12-03T12:00:00+01:00",
        "settings": {
            "privacy": "followers",
            "coverPhotoIndex": 1,
            "autoMusic": True,
        },
    },
)
data = response.json()
```

### A video at the account's next free posting time

```bash
curl -X POST 'https://api.tiktornado.com/api/v1/posts' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "caption": "Tuesday tips",
    "mediaRefs": [
      "https://media.example.com/uploads/5ac3e8/tips.mp4"
    ],
    "queue": true
  }'
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "caption": "Tuesday tips",
    "mediaRefs": [
      "https://media.example.com/uploads/5ac3e8/tips.mp4"
    ],
    "queue": true
  }),
});
const data = await response.json();
```

```python
import os
import uuid

import requests

response = requests.post(
    "https://api.tiktornado.com/api/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
        "kind": "video",
        "caption": "Tuesday tips",
        "mediaRefs": [
            "https://media.example.com/uploads/5ac3e8/tips.mp4",
        ],
        "queue": True,
    },
)
data = response.json()
```

### A video sent to the account's TikTok drafts

```bash
curl -X POST 'https://api.tiktornado.com/api/v1/posts' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "mediaRefs": [
      "https://media.example.com/uploads/9d02aa/draft.mp4"
    ],
    "scheduledFor": "2026-12-02T18:00:00Z",
    "toDrafts": true
  }'
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
    "kind": "video",
    "mediaRefs": [
      "https://media.example.com/uploads/9d02aa/draft.mp4"
    ],
    "scheduledFor": "2026-12-02T18:00:00Z",
    "toDrafts": true
  }),
});
const data = await response.json();
```

```python
import os
import uuid

import requests

response = requests.post(
    "https://api.tiktornado.com/api/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "accountId": "j971x2c4ajrq0w8sd5e8fxz3a57v2k8m",
        "kind": "video",
        "mediaRefs": [
            "https://media.example.com/uploads/9d02aa/draft.mp4",
        ],
        "scheduledFor": "2026-12-02T18:00:00Z",
        "toDrafts": True,
    },
)
data = response.json()
```

## Response 201

The post is saved and on its way to TikTok's scheduler.

- `Idempotent-Replayed`: `true` when this is the stored answer to an earlier request with the same `Idempotency-Key`. Absent otherwise.

- `id` string, required: An id, letters and digits only. Matches `^[A-Za-z0-9]{1,64}$`.
- `status` string, required: Always `scheduling`.
- `scheduledFor` string, required: The time the post was saved for, in UTC: the one you chose, now for `postNow`, or the slot the queue picked. An ISO 8601 date and time.

```json
{
  "id": "k174wq9nrm6t2f0bd3xh8pz5a87v1c2e",
  "status": "scheduling",
  "scheduledFor": "2026-12-02T15:00:00.000Z"
}
```

## Errors

| Status | Reason | Message |
| --- | --- | --- |
| 400 | `invalid_request` | Something here isn't valid. Check it and try again. |
| 400 | `idempotency_key_required` | Send an Idempotency-Key header with every change, so a retry can't make it twice. |
| 400 | `account_not_ready` | This account isn't ready to post yet. Or: This account is under review by TikTok, so new posts can't be scheduled right now. |
| 400 | `invalid_state` | This can't be done right now. Refresh and try again. |
| 400 | `media_required` | Add a video or photos to this post. |
| 400 | `too_many_photos` | This post has too many photos. TikTok allows up to 35. |
| 400 | `caption_too_long` | Your caption is too long. TikTok allows 2,200 characters on videos and 4,000 on photo posts. |
| 400 | `link_not_allowed` | This link can't be used. Use a public https link to the file. |
| 400 | `link_unreachable` | We couldn't open this link. Make sure it's public and points straight at the file. |
| 400 | `upload_expired` | This upload has expired. Upload the file again. |
| 400 | `file_damaged` | This file looks damaged. Export it again and upload it. |
| 400 | `mixed_media` | A post can have a video or photos, not both. |
| 400 | `file_type_not_supported` | This file type isn't supported. Use MP4, MOV or WebM for videos, or JPEG, PNG or WebP for photos. |
| 400 | `file_too_large` | This file is too big. Videos can be up to 4 GB and photos 20 MB. |
| 400 | `photo_too_large` | This photo is too big. Photos can be up to 20 MB. |
| 400 | `schedule_too_soon` | Pick a time more than 10 minutes from now. |
| 400 | `past_account_end` | This account ends before that time. Pick an earlier time. |
| 400 | `daily_limit_reached` | This account has hit TikTok's daily posting limit. Pick a later time. |
| 400 | `queue_empty` | This account has no posting times yet. Add some, or pick a time. |
| 400 | `queue_full` | There's no free posting time in the next 4 weeks. Add more times, or pick one. |
| 400 | `drafts_no_settings` | Posts sent to drafts can't carry post settings. Add them in the TikTok app. |
| 400 | `ai_label_photo` | Photo posts can only be marked as AI-generated in the TikTok app. Send it to drafts instead. |
| 400 | `setting_videos_only` | This setting only works on video posts. |
| 400 | `setting_photos_only` | This setting only works on photo posts. |
| 400 | `music_conflict` | Pick a track or automatic music, not both. |
| 400 | `auto_music_branded` | Automatic music doesn't work on branded content. Pick a track instead. |
| 400 | `branded_private` | Branded content can't be posted as Only me. |
| 400 | `invalid_post_setting` | One of this post's settings isn't valid. Check it and try again. |
| 401 | `api_key_invalid` | This API key isn't valid. Check it, or create a new one in the app. |
| 403 | `access_locked` | Your subscription isn't active, so this can't be changed right now. Visit Billing to fix it. |
| 403 | `api_scope_missing` | This API key can't do this. Create a key with the access it needs in the app. |
| 404 | `not_found` | We couldn't find this. |
| 409 | `idempotency_in_progress` | A request with this Idempotency-Key is still running. Try again in a moment. |
| 422 | `idempotency_key_reused` | This Idempotency-Key was already used for a different request. Use a new one. |
| 429 | `slow_down` | You're going a bit fast. Wait a moment and try again. |
| 500 | `unknown_error` | Something went wrong on our side. We're on it. |
| 503 | `service_unavailable` | Something went wrong on our side. We're on it. |