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

# TikTok

> Connect and interact with TikTok accounts via the TikTok API.

<Badge>Available</Badge>

**Managed connector** - [SocialAPI](https://social-api.ai) handles the TikTok Developer App and platform app review for you. No customer-side TikTok for Developers registration required. See [Platform credentials](/guides/platform-credentials).

TikTok is supported for listing videos and publishing new posts via the TikTok Content Posting API.

## At a glance

| Field         | Value                                  |
| ------------- | -------------------------------------- |
| Platform slug | `tiktok`                               |
| Auth type     | OAuth 2.0 (TikTok)                     |
| API           | TikTok Content Posting API             |
| Best for      | Short-form video publishing to TikTok. |

## Capabilities

| Feature              | Supported | Notes                          |
| -------------------- | --------- | ------------------------------ |
| List posts           | Yes       | Returns published videos       |
| Create post          | Yes       | Via TikTok Content Posting API |
| Delete post          | -         | Not supported via TikTok API   |
| Comments             | -         | Not supported via TikTok API   |
| Reply to comment     | -         |                                |
| Moderate comment     | -         |                                |
| Toggle post comments | -         |                                |
| DMs                  | -         | Not supported by platform API  |
| Reviews              | -         | Not applicable                 |
| Mentions             | -         | Not supported via TikTok API   |

## Connecting

```bash theme={null}
curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "tiktok",
    "redirect_uri": "https://app.example.com/oauth/callback",
    "state": "session_abc123"
  }'
```

Response:

```json theme={null}
{
  "auth_url": "https://www.tiktok.com/v2/auth/authorize/?client_key=...&state=...",
  "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2"
}
```

Redirect your user to `auth_url`. After they authorize, SocialAPI exchanges the code with TikTok and redirects the user to your `redirect_uri` with the connection result. See [OAuth flows](/guides/oauth#step-3-receive-the-result-at-your-redirect_uri) for the redirect parameters.

TikTok accounts include a `metadata` object with profile data:

```json theme={null}
{
  "id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
  "platform": "tiktok",
  "name": "Acme Corp",
  "username": "acmecorp",
  "metadata": {
    "avatar_url": "https://p16.tiktokcdn.com/...",
    "follower_count": 12400,
    "following_count": 180,
    "video_count": 94,
    "likes_count": 340000
  }
}
```

| Field             | Type    | Description                   |
| ----------------- | ------- | ----------------------------- |
| `avatar_url`      | string  | Profile picture URL           |
| `follower_count`  | integer | Number of followers           |
| `following_count` | integer | Number of accounts followed   |
| `video_count`     | integer | Total published videos        |
| `likes_count`     | integer | Total likes across all videos |

## Reading samples

### List posts

```bash theme={null}
curl -X GET "https://api.social-api.ai/v1/posts?account_ids=acc_01HZ9X3Q4R5M6N7P8V2K0W1J" \
  -H "Authorization: Bearer $SOCAPI_KEY"
```

## Publishing

Create a TikTok post. `media_type` is optional and defaults to `video`. `privacy_level` must be supplied explicitly: omitting it returns a 400 validation error (`privacy_level_required`). Valid values depend on the creator's allowed options (returned by the TikTok creator info API); a common example is `PUBLIC_TO_EVERYONE`.

```bash theme={null}
curl -X POST https://api.social-api.ai/v1/posts \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Check out this video!",
    "media_ids": ["f47ac10b-58cc-4372-a567-0e02b2c3d479"],
    "targets": [
      {
        "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
        "platform_data": {
          "media_type": "video",
          "privacy_level": "PUBLIC_TO_EVERYONE"
        }
      }
    ]
  }'
```

For the full field reference, media constraints, and error recovery, see [TikTok posts](/posts/tiktok).

## Limitations and gotchas

* **Publishing.** Post creation uses the TikTok Content Posting API. Videos are uploaded via media upload, then published.
* **Read-only interactions.** TikTok's API does not expose comment management or DM access. Only post listing and publishing are available.
* **Token refresh.** TikTok OAuth tokens expire. SocialAPI handles refresh automatically. If you receive `401` with `code: "platform.tiktok.auth"`, reconnect the account.
* **Privacy level.** `privacy_level` is required and must be set explicitly for every post. Omitting it returns a 400 error (`privacy_level_required`). Use the value the TikTok creator info API returns for the account (for example, `PUBLIC_TO_EVERYONE`, `MUTUAL_FOLLOW_FRIENDS`, or `SELF_ONLY`); any other value is rejected.

## Permissions

SocialAPI's managed TikTok Developer App already requests these scopes on your behalf: `user.info.basic`, `user.info.profile`, `video.publish`, `video.upload`. You don't need to register with TikTok for Developers. See [Platform credentials](/guides/platform-credentials).

## Related

* [Platform credentials](/guides/platform-credentials)
* [OAuth flows](/guides/oauth)
* [Publishing to TikTok](/posts/tiktok)
* [Errors](/guides/errors)
