PlatformsTikTok

TikTok

TikTok business accounts through your TikTok API for Business app ("TikTok Accounts").

The permissions each operation needs are in App Review: TikTok.

  • video and photo are publish variants of tiktok.videos.posts.
  • There is no live surface: TikTok publishes no LIVE API.
  • Koil registers your app's webhook callbacks with TikTok itself, per event family and only while an Event Destination is subscribed to a topic that family feeds, so there is no developer-console step.

Publishing is not yet usable

TikTok pulls post media only from a URL whose domain or prefix your app has verified as a URL property, and Koil currently serves staged media from an origin no customer can verify. A publish is rejected up front with that reason rather than failing minutes later. Reading, replying, moderating, and messaging are unaffected.
CollectionOperationsEventsBackfill
tiktok.videos.postslist, get, publishcreated, deletedyes
tiktok.videos.commentslist, get, publish, perform_action, deletecreated, updated, deleted, moderatedyes
tiktok.videos.mentionslist, getcreated, updatedyes
tiktok.dm.conversationslist, perform_actionupdatedno
tiktok.dm.messageslist, resolve_attachment, publishcreatedyes

tiktok.videos.posts

The account's public video and photo posts.

list

List the TikTok account's public posts, newest first.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one TikTok post by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Publish a TikTok video or photo post.

Submit through POST /v1/publish-requests with collection: "tiktok.videos.posts". These fields go in the item's args; profileId and variant are item fields.

variant: "video"

FieldTypeRequiredDescription
textstringnoCaption; hashtags and @mentions render as plain text. Up to 2,200 UTF-16 code units and 30 mentions.
mediaobject | object[]yes
brandOrganicbooleanyesLabel the post as promotional content for the account's own business.
paidPartnershipbooleanyesLabel the post as a paid partnership with a brand.
disableCommentbooleanno
disableDuetbooleanno
disableStitchbooleanno
thumbnailOffsetMsintegerno
customThumbnailUrlstringnoCover image for the video, as a URL on a URL property the app has verified — the same rule the staged video URL follows. JPG, JPEG, WebP or PNG, 360×360 to 1080×1920 (or 1920×1080), within 20 MB. Cannot be combined with thumbnailOffsetMs, which TikTok ignores when a cover URL is set.
aiGeneratedbooleannoLabel the post as AI-generated, with the platform's own AI label.
draftbooleannoDeliver to the creator's TikTok inbox as a draft instead of publishing; needs the video.upload scope and ignores every other post setting.
JSON Schema
{
  "type": "object",
  "required": [
    "media",
    "brandOrganic",
    "paidPartnership"
  ],
  "properties": {
    "text": {
      "type": "string",
      "description": "Caption; hashtags and @mentions render as plain text. Up to 2,200 UTF-16 code units and 30 mentions.",
      "maxLength": 2200
    },
    "media": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1,
                "pattern": "^video/"
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1,
                "pattern": "^video/"
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1
    },
    "brandOrganic": {
      "type": "boolean",
      "description": "Label the post as promotional content for the account's own business."
    },
    "paidPartnership": {
      "type": "boolean",
      "description": "Label the post as a paid partnership with a brand."
    },
    "disableComment": {
      "type": "boolean"
    },
    "disableDuet": {
      "type": "boolean"
    },
    "disableStitch": {
      "type": "boolean"
    },
    "thumbnailOffsetMs": {
      "type": "integer",
      "minimum": 0
    },
    "customThumbnailUrl": {
      "type": "string",
      "description": "Cover image for the video, as a URL on a URL property the app has verified — the same rule the staged video URL follows. JPG, JPEG, WebP or PNG, 360×360 to 1080×1920 (or 1920×1080), within 20 MB. Cannot be combined with thumbnailOffsetMs, which TikTok ignores when a cover URL is set.",
      "minLength": 1
    },
    "aiGenerated": {
      "type": "boolean",
      "description": "Label the post as AI-generated, with the platform's own AI label."
    },
    "draft": {
      "type": "boolean",
      "description": "Deliver to the creator's TikTok inbox as a draft instead of publishing; needs the video.upload scope and ignores every other post setting."
    }
  },
  "additionalProperties": false
}

