Skip to main content
POST
cURL
Every target account must belong to the requested source. An idempotent replay also verifies the stored source and account set; conflicts return 409. Call Media Presign and upload the file. Set media_items[].url to the returned public_url. Submit the post only after the upload succeeds and the object is readable. After validation, the gateway submits the request to TikTok immediately. It selects the mode from the account’s publishing capabilities. Photo carousel rules for tiktok_direct:
  • Format: JPEG or WebP only (PNG, GIF, and undeclared image formats are rejected).
  • No mixed media: do not combine photos and videos in the same media_items array.
  • Count limit: 1 to 35 images per post on hosted OmniMux (matching the TikTok Photo API protocol maximum; self-hosted deployments default to 10 items per request and can be configured up to 35).
  • Verified-domain delivery: every image URL is wrapped through the gateway’s signed verified-domain media proxy before calling TikTok.
  • Metadata fields: pass title, description, photo_cover_index (0-based; must be less than the image count), and is_aigc inside tiktok_options (top-level fields of the same names are also accepted for compatibility, with tiktok_options taking precedence).
Capabilities are evaluated strictly from the OAuth scopes actually granted to the account (fail-closed): an account without video.upload or video.publish returns 409 SOCIAL_TIKTOK_SCOPE_MISSING. A newly created post starts as submitted. When Get Post refreshes the status, the gateway maps TikTok’s SEND_TO_USER_INBOX to non-terminal sent_to_inbox (keeping processing for transfer/encoding states) and PUBLISH_COMPLETE to published. provider is required and has one current value, tiktok_direct. A retired source identifier returns 410 provider-retired; missing or unknown values return 400 invalid-provider.

Structured TikTok upstream errors

When TikTok returns an upstream business error or rate limit, the gateway returns a structured JSON body (success: false, code, message, plus sanitized upstream_code and upstream_log_id when supplied by TikTok) with a non-401/403 HTTP status so TikTok token errors are never confused with OmniMux session failures: CLI: omnimux social post --provider tiktok_direct --accounts <account-id> --media <url> --title "Draft title" --photo-cover-index 0 --is-aigc=false (supports --description, --tiktok-options '<json>', and compliance flags). Passing a retired --provider value fails locally in the CLI before any network request. Use an OmniMux user access token and New-Api-User, not an sk- key. Inspect both HTTP status and success (structured TikTok upstream errors return 409/429/502, while generic failures may still return HTTP 200 with success: false).

Authorizations

Authorization
string
header
required

OmniMux user access token, not an sk- API key.

New-Api-User
string
header
required

Current authenticated user ID.

Headers

Idempotency-Key
string

Replay must match both source and account set. X-Idempotency-Key is also accepted.

Body

application/json
provider
enum<string>
required

Required source identifier; currently only tiktok_direct is accepted.

Available options:
tiktok_direct
account_ids
integer<int64>[]
required

Owned OmniMux account IDs, all belonging to the requested source. Official publishing supports one account.

Minimum array length: 1
media_items
object[]
required

Required TikTok media. Both Draft upload (video.upload) and Direct Post (video.publish) accept either one video or a JPEG/WebP photo carousel (no mixed photo+video). Hosted OmniMux supports 1 to 35 images per photo post (TikTok Photo API maximum); self-hosted deployments default to 10 items and can be configured up to 35.

Minimum array length: 1
content
string

Optional caption for Direct Post, or fallback description for photo drafts when tiktok_options.description is omitted. Ignored for video drafts.

tiktok_options
object

TikTok metadata and publishing options. Photo draft uploads (video.upload, MEDIA_UPLOAD) accept title, description, photo_cover_index, and is_aigc and never forward Direct Post privacy, interaction, or disclosure fields. Video draft uploads ignore this object. Direct Post (video.publish) uses the privacy, interaction, disclosure, and photo fields.

title
string

Optional compatibility alias for tiktok_options.title on photo posts.

description
string

Optional compatibility alias for tiktok_options.description on photo posts.

photo_cover_index
integer

Optional compatibility alias for tiktok_options.photo_cover_index on photo posts.

Required range: x >= 0
is_aigc
boolean

Optional compatibility alias for tiktok_options.is_aigc on photo posts.

Response

Check success before reading data. Generic upstream errors may use HTTP 200 with success:false.

success
enum<boolean>
required
Available options:
true
data
object
required