APIWings API reference
Every endpoint of the API, generated from the same OpenAPI spec that guards it, so this page always matches what the API does. New to APIWings? Start with the quickstart.
- Base URL:
https://api-staging.apiwings.com(the production URL will behttps://api.apiwings.com). - Authentication: every request carries
Authorization: Bearer <your API key>. Create keys in the dashboard under API keys:aw_test_keys validate everything and never post;aw_live_keys publish. Keys belong on your server, never in a browser or mobile app. - Errors: always JSON,
{code, error, platform_message?, request_id, doc_url}, with theX-Request-Idheader. The codes and what to do about each are in the docs overview. - Rate limits: every response to an API key carries
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset;429means wait until the reset. - Idempotency:
POST /v1/postsrequires anidempotency_key; sending the same key again returns the same post instead of publishing twice. - Machine-readable: the strict OpenAPI 3.1 spec is at /v1/openapi.json; the TypeScript SDK and the MCP server are generated from it.
Profiles
Create a profile (one end customer of your SaaS)
POST /v1/profiles
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
external_id |
string | ||
name |
string |
Response 201
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | |
external_id |
string or null | yes | |
name |
string or null | yes | |
created_at |
date-time | yes |
Status codes: 201 Created · 401 · 403 · 422
List profiles, newest first
GET /v1/profiles
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit |
query | integer (1 to 200) | Page size (default 50, max 200) | |
before |
query | date-time | Cursor: next_before from the previous page |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
data |
array of object | yes | |
data[].id |
uuid | yes | |
data[].external_id |
string or null | yes | |
data[].name |
string or null | yes | |
data[].created_at |
date-time | yes | |
next_before |
date-time or null | yes |
Status codes: 200 OK · 401 · 422
Get profile
GET /v1/profiles/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | |
external_id |
string or null | yes | |
name |
string or null | yes | |
created_at |
date-time | yes |
Status codes: 200 OK · 401 · 404
Delete a profile; its accounts and data are erased within 24 h
DELETE /v1/profiles/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Status codes: 204 Deleted · 401 · 404
Connect
Start connecting a social account to a profile
POST /v1/profiles/{id}/connect/{platform}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes | |
platform |
path | bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes |
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
redirect_url |
URL | Where the end user returns after connecting. Receives ?status=connected&account_id=…&account_ids=…&platform=… (account_ids lists every account the consent granted, e.g. several Facebook Pages; account_id is the first) or ?status=error&code=… | |
bluesky |
object | Connect Bluesky directly with an app password instead of the hosted page | |
bluesky.identifier |
string | yes | |
bluesky.app_password |
string | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
connect_url |
URL or null | yes | Hosted page to send the end user to; null when the account was connected directly |
account_id |
uuid or null | yes | |
expires_at |
date-time or null | yes |
Status codes: 200 Hosted connect URL, or the connected account · 401 · 402 · 404 · 422 · 429
List accounts
GET /v1/profiles/{id}/accounts
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
data |
array of object | yes | |
data[].id |
uuid | yes | |
data[].profile_id |
uuid | yes | |
data[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
data[].display_name |
string or null | yes | |
data[].avatar_url |
string or null | Public profile picture from the platform, when it provides one | |
data[].owner_name |
string or null | Organization that owns the account, when the platform reports it (e.g. the Meta business portfolio of a Facebook Page) | |
data[].status |
string | yes | active | expired | disconnected (open enum) |
data[].needs_reconnect |
boolean | true when the account can't publish until the end user connects it again (expired, revoked or disconnected). Reconnect with POST /v1/profiles/{id}/connect/{platform}: the account keeps its id | |
data[].reconnect_by |
date-time or null | Set (from up to 7 days before, together with the account.expiring webhook) when the connection can't renew itself and will stop working at this time (for example LinkedIn, every 60 days): ask the end user to connect it again before then. Null when APIWings renews it automatically or it doesn't expire | |
data[].created_at |
date-time | yes |
Status codes: 200 OK · 401 · 404
Disconnect an account: its tokens are destroyed and account.disconnected is sent
DELETE /v1/accounts/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Status codes: 204 Disconnected · 401 · 404
Live data your posting screen must show before publishing to this account (TikTok)
GET /v1/accounts/{id}/publish-options
Call it each time the posting screen opens. TikTok requires showing the creator's nickname, letting the user choose a privacy level from privacy_level_options (no default), leaving comments/duet/stitch off until the user turns them on, and a commercial content disclosure. Other platforms return required=false.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
account_id |
uuid | yes | |
platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
required |
boolean | yes | true when the platform requires your posting screen to show this data before publishing (TikTok) |
data |
object or null | yes | Live data from the platform for the posting screen, or null. TikTok: creator_nickname, creator_username, creator_avatar_url, privacy_level_options (offer exactly these, with no default), comment_disabled / duet_disabled / stitch_disabled (grey out those toggles), max_video_post_duration_sec, audited (false: posts stay private until TikTok audits APIWings) |
Status codes: 200 Publish options · 401 · 404 · 422 · 429 · 502
How many posts this account can still publish, live from the platform when it says
GET /v1/accounts/{id}/limits
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
account_id |
uuid | yes | |
platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
limit |
integer or null | yes | Posts allowed in the platform's window, when the platform exposes it (Instagram 100/24 h, Threads 250/24 h) |
remaining |
integer or null | yes | Posts left in that window, live from the platform; null when it doesn't say |
resets_at |
date-time or null | yes | |
notes |
string or null | yes | How the platform limits this account when it has no live counter (rate limits, daily caps, per-post cost) |
Status codes: 200 Limits · 401 · 404 · 422 · 429 · 502
Media
Get a presigned URL, then PUT the file to it (Content-Type must match)
POST /v1/media
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
mime |
image/jpeg, image/png, image/webp, image/gif, video/mp4, video/quicktime |
yes | |
bytes |
integer | yes |
Response 201
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | |
upload_url |
URL | yes | |
upload_method |
PUT |
yes | |
expires_in |
integer | yes | |
expires_at |
date-time | yes |
Status codes: 201 Upload URL (valid 15 min); media expires after 7 days · 401 · 422
Get media
GET /v1/media/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | |
kind |
image, video |
yes | |
mime |
string | yes | |
status |
string | yes | pending (not uploaded yet) | ready (open enum) |
expires_at |
date-time | yes |
Status codes: 200 OK · 401 · 404
Posts
Publish now or schedule one post on several networks
POST /v1/posts
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
profile_id |
uuid | yes | |
content |
string | yes | |
media |
array of uuid | Media ids from POST /v1/media, in display order | |
media_urls |
array of URL | Public https URLs of images or videos (JPEG, PNG, WebP, GIF, MP4, MOV; up to 1 GB). APIWings downloads them before publishing; they go after media, in this order. Up to 10 media in total. |
|
platforms |
array of object | yes | |
platforms[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
platforms[].account_id |
uuid | Optional when the profile has a single active account of this network | |
platforms[].options |
object | Network-specific options, validated by that network's connector (e.g. bluesky: {alt}) | |
scheduled_at |
date-time | ISO 8601; omitted or past = publish now | |
idempotency_key |
string | yes | Required. Same key → same post, never published twice |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | |
profile_id |
uuid | yes | |
status |
string | yes | scheduled | queued | done | canceled (open enum) |
scheduled_at |
date-time or null | yes | |
created_at |
date-time | yes | |
platforms |
array of object | yes | |
platforms[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
platforms[].account_id |
uuid | yes | |
platforms[].status |
string | yes | pending | publishing | published | failed | canceled (open enum) |
platforms[].remote_id |
string or null | yes | |
platforms[].url |
string or null | yes | |
platforms[].visibility |
string or null | yes | Real visibility returned by the platform: public | private | unlisted | self_only | draft (open enum). Never assumed. test when the post was created with an aw_test_ key: publishing was simulated and nothing was posted. |
platforms[].error |
object or null | yes | |
platforms[].published_at |
date-time or null | yes | |
platforms[].platform_cost_usd |
number or null | What the platform charged for this post, in USD, passed on at cost (X pay-per-use). null for networks without a per-post fee. | |
test |
boolean | true when the post was created with an aw_test_ key: it was validated like a live post, but publishing is simulated (remote_id test_…, visibility test, no cost) and nothing reaches any network |
Status codes: 200 Idempotent replay: the post created earlier with this idempotency_key · 202 Accepted; one job per network · 401 · 402 · 404 · 422 · 429
List posts, newest first, with each network's result
GET /v1/posts
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit |
query | integer (1 to 200) | Page size (default 50, max 200) | |
before |
query | date-time | Cursor: next_before from the previous page | |
profile_id |
query | uuid | Only this profile's posts |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
data |
array of object | yes | |
data[].id |
uuid | yes | |
data[].profile_id |
uuid | yes | |
data[].status |
string | yes | scheduled | queued | done | canceled (open enum) |
data[].scheduled_at |
date-time or null | yes | |
data[].created_at |
date-time | yes | |
data[].platforms |
array of object | yes | |
data[].test |
boolean | true when the post was created with an aw_test_ key: it was validated like a live post, but publishing is simulated (remote_id test_…, visibility test, no cost) and nothing reaches any network | |
next_before |
date-time or null | yes |
Status codes: 200 OK · 401 · 422
Check a post without publishing or creating anything
POST /v1/posts/validate
Runs every check of POST /v1/posts (profile, plan, accounts, media, each network's rules for text, media and options, and the spending cap of paid networks) and creates nothing. Problems with the request itself (unknown profile, missing account, invalid media) come back as the usual error, like POST /v1/posts. Otherwise the answer is 200 with valid and one entry per network: a network that would refuse the post has valid false and its error. Checks that need the network itself (image dimensions, account permissions) only happen when publishing. idempotency_key is optional.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
profile_id |
uuid | yes | |
content |
string | yes | |
media |
array of uuid | Media ids from POST /v1/media, in display order | |
media_urls |
array of URL | Public https URLs of images or videos (JPEG, PNG, WebP, GIF, MP4, MOV; up to 1 GB). APIWings downloads them before publishing; they go after media, in this order. Up to 10 media in total. |
|
platforms |
array of object | yes | |
platforms[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
platforms[].account_id |
uuid | Optional when the profile has a single active account of this network | |
platforms[].options |
object | Network-specific options, validated by that network's connector (e.g. bluesky: {alt}) | |
scheduled_at |
date-time | ISO 8601; omitted or past = publish now | |
idempotency_key |
string | Optional here: nothing is created |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
valid |
boolean | yes | true when every network accepted the post: POST /v1/posts with the same body would be accepted |
platforms |
array of object | yes | |
platforms[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
platforms[].account_id |
uuid | yes | The account the post would go to (resolved when account_id was omitted) |
platforms[].valid |
boolean | yes | |
platforms[].error |
object or null | yes | Why this network would refuse the post (same codes as the API errors); null when valid |
Status codes: 200 Checked; see valid and each network's result · 401 · 402 · 404 · 422 · 429
Get post
GET /v1/posts/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | |
profile_id |
uuid | yes | |
status |
string | yes | scheduled | queued | done | canceled (open enum) |
scheduled_at |
date-time or null | yes | |
created_at |
date-time | yes | |
platforms |
array of object | yes | |
platforms[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
platforms[].account_id |
uuid | yes | |
platforms[].status |
string | yes | pending | publishing | published | failed | canceled (open enum) |
platforms[].remote_id |
string or null | yes | |
platforms[].url |
string or null | yes | |
platforms[].visibility |
string or null | yes | Real visibility returned by the platform: public | private | unlisted | self_only | draft (open enum). Never assumed. test when the post was created with an aw_test_ key: publishing was simulated and nothing was posted. |
platforms[].error |
object or null | yes | |
platforms[].published_at |
date-time or null | yes | |
platforms[].platform_cost_usd |
number or null | What the platform charged for this post, in USD, passed on at cost (X pay-per-use). null for networks without a per-post fee. | |
test |
boolean | true when the post was created with an aw_test_ key: it was validated like a live post, but publishing is simulated (remote_id test_…, visibility test, no cost) and nothing reaches any network |
Status codes: 200 OK · 401 · 404
Cancel a scheduled post that has not started publishing
DELETE /v1/posts/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Status codes: 204 Canceled · 401 · 404 · 409
Webhooks
Subscribe to events. Deliveries are signed: X-APIWings-Signature: t=<ms>,v1=HMAC_SHA256(secret, ${t}.${body}). Each body carries an id (also in X-APIWings-Event-Id) that stays the same across retries; failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h.
POST /v1/webhooks
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
url |
URL | yes | Public https URL |
events |
array of post.published, post.failed, account.disconnected, account.expiring |
yes |
Status codes: 201 Created; the secret is shown only once · 401 · 403 · 422
List webhooks
GET /v1/webhooks
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
data |
array of object | yes | |
data[].id |
uuid | yes | |
data[].url |
URL | yes | |
data[].events |
array of string | yes | |
data[].created_at |
date-time | yes |
Status codes: 200 OK · 401 · 403
Delete webhook
DELETE /v1/webhooks/{id}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Status codes: 204 Deleted · 401 · 403 · 404
Deliveries of the last 30 days, newest first, with the body sent and the outcome of the last attempt
GET /v1/webhooks/{id}/deliveries
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes | |
limit |
query | integer (1 to 100) | Page size (default 50, max 100) | |
before |
query | date-time | Cursor: next_before from the previous page |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
data |
array of object | yes | |
data[].id |
uuid | yes | Delivery id: the id of the body and the X-APIWings-Event-Id header, the same on every retry and redelivery. Dedupe on it. |
data[].webhook_id |
uuid | yes | |
data[].event |
string | yes | post.published, post.failed, account.disconnected, account.expiring or webhook.test (open list: new events may be added) |
data[].status |
string | yes | pending (an attempt is due or running), delivered (your endpoint answered 2xx) or failed (no attempts left, or a 4xx other than 408/429). Open list. |
data[].attempts |
integer | yes | |
data[].next_attempt_at |
date-time or null | yes | When the next automatic attempt is due (pending only) |
data[].last_status_code |
integer or null | yes | HTTP status your endpoint answered in the last attempt; null if it could not be reached |
data[].last_error |
string or null | yes | |
data[].created_at |
date-time | yes | |
data[].delivered_at |
date-time or null | yes | |
data[].payload |
object | yes | The exact JSON body sent: {id, event, created_at, data} |
next_before |
date-time or null | yes |
Status codes: 200 OK · 401 · 403 · 404 · 422
Sends a webhook.test event ({webhook_id}) to this webhook, whatever events it subscribes to. Delivered and retried like any other event.
POST /v1/webhooks/{id}/test
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes |
Response 202
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | Delivery id: the id of the body and the X-APIWings-Event-Id header, the same on every retry and redelivery. Dedupe on it. |
webhook_id |
uuid | yes | |
event |
string | yes | post.published, post.failed, account.disconnected, account.expiring or webhook.test (open list: new events may be added) |
status |
string | yes | pending (an attempt is due or running), delivered (your endpoint answered 2xx) or failed (no attempts left, or a 4xx other than 408/429). Open list. |
attempts |
integer | yes | |
next_attempt_at |
date-time or null | yes | When the next automatic attempt is due (pending only) |
last_status_code |
integer or null | yes | HTTP status your endpoint answered in the last attempt; null if it could not be reached |
last_error |
string or null | yes | |
created_at |
date-time | yes | |
delivered_at |
date-time or null | yes | |
payload |
object | yes | The exact JSON body sent: {id, event, created_at, data} |
Status codes: 202 Queued; follow it in the deliveries list · 401 · 403 · 404
Sends a delivery of the last 30 days again now, with the same body and id. If it fails and automatic attempts remain, they continue.
POST /v1/webhooks/{id}/deliveries/{delivery_id}/redeliver
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | yes | |
delivery_id |
path | uuid | yes |
Response 202
| Field | Type | Always | Description |
|---|---|---|---|
id |
uuid | yes | Delivery id: the id of the body and the X-APIWings-Event-Id header, the same on every retry and redelivery. Dedupe on it. |
webhook_id |
uuid | yes | |
event |
string | yes | post.published, post.failed, account.disconnected, account.expiring or webhook.test (open list: new events may be added) |
status |
string | yes | pending (an attempt is due or running), delivered (your endpoint answered 2xx) or failed (no attempts left, or a 4xx other than 408/429). Open list. |
attempts |
integer | yes | |
next_attempt_at |
date-time or null | yes | When the next automatic attempt is due (pending only) |
last_status_code |
integer or null | yes | HTTP status your endpoint answered in the last attempt; null if it could not be reached |
last_error |
string or null | yes | |
created_at |
date-time | yes | |
delivered_at |
date-time or null | yes | |
payload |
object | yes | The exact JSON body sent: {id, event, created_at, data} |
Status codes: 202 Queued · 401 · 403 · 404
Usage
Usage in a calendar month: publications per network, video posts, paid-network cost and connected accounts
GET /v1/usage
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
month |
query | string | Calendar month (UTC), YYYY-MM; default the current one. History is kept for 13 months. | |
profile_id |
query | uuid | Only this profile's usage (e.g. to bill one of your own customers). Keys restricted to a profile always get that profile's usage. |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
month |
string | yes | Calendar month (UTC), YYYY-MM |
period_start |
date-time | yes | Start of the month, UTC (inclusive) |
period_end |
date-time | yes | Start of the next month, UTC (exclusive) |
posts |
object | yes | Publications: one post on one network counts as one (a post sent to 3 networks = 3). Published ones count in the month they went out; failed ones in the month they failed. Pending, scheduled and canceled ones don't count, nor test-mode posts (aw_test_ keys). |
posts.total |
integer | yes | published + failed |
posts.published |
integer | yes | |
posts.failed |
integer | yes | |
by_platform |
array of object | yes | Networks with at least one publication in the month, alphabetically |
by_platform[].platform |
bluesky, linkedin, instagram, facebook, threads, tiktok, youtube, x |
yes | |
by_platform[].published |
integer | yes | Publications that went out on this network in the month |
by_platform[].failed |
integer | yes | Publications that failed for good in the month (after retries) |
by_platform[].video_posts |
integer | yes | Of the published ones, how many carried at least one video |
by_platform[].platform_cost_usd |
number | yes | What this network charged for the published ones, in USD, passed on at cost (X pay-per-use); 0 for free networks |
connected_accounts |
object | yes | Active connected accounts right now (not at the end of that month): expired and disconnected ones don't count |
connected_accounts.total |
integer | yes | |
connected_accounts.by_platform |
array of object | yes | |
platform_cost_usd_total |
number | yes | Sum of platform_cost_usd over all networks in the month |
spend_cap_usd |
number | yes | Your monthly cap on what paid networks (X) may cost; 0 = paid networks not included in your plan |
Status codes: 200 OK · 401 · 404 · 422
Branding
White label of the hosted connect pages (all null = APIWings branding)
GET /v1/branding
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
name |
string or null | yes | Shown instead of APIWings on the hosted connect pages |
logo_url |
URL or null | yes | Public https image shown above the title |
color |
string or null | yes | Accent color, #RRGGBB (buttons, focus ring) |
Status codes: 200 Current branding · 401 · 403
Set the white label of the hosted connect pages; fields you omit are kept, null clears one
POST /v1/branding
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string or null | Shown instead of APIWings on the hosted connect pages | |
logo_url |
URL or null | Public https image shown above the title | |
color |
string or null | Accent color, #RRGGBB (buttons, focus ring) |
Response 200
| Field | Type | Always | Description |
|---|---|---|---|
name |
string or null | yes | Shown instead of APIWings on the hosted connect pages |
logo_url |
URL or null | yes | Public https image shown above the title |
color |
string or null | yes | Accent color, #RRGGBB (buttons, focus ring) |
Status codes: 200 Branding after the change · 401 · 403 · 422