variant: "photo"

FieldTypeRequiredDescription
titlestringno
textstringnoCaption; hashtags and @mentions render as plain text. Up to 4,000 UTF-16 code units and 30 mentions.
mediaobject | object[]yes
privacyLevel"public_to_everyone" | "mutual_follow_friends" | "follower_of_creator" | "self_only"yes
coverIndexintegernoWhich image is the cover; defaults to the first.
autoAddMusicbooleanno
brandOrganicbooleanyesLabel the post as promotional content for the account's own business.
paidPartnershipbooleanyesLabel the post as a paid partnership with a brand.
disableCommentbooleanno
draftbooleannoDeliver to the creator's TikTok inbox as a draft instead of publishing; needs the video.upload scope and keeps only the title and caption.
JSON Schema
{
  "type": "object",
  "required": [
    "media",
    "privacyLevel",
    "brandOrganic",
    "paidPartnership"
  ],
  "properties": {
    "title": {
      "type": "string",
      "maxLength": 90
    },
    "text": {
      "type": "string",
      "description": "Caption; hashtags and @mentions render as plain text. Up to 4,000 UTF-16 code units and 30 mentions.",
      "maxLength": 4000
    },
    "media": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 35
    },
    "privacyLevel": {
      "enum": [
        "public_to_everyone",
        "mutual_follow_friends",
        "follower_of_creator",
        "self_only"
      ]
    },
    "coverIndex": {
      "type": "integer",
      "minimum": 0,
      "description": "Which image is the cover; defaults to the first."
    },
    "autoAddMusic": {
      "type": "boolean"
    },
    "brandOrganic": {
      "type": "boolean",
      "description": "Label the post as promotional content for the account's own business."
    },
    "paidPartnership": {
      "type": "boolean",
      "description": "Label the post as a paid partnership with a brand."
    },
    "disableComment": {
      "type": "boolean"
    },
    "draft": {
      "type": "boolean",
      "description": "Deliver to the creator's TikTok inbox as a draft instead of publishing; needs the video.upload scope and keeps only the title and caption."
    }
  },
  "additionalProperties": false
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

VariantMediaCopied as isOtherwise convertedRefused
videoVideoMP4/MOV, H.264, HEVC or VP9; at most 60 fpsre-encoded to H.264 in MP4; frame rate loweredsmaller than 360×360; shorter than 3 s; longer than 10 min (or the account's lower limit); under 23 fps; over 1 GB once staged
photoImageJPEG or WebP; long edge at most 1920 px; short edge at most 1080 pxre-encoded to JPEG; downscaled to fitover 20 MB once staged

Not offered

  • resolve_attachment: not applicable
  • update: platform no endpoint
  • perform_action: platform not supported
  • delete: platform no endpoint

Events

Backfill: supported (bounded coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
referencesobject[]no
textstringnoCaption/body text for content.
mediaobject[]no
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
variant"video" | "photo" | "other"yesTikTok's media_type. other is a type TikTok added that Koil does not model yet.
embedUrlstringno
durationSecondsnumberno
isAdbooleanno
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"tiktok.videos.posts"yesThe collection that delivered this item.

tiktok.videos.comments

Comments on the account's posts, and replies to them.

list

List comments on one TikTok post, or the replies to one of its comments.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
targetIdstringnoA comment: lists its replies instead.
includeRepliesbooleannoInclude up to three replies inline under each top-level comment.
includeHiddenbooleannoInclude comments hidden from the public (hidden: true); defaults to true.
sort"likes" | "replies" | "newest"noMost liked, most replied to, or newest first.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "containerId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same `containerId`, replies to replies included. A post in the account has none."
    },
    "targetId": {
      "type": "string",
      "minLength": 1,
      "description": "A comment: lists its replies instead."
    },
    "includeReplies": {
      "type": "boolean",
      "description": "Include up to three replies inline under each top-level comment."
    },
    "includeHidden": {
      "type": "boolean",
      "description": "Include comments hidden from the public (`hidden: true`); defaults to true."
    },
    "sort": {
      "enum": [
        "likes",
        "replies",
        "newest"
      ],
      "description": "Most liked, most replied to, or newest first."
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one TikTok comment by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "containerId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same `containerId`, replies to replies included. A post in the account has none."
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Publish a TikTok comment: a top-level comment on a post, or a reply to a comment or a comment mention. The body is text, one image, or both.

Submit through POST /v1/publish-requests with collection: "tiktok.videos.comments". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
targetobjectyesOne thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL.
containerIdstringnoThe post the targeted comment is on; required to reply to a comment or a comment mention.
textstringnoComment text, up to 1,200 UTF-8 characters.
attachmentsobject | object[]noAt most one image; a TikTok comment carries a single picture.
JSON Schema
{
  "type": "object",
  "required": [
    "target"
  ],
  "properties": {
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "tiktok.videos.comments",
            "tiktok.videos.posts",
            "tiktok.videos.mentions"
          ]
        },
        "externalId": {
          "type": "string",
          "description": "Platform-owned content identifier.",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "description": "One thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL."
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The post the targeted comment is on; required to reply to a comment or a comment mention."
    },
    "text": {
      "type": "string",
      "description": "Comment text, up to 1,200 UTF-8 characters.",
      "minLength": 1,
      "maxLength": 1200
    },
    "attachments": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "The name the recipient sees on a document, where the destination shows one. Defaults to the uploaded file's name."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "The name the recipient sees on a document, where the destination shows one. Defaults to the uploaded file's name."
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1,
      "description": "At most one image; a TikTok comment carries a single picture."
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "text"
      ]
    },
    {
      "required": [
        "attachments"
      ]
    }
  ]
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

