> ## Documentation Index
> Fetch the complete documentation index at: https://kavenio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok Publishing API Documentation | Kavenio Docs

> Publish TikTok videos, photo carousels, and drafts with Kavenio. Review creator readiness, privacy settings, payloads, media rules, scheduling, and errors.

Kavenio publishes to TikTok through organic TikTok connected accounts. TikTok Ads
uses a separate `tiktokads` connection and is not used for organic posting.

Use `tiktok` as the platform value in post targets. Put TikTok-specific publish
settings in the target's `platformSpecificData`.

Kavenio gives each TikTok upload two options:

* **Post** publishes a video or photo carousel directly to the connected
  TikTok account.
* **Draft** sends a video or photo carousel to TikTok so the creator can review
  and finish it there.

Use `draft: true` for Draft. Omit `draft`, or set it to `false`, for Post.

## Quick Reference

| Capability                  | Support                                                                                     |
| --------------------------- | ------------------------------------------------------------------------------------------- |
| Platform key                | `tiktok`                                                                                    |
| Video direct post           | One HTTPS video URL                                                                         |
| Video draft upload          | `draft: true` sends the video to Creator Inbox                                              |
| Photo carousel direct post  | 1-35 image URLs                                                                             |
| Photo carousel draft upload | `mediaType: "photo"` with `draft: true`                                                     |
| Creator readiness           | `POST /v1/accounts/:accountId/tiktok/creator-info`                                          |
| Post analytics              | `GET /v1/analytics` for views, likes, comments, shares when the target has a final video ID |
| Native edit/unpublish       | Not supported by the current TikTok API integration                                         |

TikTok publish calls are asynchronous. A successful provider response returns a
TikTok `publish_id`, which Kavenio stores as the target `platformPostId`.
TikTok video analytics require the final TikTok video ID, so targets that still
only have the asynchronous `publish_id` report analytics as unavailable.

## Refresh Creator Info

Before direct posting, refresh creator info for the connected TikTok account.
This updates allowed privacy levels and creator readiness metadata.

```bash theme={null}
curl -X POST "$KAVENIO_API_BASE_URL/v1/accounts/acc_123/tiktok/creator-info" \
  -H "Authorization: Bearer $KAVENIO_API_KEY"
```

```ts theme={null}
await kavenio.accounts.refreshTikTokCreatorInfo("acc_123");
```

Use one of the returned privacy levels as `platformSpecificData.privacyLevel`.
TikTok privacy options are account-specific.

## Option 1: Post A Video

```json theme={null}
{
  "profileId": "customer_user_123",
  "content": "Fallback caption if description is omitted.",
  "mediaItems": [
    {
      "type": "video",
      "url": "https://cdn.example.com/launch.mp4",
      "mimeType": "video/mp4"
    }
  ],
  "platforms": [
    {
      "platform": "tiktok",
      "accountId": "acc_123",
      "platformSpecificData": {
        "privacyLevel": "PUBLIC_TO_EVERYONE",
        "allowComment": true,
        "allowDuet": false,
        "allowStitch": true,
        "videoCoverTimestampMs": 1000,
        "videoMadeWithAi": false,
        "description": "TikTok launch caption",
        "commercialContentType": "none",
        "contentPreviewConfirmed": true,
        "expressConsentGiven": true
      }
    }
  ],
  "publishNow": true
}
```

```bash theme={null}
kavenio posts create \
  --profile-id customer_user_123 \
  --content "Fallback caption if description is omitted." \
  --publish-now \
  --media-url https://cdn.example.com/launch.mp4 \
  --platform tiktok:acc_123 \
  --privacy-level PUBLIC_TO_EVERYONE \
  --allow-comment true \
  --allow-duet false \
  --allow-stitch true \
  --content-preview-confirmed \
  --express-consent-given
```

Direct video posts require:

* exactly one `video` media item
* an HTTPS media URL
* `privacyLevel`
* `contentPreviewConfirmed: true`
* `expressConsentGiven: true`

`description` overrides the top-level `content` for the TikTok caption. Video
captions can be up to 2,200 characters.

## Option 2: Send A Video Draft

Use `draft: true` to send a video to the creator inbox instead of direct
publishing.

```json theme={null}
{
  "content": "Draft video caption",
  "mediaItems": [
    {
      "type": "video",
      "url": "https://cdn.example.com/draft.mp4",
      "mimeType": "video/mp4"
    }
  ],
  "platforms": [
    {
      "platform": "tiktok",
      "accountId": "acc_123",
      "platformSpecificData": {
        "draft": true
      }
    }
  ],
  "publishNow": true
}
```

Draft video upload uses TikTok's Creator Inbox path and returns an async
`publish_id`.

## Photo Carousel

Set `mediaType: "photo"` for TikTok photo carousels.

