Create an API key
Open Dashboard → AI & API and create a key. Copy it once. It starts with pw_live_. Send it on every request:
Header
Authorization: Bearer pw_live_…
Every URL below starts at https://postwing.io/api/v2.
the whole flow
You call PostWing. PostWing publishes to Facebook at the time you set. The post also shows up on your calendar.
Open Dashboard → AI & API and create a key. Copy it once. It starts with pw_live_. Send it on every request:
Header
Authorization: Bearer pw_live_…
Every URL below starts at https://postwing.io/api/v2.
Connect the Facebook account you want to post from. You only do this once.
The simple way is in the dashboard. Open Accounts, choose Facebook, and finish the Facebook login.
From the API, start that same login. The response includes a url. Open it and approve Facebook.
Start connect
curl -s -X POST "https://postwing.io/api/v2/accounts/connect" \
-H "Authorization: Bearer pw_live_…" \
-H "Content-Type: application/json" \
-d '{ "platform": "facebook" }'After you finish in the browser, sync. This imports the account into your workspace and returns the account id.
Sync
curl -s -X POST "https://postwing.io/api/v2/accounts/sync" \ -H "Authorization: Bearer pw_live_…"
In the response, find the object where platform is facebook and copy id. That is the id you send when you create the post.
Sync response
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"platform": "facebook",
"handle": "brand-page",
"display_name": "Brand",
"status": "connected"
}
]
}Connected Facebook in the dashboard instead? The sync response is not in front of you, so list accounts and copy the same field:
List accounts
curl -s -X GET "https://postwing.io/api/v2/accounts" \ -H "Authorization: Bearer pw_live_…"
Send the caption, a future time, and the Facebook account id you copied after sync. This call schedules the post. Facebook publishes it at scheduled_at. scheduled_at is UTC. An image URL has to be public HTTPS.
Create a feed post
curl -s -X POST "https://postwing.io/api/v2/posts" \
-H "Authorization: Bearer pw_live_…" \
-H "Content-Type: application/json" \
-d '{
"caption": "New hours this week. We are open until 7.",
"scheduled_at": "2026-10-12T15:00:00Z",
"accounts": [
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
],
"media": [
{ "url": "https://cdn.example.com/storefront.jpg", "type": "image" }
]
}'You get back three things that matter:
Response
{
"id": "7c1d2a8e-4b0f-4f8e-9a51-2f7f6b1c9d10",
"status": "scheduled",
"caption": "New hours this week. We are open until 7.",
"scheduled_at": "2026-10-12T15:00:00.000Z",
"accounts": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"platform": "facebook",
"handle": "brand-page",
"status": "scheduled",
"url": null,
"error": null
}
],
"dashboard_url": "https://postwing.io/dashboard/post/7c1d2a8e-4b0f-4f8e-9a51-2f7f6b1c9d10"
}The same post can go to Instagram and TikTok. Connect each channel the way you connected Facebook, then copy its id from the sync response.
Connect Instagram
curl -s -X POST "https://postwing.io/api/v2/accounts/connect" \
-H "Authorization: Bearer pw_live_…" \
-H "Content-Type: application/json" \
-d '{ "platform": "instagram" }'Connect TikTok
curl -s -X POST "https://postwing.io/api/v2/accounts/connect" \
-H "Authorization: Bearer pw_live_…" \
-H "Content-Type: application/json" \
-d '{ "platform": "tiktok" }'Open each url, finish the login, then sync once. Copy id where platform is instagram, and where platform is tiktok.
Add those ids to accounts on the create call. One request. Every account publishes at the same scheduled_at. Leave caption off an account to use the shared caption. Set caption when that channel needs different text.
Create one post for three channels
curl -s -X POST "https://postwing.io/api/v2/posts" \
-H "Authorization: Bearer pw_live_…" \
-H "Content-Type: application/json" \
-d '{
"caption": "New hours this week. We are open until 7.",
"scheduled_at": "2026-10-12T15:00:00Z",
"accounts": [
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" },
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"caption": "Open until 7 this week."
},
{ "id": "c3d4e5f6-a7b8-9012-cdef-123456789012" }
],
"media": [
{ "url": "https://cdn.example.com/storefront.jpg", "type": "image" }
]
}'Instagram and TikTok need an image or a video. A text-only post stays on Facebook.
video
A video defaults to a Reel. Use the same Facebook account id from sync, and set format to reel.
Create a Reel
curl -s -X POST "https://postwing.io/api/v2/posts" \
-H "Authorization: Bearer pw_live_…" \
-H "Content-Type: application/json" \
-d '{
"caption": "A 15-second look at the new menu",
"scheduled_at": "2026-10-12T18:00:00Z",
"accounts": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"options": { "format": "reel" }
}
],
"media": [
{ "url": "https://cdn.example.com/reel.mp4", "type": "video" }
]
}'To put that video on the feed instead, set format to post. Images and text already go to the feed, so you can leave format off for those.
Videos imported from a URL need to be 100MB or smaller. A file on your computer uses the direct upload URL, covered in the API docs.
questions
Yes. Create the post with caption, scheduled_at, and the Facebook account id. Leave out media.