MediaCopied as isOtherwise convertedRefused
ImageJPEG, WebP or PNG; long edge at most 1920 px; short edge at most 1080 pxre-encoded to JPEG; downscaled to fitsmaller than 360×360; over 5 MB once staged

perform_action

Hide, unhide, like, or unlike a TikTok comment. Answers with the action applied. TikTok says an unhide does not always take effect; the moderated event reports the outcome.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
containerIdstringnoThe post the comment is on. Required for hide and unhide; ignored by like and unlike, which TikTok addresses by comment id alone.
action"hide" | "unhide" | "like" | "unlike"yesWhat to do with the item: hide (hide it from public view), unhide (show a hidden item again), like (like it as the profile), unlike (remove the profile's like).
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "action"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The post the comment is on. Required for hide and unhide; ignored by like and unlike, which TikTok addresses by comment id alone."
    },
    "action": {
      "enum": [
        "hide",
        "unhide",
        "like",
        "unlike"
      ],
      "description": "What to do with the item: `hide` (hide it from public view), `unhide` (show a hidden item again), `like` (like it as the profile), `unlike` (remove the profile's like).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

delete

Delete a TikTok comment the account made.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • update: platform not supported

Events

Backfill: supported (partial coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
targetobjectyesThe one thing on the platform this item directly responds to: a comment's post, or the comment it replies to; a message's quoted or replied-to message, story or comment; what a reaction reacts to. Absent when the platform reports nothing it responds to.
referencesobject[]no
textstringnoCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
ownerAuthoredbooleannoWhether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did.
attachmentsunknown | unknown | unknown[]no
hiddenbooleannoWhether the account hid the comment from the public. Absent when the platform did not say.
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
updatedAtstring (date-time)noWhen the platform last updated it.
externalIdstringyesPlatform-owned content identifier.
pinnedbooleanno
likedbooleanno
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"tiktok.videos.comments"yesThe collection that delivered this item.

tiktok.videos.mentions

@-mentions of the account in other users' captions and comments.

list

List the top mentions of the TikTok account in other users' captions or comments.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
variant"post" | "comment"yes
sincestring (date-time)noOldest mention time to list; defaults to 90 days ago. TikTok looks back at most 90 days; an earlier since returns those 90 days. TikTok's window counts whole days, so mentions up to a day older can also appear.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "variant"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "variant": {
      "enum": [
        "post",
        "comment"
      ]
    },
    "since": {
      "type": "string",
      "format": "date-time",
      "description": "Oldest mention time to list; defaults to 90 days ago. TikTok looks back at most 90 days; an earlier `since` returns those 90 days. TikTok's window counts whole days, so mentions up to a day older can also appear."
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one mention in full, hydrating a mention event: TikTok's webhook payload carries no engagement counts or thumbnail, and no comment text or author handle for a comment mention. Details stay readable for 48 hours after the webhook.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe mention's id: the comment id for a comment mention, the post id for a post (caption) mention.
containerIdstringnoThe post a comment mention is on; required for a comment mention.
variant"post" | "comment"yes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "variant"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The mention's id: the comment id for a comment mention, the post id for a post (caption) mention."
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The post a comment mention is on; required for a comment mention."
    },
    "variant": {
      "enum": [
        "post",
        "comment"
      ]
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • publish: not applicable
  • update: not applicable
  • perform_action: platform not supported
  • delete: not applicable

Events

Backfill: supported (partial coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
variant"post" | "comment"yesWhether the mentioning item is a post (identified by the post itself) or a comment (with the post it is on as containerId).
containerIdstringnoThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
textstringnoCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
mediaobject[]no
engagementobjectnoPlatform-reported engagement counts.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"tiktok.videos.mentions"yesThe collection that delivered this item.

tiktok.dm.conversations

The account's Business Messaging conversations.

list

List the TikTok Business Account's direct-message conversations from the last 90 days.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
messageRequestbooleanyestrue lists message requests the account has not replied to; false lists conversations it has replied in. TikTok keeps them under separate cursors.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "messageRequest"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "messageRequest": {
      "type": "boolean",
      "description": "true lists message requests the account has not replied to; false lists conversations it has replied in. TikTok keeps them under separate cursors."
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

perform_action

Mark the person's messages in the account's TikTok conversation as seen, or show that the account is typing. TikTok clears a typing indicator after five seconds and has no action that clears it sooner.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe conversation, as its externalId names it: TikTok's conversation_id.
action"seen" | "typing_on"yesWhat to do with the item: seen (show the person a read receipt for their messages), typing_on (show the person that the profile is typing).
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "action"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation, as its `externalId` names it: TikTok's `conversation_id`."
    },
    "action": {
      "enum": [
        "seen",
        "typing_on"
      ],
      "description": "What to do with the item: `seen` (show the person a read receipt for their messages), `typing_on` (show the person that the profile is typing).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

Not offered

  • get: platform no endpoint
  • resolve_attachment: not applicable
  • publish: not applicable
  • update: not applicable
  • delete: platform no endpoint
  • perform_action typing_off: platform no endpoint — TikTok's sender actions are TYPING and MARK_READ only; the typing indicator clears itself after five seconds.

Events

Backfill: not offered — not applicable — Conversations emit only updated, and backfill emits created; a new conversation arrives as its first message, which tiktok.dm.messages backfills..

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
counterpartobjectnoThe person the account is talking to in a 1:1 conversation. A group chat has none.
messageRequestbooleannoWhether the conversation is still a message request: the person wrote and the account has not replied yet. Absent when the read or event did not say.
updatedAtstring (date-time)noWhen the conversation last changed, as the platform reports it.
externalIdstringyesPlatform-owned content identifier.
referralobjectno
lastReadAtstring (date-time)noWhen the platform last updated it.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"tiktok.dm.conversations"yesThe collection that delivered this item.

tiktok.dm.messages

Messages in one Business Messaging conversation.

list

List the 20 most recent messages of one TikTok direct-message conversation.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "containerId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same `containerId`, replies to replies included. A post in the account has none."
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

resolve_attachment

Get a URL for an image or video a TikTok direct message carries. TikTok mints one per call, valid for 24 hours.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe item that carries the file.
attachmentExternalIdstringyesThe attachment's externalId, as the read reported it.
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
attachmentType"image" | "video"yesThe attachment's type, as the read reported it.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "attachmentExternalId",
    "containerId",
    "attachmentType"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The item that carries the file."
    },
    "attachmentExternalId": {
      "type": "string",
      "minLength": 1,
      "description": "The attachment's `externalId`, as the read reported it."
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same `containerId`, replies to replies included. A post in the account has none."
    },
    "attachmentType": {
      "enum": [
        "image",
        "video"
      ],
      "description": "The attachment's `type`, as the read reported it."
    }
  },
  "additionalProperties": false
}

publish

Send a message into a TikTok conversation the user opened: text, optionally quoting one of its messages, or one image.

Submit through POST /v1/publish-requests with collection: "tiktok.dm.messages". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
containerIdstringyesThe conversation to send into.
textstringnoMessage text, up to 6,000 characters.
targetobjectnoOne thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL.
attachmentsobject | object[]noOne image, sent without text; TikTok sends a single picture per message. Staged, then uploaded to TikTok for a media_id.
conversationMessageRequestbooleanno
JSON Schema
{
  "type": "object",
  "required": [
    "containerId"
  ],
  "properties": {
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation to send into."
    },
    "text": {
      "type": "string",
      "description": "Message text, up to 6,000 characters.",
      "minLength": 1,
      "maxLength": 6000
    },
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "tiktok.dm.messages"
          ]
        },
        "externalId": {
          "type": "string",
          "description": "Platform-owned content identifier.",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "description": "One thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL."
    },
    "attachments": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "The name the recipient sees on a document, where the destination shows one. Defaults to the uploaded file's name."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "The name the recipient sees on a document, where the destination shows one. Defaults to the uploaded file's name."
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1,
      "description": "One image, sent without `text`; TikTok sends a single picture per message. Staged, then uploaded to TikTok for a media_id."
    },
    "conversationMessageRequest": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "text"
      ]
    },
    {
      "required": [
        "attachments"
      ]
    }
  ],
  "dependentSchemas": {
    "attachments": {
      "properties": {
        "text": false,
        "target": false
      }
    },
    "text": {
      "properties": {
        "conversationMessageRequest": false
      }
    }
  }
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

