API Documentation
Integrate QPost directly into your applications, scripts, and workflows.
TikTok account statistics
Use GET /api/accounts/tiktok/stats with your API key or the MCP tool get_account_stats for followers, following, total likes and public-video count. Results include fetchedAt. Existing TikTok connections may need reauthorization in Accounts to grant user.info.stats. A missing grant returns 409 TIKTOK_STATS_SCOPE_REQUIRED. Individual video views still use get_post_stats with video.list.
Before publishing
Connect each selected platform in Accounts before publishing or scheduling. Missing connections return 409 PLATFORM_CONNECTION_REQUIRED, with platforms and accountsUrl, before a new post or media upload is stored. Drafts can be saved without a connection. Tokens can still expire or be revoked after this check.
TikTok’s spam_risk_too_many_posts means the account hit its API posting cap for the last 24 hours. Pause API posting and retry the failed post later. Do not create duplicates or reconnect to reset it; TikTok provides no exact reset time. You can try publishing manually in TikTok. QPost does not automatically retry failed posts. TikTok’s error reference
0 MCP Server (for AI Agents)
QPost speaks MCP so any MCP-compatible AI agent (Claude, Cursor, or your own) can list connected accounts and publish posts directly, no custom integration code required. Both options expose the same tools and wrap the same REST API documented below.
Hosted, nothing to install:
claude mcp add --transport http qpost https://qpost.dev/mcp \
--header "x-api-key: YOUR_API_KEY"
Any client that supports Streamable HTTP can point at https://qpost.dev/mcp with an x-api-key header.
Local (stdio), if you prefer to run it yourself:
claude mcp add qpost -e QPOST_API_KEY=your_key_here -- npx -y qpost-mcp
Tools exposed: list_connected_accounts, create_post, list_posts, get_post, get_post_stats, update_post, delete_post, retry_post. Generate an API key below, then see the qpost-mcp README for other MCP clients.
n8n: install the community node n8n-nodes-qpost (Settings Community Nodes Install), add a QPost API credential with your key, and publish from any workflow, using binary data from a previous node or a media URL. Get the step-by-step guide and downloadable workflow.
1 Authentication
All API requests must be authenticated using an API Key. You can pass the key in the request headers.
| Header Name | Value | Description |
|---|---|---|
| x-api-key | YOUR_API_KEY | Preferred method. |
| Authorization | Bearer YOUR_API_KEY | Alternative standard bearer token method. |
2 Create Post
Request Body (FormData)
| Field | Type | Description |
|---|---|---|
| caption | string | RequiredThe main text content of your post. |
| platforms | JSON string | RequiredArray of target platforms. See structure below. |
| video | File | Video file to upload. (Required if no images) |
| images | File[] | One or more image files. (Required if no video) |
| title | string | Optional title (used for YouTube). |
| scheduledFor | ISO Date | Optional. If provided, post will be scheduled. |
| timezone | string | Timezone for scheduling (default: "UTC"). |
Platforms Object Structure
The platforms field expects a
JSON stringified array of objects with the following shape:
[
{
"platform": "YOUTUBE" | "TIKTOK" | "INSTAGRAM",
"metadata": { ... } // Platform specific options
}
]Platform Metadata Details
YouTube Metadata ▼
All fields are optional.
| Field | Type | Description | Default |
|---|---|---|---|
| description | string | Override video description | - |
| tags | string[] | string | Array of strings or comma-separated string | - |
| categoryId | string | YouTube Category ID | "22" |
| embeddable | boolean | Allow video to be embedded on other sites | true |
| privacyStatus | "private" | "unlisted" | "public" | Video privacy setting | "private" |
| publishAt | string | ISO datetime for YouTube's own scheduled publishing | - |
| selfDeclaredMadeForKids | boolean | Mark video as made for kids | false |
TikTok Metadata ▼
All fields are optional.
| Field | Type | Description | Default |
|---|---|---|---|
| privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "SELF_ONLY" | Video privacy level | "SELF_ONLY" |
| allowComment | boolean | Allow comments on the post | - |
| allowDuet | boolean | Allow other users to create duets | - |
| allowStitch | boolean | Allow other users to stitch with this video | - |
| autoAddMusic | boolean | Automatically add background music | true |
| videoCoverTimestampMs | number | Timestamp in milliseconds for video cover image | 1000 |
| commercialContentEnabled | boolean | Mark content as promotional/commercial | false |
| commercialContentSelections | string[] ("YOUR_BRAND" | "BRANDED_CONTENT") | Disclosure label: YOUR_BRAND promotes your own business, BRANDED_CONTENT is a paid partnership (cannot be private) | - |
| isAigc | boolean | Content is AI-generated; TikTok adds its AI-generated label | false |
Instagram Metadata ▼
All fields are optional. instagramBusinessAccountId is usually auto-detected from your linked Instagram account.
| Field | Type | Description | Default |
|---|---|---|---|
| instagramBusinessAccountId | string | Instagram Business Account ID | auto-detected |
| mediaType | "IMAGE" | "CAROUSEL" | "REELS" | "STORIES" | Type of Instagram media | auto-detected |
| mediaProductType | "FEED" | "STORIES" | "REELS" | Where the content will be posted | - |
| disableComments | boolean | Disable comments on the post | - |
| locationId | string | Instagram Location ID to tag a location | - |
| thumbOffset | number | Thumbnail offset for video posts (in milliseconds) | - |
| userTags | object[] | Array of user tags: [{ username: string, x?: number, y?: number }]. Max 20 tags | - |
| altText | string | Custom alt text for accessibility (max 1000 characters) | - |
Example Requests
curl -X POST https://qpost.dev/api/post \
-H "x-api-key: YOUR_API_KEY" \
-F "caption=Check out this amazing content! #video" \
-F 'platforms=[{"platform":"YOUTUBE","metadata":{"categoryId":"22","embeddable":true,"privacyStatus":"public","selfDeclaredMadeForKids":false}},{"platform":"TIKTOK","metadata":{"allowDuet":false,"allowStitch":false,"allowComment":false,"autoAddMusic":true,"privacyLevel":"PUBLIC_TO_EVERYONE","videoCoverTimestampMs":1000,"commercialContentEnabled":false,"commercialContentSelections":[]}}]' \
-F "video=@/path/to/video.mp4" \
-F "title=My Awesome Video"3 Get Posts
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| status | string | Filter by status: "DRAFT", "SCHEDULED", "POSTED", "FAILED". |
| platform | string | Filter by platform: "YOUTUBE", "TIKTOK", "INSTAGRAM". |