Download OpenAPI specification:
UniPostAPI is a unified REST API for publishing content to multiple social media platforms.
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer sk_live_your_api_key
API keys use a prefixed format:
sk_live_* — Production keys that publish to real platform APIssk_test_* — Test keys that validate content but return mock publish resultsThe key prefix determines the mode. Test and live data are fully isolated — posts created with a test key are only visible to test keys, and vice versa. Test-mode publishing runs content validation but skips real API calls, returning mock platform post IDs and URLs.
Rate limits depend on your plan tier. Every response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit |
Maximum requests per minute |
X-RateLimit-Remaining |
Requests remaining in the current window |
X-RateLimit-Reset |
Unix timestamp when the window resets |
Content publishing is asynchronous. When you create a post, it returns immediately
with a pending status. Track progress by polling the post endpoint or registering
a webhook for real-time notifications.
All errors follow a consistent format:
{
"error": "ERROR_CODE",
"message": "Human-readable description",
"statusCode": 400
}
Create a new post targeting one or more connected accounts. The post is processed
asynchronously — the response returns immediately with a pending status.
Use the idempotencyKey field to safely retry requests without creating duplicate posts.
| accountIds required | Array of strings non-empty IDs of connected accounts to publish to |
required | object |
| scheduledAt | string <date-time> Schedule publishing for a future time (ISO 8601) |
object | |
object Platform-specific content overrides | |
| idempotencyKey | string <uuid> Unique key to prevent duplicate submissions on retry |
{- "accountIds": [
- "acc_tiktok_abc123",
- "acc_instagram_def456"
], - "content": {
- "caption": "Check this out!",
- "hashtags": [
- "viral",
- "trending"
]
}, - "disclosure": {
- "aiGenerated": true
}
}{- "data": {
- "id": "post_abc123",
- "status": "pending",
- "content": {
- "videoUrl": "string",
- "caption": "string",
- "hashtags": [
- "string"
]
}, - "targets": [
- {
- "accountId": "acc_tiktok_abc123",
- "platform": "tiktok",
- "status": "queued",
- "platformPostId": "string",
- "publishedAt": "2019-08-24T14:15:22Z",
- "lastError": "string"
}
], - "scheduledAt": "2019-08-24T14:15:22Z",
- "hasFailures": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}List posts with optional filtering by status, platform, or account. Uses cursor-based pagination.
| status | string (PostStatus) Enum: "pending" "scheduled" "publishing" "published" "failed" "cancelled" Post lifecycle status:
|
| platform | string (Platform) Enum: "tiktok" "instagram" "youtube" Social media platform identifier |
| accountId | string Filter by target account ID |
| cursor | string Pagination cursor from a previous response |
| limit | integer [ 1 .. 100 ] Default: 20 |
{- "data": [
- {
- "id": "post_abc123",
- "status": "pending",
- "content": {
- "videoUrl": "string",
- "caption": "string",
- "hashtags": [
- "string"
]
}, - "targets": [
- {
- "accountId": "acc_tiktok_abc123",
- "platform": "tiktok",
- "status": "queued",
- "platformPostId": "string",
- "publishedAt": "2019-08-24T14:15:22Z",
- "lastError": "string"
}
], - "scheduledAt": "2019-08-24T14:15:22Z",
- "hasFailures": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "cursor": "string",
- "hasMore": true
}
}Retrieve the current status and details of a post, including per-target status.
| postId required | string Example: post_abc123 |
{- "data": {
- "id": "post_abc123",
- "status": "pending",
- "content": {
- "videoUrl": "string",
- "caption": "string",
- "hashtags": [
- "string"
]
}, - "targets": [
- {
- "accountId": "acc_tiktok_abc123",
- "platform": "tiktok",
- "status": "queued",
- "platformPostId": "string",
- "publishedAt": "2019-08-24T14:15:22Z",
- "lastError": "string"
}
], - "scheduledAt": "2019-08-24T14:15:22Z",
- "hasFailures": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}Cancel a scheduled or pending post before it is published. Posts that have already been published or are currently publishing cannot be cancelled.
| postId required | string |
{- "data": {
- "id": "post_abc123",
- "status": "pending",
- "content": {
- "videoUrl": "string",
- "caption": "string",
- "hashtags": [
- "string"
]
}, - "targets": [
- {
- "accountId": "acc_tiktok_abc123",
- "platform": "tiktok",
- "status": "queued",
- "platformPostId": "string",
- "publishedAt": "2019-08-24T14:15:22Z",
- "lastError": "string"
}
], - "scheduledAt": "2019-08-24T14:15:22Z",
- "hasFailures": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}List all social media accounts connected to your organization.
| platform | string (Platform) Enum: "tiktok" "instagram" "youtube" Social media platform identifier |
| status | string (AccountStatus) Enum: "active" "token_expiring" "token_expired" "rate_limited" "suspended" "error" Current health status of a connected account |
| cursor | string |
| limit | integer [ 1 .. 100 ] Default: 20 |
{- "data": [
- {
- "id": "acc_tiktok_abc123",
- "platform": "tiktok",
- "status": "active",
- "displayName": "@creator_name",
- "username": "string",
- "followerCount": 0,
- "isBusinessAccount": true,
- "tokenExpiresAt": "2019-08-24T14:15:22Z",
- "connectedAt": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "cursor": "string",
- "hasMore": true
}
}Retrieve details of a connected social media account, including token status and profile information.
| accountId required | string Example: acc_tiktok_abc123 |
{- "data": {
- "id": "acc_tiktok_abc123",
- "platform": "tiktok",
- "status": "active",
- "displayName": "@creator_name",
- "username": "string",
- "followerCount": 0,
- "isBusinessAccount": true,
- "tokenExpiresAt": "2019-08-24T14:15:22Z",
- "connectedAt": "2019-08-24T14:15:22Z"
}
}Disconnect a social media account. This revokes stored OAuth tokens and removes the account from your organization. Pending posts targeting this account will be cancelled.
| accountId required | string |
{- "data": {
- "id": "string",
- "disconnected": true
}
}Generate an authorization URL for a social media platform. Redirect the user
to this URL to start the OAuth consent flow. The user will be redirected back
to your redirectUri after granting (or denying) access.
| platform required | string (Platform) Enum: "tiktok" "instagram" "youtube" Social media platform identifier |
| redirectUri required | string <uri> URL to redirect the user to after authorization |
| scopes | Array of strings Optional additional scopes to request |
{- "scopes": [
- "string"
]
}{
}OAuth redirect target. After the user authorizes on the social media platform,
they are redirected here with an authorization code. UniPostAPI exchanges it for
tokens and redirects back to your redirectUri with the new account ID.
Note: This endpoint is called by the browser during the OAuth redirect flow, not directly by your API client.
| platform required | string (Platform) Enum: "tiktok" "instagram" "youtube" Social media platform identifier |
| code required | string Authorization code from the platform |
| state required | string CSRF state parameter for verification |
{- "error": "validation_failed",
- "message": "accountIds must contain at least 1 item",
- "statusCode": 400
}Register a URL to receive event notifications. You can filter which events, platforms, and accounts trigger the webhook.
The response includes a signingSecret which you should store securely.
Use it to verify webhook signatures via the X-UniPostAPI-Signature header.
| url required | string <uri> HTTPS URL to receive webhook payloads |
| events required | Array of strings (WebhookEvent) non-empty Items Enum: "post.pending" "post.processing" "post.scheduled" "post.publishing" "post.published" "post.failed" "post.cancelled" "account.connected" "account.token_expiring" "account.token_expired" "account.error" Event types to subscribe to |
| filterPlatforms | Array of strings (Platform) Items Enum: "tiktok" "instagram" "youtube" Only trigger for events from these platforms |
| filterAccountIds | Array of strings Only trigger for events from these accounts |
{- "events": [
- "post.pending"
], - "filterPlatforms": [
- "tiktok"
], - "filterAccountIds": [
- "string"
]
}{- "data": {
- "id": "wh_abc123",
- "events": [
- "post.pending"
], - "filterPlatforms": [
- "tiktok"
], - "filterAccountIds": [
- "string"
], - "isActive": true,
- "lastTriggeredAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "consecutiveFailures": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "signingSecret": "string"
}
}List all registered webhook endpoints for your organization.
{- "data": [
- {
- "id": "wh_abc123",
- "events": [
- "post.pending"
], - "filterPlatforms": [
- "tiktok"
], - "filterAccountIds": [
- "string"
], - "isActive": true,
- "lastTriggeredAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "consecutiveFailures": 0,
- "createdAt": "2019-08-24T14:15:22Z"
}
]
}{- "data": {
- "id": "wh_abc123",
- "events": [
- "post.pending"
], - "filterPlatforms": [
- "tiktok"
], - "filterAccountIds": [
- "string"
], - "isActive": true,
- "lastTriggeredAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "consecutiveFailures": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "signingSecret": "string"
}
}Update the URL, events, or filters for an existing webhook.
| webhookId required | string |
| url | string <uri> |
| events | Array of strings (WebhookEvent) Items Enum: "post.pending" "post.processing" "post.scheduled" "post.publishing" "post.published" "post.failed" "post.cancelled" "account.connected" "account.token_expiring" "account.token_expired" "account.error" |
| filterPlatforms | Array of strings (Platform) Items Enum: "tiktok" "instagram" "youtube" |
| filterAccountIds | Array of strings |
| isActive | boolean |
{- "events": [
- "post.pending"
], - "filterPlatforms": [
- "tiktok"
], - "filterAccountIds": [
- "string"
], - "isActive": true
}{- "data": {
- "id": "wh_abc123",
- "events": [
- "post.pending"
], - "filterPlatforms": [
- "tiktok"
], - "filterAccountIds": [
- "string"
], - "isActive": true,
- "lastTriggeredAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "consecutiveFailures": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "signingSecret": "string"
}
}Returns the current billing period's usage counts and plan limits for your organization. Includes post and account counts relative to plan limits, and which features are enabled.
{- "period": "2026-02",
- "plan": "starter",
- "usage": {
- "posts": {
- "used": 42,
- "limit": null
}, - "accounts": {
- "used": 3,
- "limit": 5
}
}, - "features": {
- "scheduling": true,
- "webhooks": true
}
}Returns the video, content, and capability requirements for a specific platform. Use this to validate content before creating a post. Does not require authentication.
| platform required | string (Platform) Enum: "tiktok" "instagram" "youtube" Social media platform to get requirements for |
{- "platform": "tiktok",
- "video": {
- "formats": [
- "mp4",
- "mov",
- "webm"
], - "codecs": [
- "h264",
- "h265"
], - "maxSizeBytes": 4294967296,
- "maxDurationSeconds": 3600,
- "minDurationSeconds": 1,
- "aspectRatios": [
- "9:16",
- "1:1",
- "16:9"
], - "maxResolution": "4096x4096"
}, - "content": {
- "maxDescriptionLength": 2200,
- "maxTags": 20,
- "maxTitleLength": null
}, - "capabilities": {
- "supportsVideo": true,
- "supportsImage": false,
- "supportsCarousel": false,
- "requiresVideo": true
}
}