```json theme={null}
{
  "content": "Fallback photo description",
  "mediaItems": [
    {
      "type": "image",
      "url": "https://cdn.example.com/photo-1.jpg",
      "mimeType": "image/jpeg"
    },
    {
      "type": "image",
      "url": "https://cdn.example.com/photo-2.webp",
      "mimeType": "image/webp"
    }
  ],
  "platforms": [
    {
      "platform": "tiktok",
      "accountId": "acc_123",
      "platformSpecificData": {
        "mediaType": "photo",
        "privacyLevel": "PUBLIC_TO_EVERYONE",
        "allowComment": true,
        "title": "Photo launch",
        "description": "TikTok photo description",
        "photoCoverIndex": 1,
        "autoAddMusic": true,
        "commercialContentType": "brand_content",
        "contentPreviewConfirmed": true,
        "expressConsentGiven": true
      }
    }
  ],
  "publishNow": true
}
```

Photo carousel rules:

| Field             | Rule                                                    |
| ----------------- | ------------------------------------------------------- |
| `mediaType`       | Must be `"photo"`                                       |
| `mediaItems`      | 1-35 images                                             |
| `photoCoverIndex` | Required, zero-based, must reference one included image |
| `title`           | Optional, up to 90 characters                           |
| `description`     | Optional, up to 4,000 characters                        |
| `autoAddMusic`    | Photo carousel only                                     |

Direct photo posts require `privacyLevel`, `contentPreviewConfirmed`, and
`expressConsentGiven`. Draft photo uploads can omit the direct-post confirmation
and privacy fields, but still need `photoCoverIndex`.

## Media URLs

TikTok pulls media from your URLs. Kavenio validates obvious unsafe URLs before
calling TikTok.

Requirements:

* URLs must be public and HTTPS.
* Private, loopback, and localhost URLs are rejected.
* Video posts require exactly one video media item.
* Photo posts require image media only.
* Photo MIME metadata, when supplied, must start with `image/`.

## Commercial Content And AI Disclosure

Use these fields when relevant:

| Field                   | Behavior                                                             |
| ----------------------- | -------------------------------------------------------------------- |
| `videoMadeWithAi`       | Sends TikTok's AI-generated content disclosure flag for video posts. |
| `commercialContentType` | Maps commercial-content disclosure settings.                         |
| `allowComment`          | Controls comment availability.                                       |
| `allowDuet`             | Video posts only.                                                    |
| `allowStitch`           | Video posts only.                                                    |

Photo posts reject video-only options such as `allowDuet`, `allowStitch`,
`videoCoverTimestampMs`, `videoCoverImageUrl`, and `videoMadeWithAi` unless the
post is a draft upload.

## Scheduling

Use Kavenio scheduling fields:

```json theme={null}
{
  "content": "Scheduled TikTok launch.",
  "scheduledFor": "2027-06-16T10:00:00.000Z",
  "mediaItems": [
    {
      "type": "video",
      "url": "https://cdn.example.com/launch.mp4",
      "mimeType": "video/mp4"
    }
  ],
  "platforms": [
    {
      "platform": "tiktok",
      "accountId": "acc_123",
      "platformSpecificData": {
        "privacyLevel": "PUBLIC_TO_EVERYONE",
        "contentPreviewConfirmed": true,
        "expressConsentGiven": true
      }
    }
  ]
}
```

Scheduled media URLs must remain publicly reachable until the scheduled publish
job runs.

## Lifecycle Limitations

TikTok native post-publish edit and unpublish are deliberately unsupported.
Kavenio returns `PROVIDER_UNSUPPORTED` for TikTok lifecycle requests because the
current Content Posting API integration does not expose a native edit, delete,
or unpublish endpoint for published posts.

## Common Errors

| Error                                                                    | Meaning                                                             |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------- |
| `TikTok publishing requires exactly one video media item.`               | The target is using video mode but does not have exactly one video. |
| `TikTok video publishing requires an HTTPS media URL.`                   | TikTok direct video publishing requires HTTPS URL pull.             |
| `TikTok publishing requires platformSpecificData.privacyLevel.`          | Direct posts need a creator-allowed privacy level.                  |
| `TikTok publishing requires contentPreviewConfirmed=true.`               | Set the required TikTok preview confirmation flag.                  |
| `TikTok publishing requires expressConsentGiven=true.`                   | Set the required TikTok consent flag.                               |
| `TikTok photo publishing requires 1-35 image media items.`               | Photo mode needs at least one image and no more than 35.            |
| `TikTok photo publishing requires platformSpecificData.photoCoverIndex.` | Choose the carousel cover image by index.                           |
| `TikTok photoCoverIndex must reference an included media item.`          | The cover index is outside the supplied image list.                 |
| `Private and localhost media URLs are not allowed.`                      | Use a public media URL.                                             |