MediaCopied as isOtherwise convertedRefused
ImageJPEG or PNG; long edge at most 1920 px; short edge at most 1080 pxre-encoded to JPEG; downscaled to fitover 3 MB once staged

Not offered

  • get: platform no endpoint
  • update: platform not supported
  • perform_action: not applicable — Read receipts and typing indicators act on the conversation, not on one message.
  • delete: platform not supported

Events

Backfill: supported (partial coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
containerIdstringyesThe conversation: the same on every message in it, on reads and events alike, so an inbox groups by it. It is TikTok's conversation id, a WhatsApp group's id, and in a 1:1 chat on Instagram, Facebook or WhatsApp the counterpart's own id, since Meta's messaging webhooks carry no conversation id.
targetobjectnoThe one thing on the platform this item directly responds to: a comment's post, or the comment it replies to; a message's quoted or replied-to message, story or comment; what a reaction reacts to. Absent when the platform reports nothing it responds to.
referencesobject[]no
textstringnoCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
ownerAuthoredbooleannoWhether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did.
attachmentsunknown | unknown | unknown[]no
choiceobjectnoThe option the person picked instead of typing: a quick reply, a button or a list row a message offered, or one of the account's ice breakers. Its label is the message's text, and the message that offered it is target where the platform names it. Present where the platform reports the tap, which on Instagram and Messenger is the message's event only: a read of the same message returns its text without choice. Absent too when the platform withholds the payload (Meta sends a postback's payload only to the app that sent the button), so such a tap reads as typed text.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
variant"text" | "image" | "video" | "share_post" | "emoji" | "sticker" | "template" | "other"yesTikTok's message type. other is a type TikTok added that Koil does not model yet.
recipientobjectnoPlatform actor reference for observed content.
sourcestringno
autoMessageType"welcome_message" | "suggested_question" | "auto_reply" | "other"noWhich automation sent it. other is one TikTok added that Koil does not model yet.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"tiktok.dm.messages"yesThe collection that delivered this item.

On this page