Create a publication
const url = 'https://api.warmup.social/projects/00000000-0000-0000-0000-000000000000/publications';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"photo","platforms":["instagram"],"text":"New work","mediaId":"00000000-0000-0000-0000-000000000000"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.warmup.social/projects/00000000-0000-0000-0000-000000000000/publications \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "photo", "platforms": [ "instagram" ], "text": "New work", "mediaId": "00000000-0000-0000-0000-000000000000" }'The publication is queued (202) and sent to the selected networks
asynchronously. The result for each network is in targets[].status —
poll “Get a publication” to see it.
What each network supports:
| Network | text | photo | story | Text limit |
|---|---|---|---|---|
| yes | yes | yes | 63,206 | |
| no | yes | yes | 2,200 | |
| threads | yes | yes | no | 500 |
Body rules:
kind: text—textis required,mediaIdis not allowed;photo/story—mediaIdfrom “Upload an image” is required;- 1–3 networks, no duplicates;
- for an Instagram
photothe aspect ratio must be between 4:5 and 1.91:1.
Scheduling:
state: scheduled(default) withoutscheduledAt— goes out right away;state: scheduledwith a futurescheduledAt— goes out at that moment (within about half a minute); a pastscheduledAtis rejected withscheduled_at_past;state: draft— stays in the planner and is never sent until you change it toscheduledor call “Publish now”. Drafts do not require connected networks.timezoneis the IANA zone the time was entered in; it is stored for display only.
Counts towards the publishing rate limit, like image upload.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
00000000-0000-0000-0000-000000000000Project UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Required for kind: text. Leading and trailing spaces are trimmed.
Required for photo and story, not allowed for text.
draft stays in the planner; scheduled goes out at scheduledAt or right away without it.
When to publish, ISO 8601 with offset. Omit to publish right away (scheduled) or to leave a draft without a date.
IANA time zone the time was entered in, e.g. Europe/Kyiv. Stored for display.
Example
{ "kind": "photo", "platforms": [ "instagram" ], "text": "New work", "mediaId": "00000000-0000-0000-0000-000000000000"}Responses
Section titled “Responses”Publication queued.
object
draft and scheduled — not sent yet. After sending: publishing while any network is still in progress, published when every network succeeded, otherwise failed (see targets[] for the per-network outcome).
object
When the publication goes (or went) out. null only for a draft without a date.
Per-network outcome. Empty until the publication is sent.
object
Why the target failed. published_unconfirmed — Meta published the post but did not return its id; the post most likely went out.
Example
{ "kind": "text", "state": "draft", "platforms": [ "facebook" ], "media": { "width": 1080, "height": 1350 }, "timezone": "Europe/Kyiv", "targets": [ { "platform": "facebook", "status": "queued", "errorCode": "connection_missing" } ]}Validation failed (text_required, media_required, media_not_allowed, duplicate_platform, <platform>_<kind>_unsupported, <platform>_text_too_long, invalid_timezone), the image was not found (media_not_found), its aspect ratio does not fit the Instagram feed (media_aspect_ratio) or scheduledAt is in the past (scheduled_at_past).
Error with a machine-readable code. Body validation errors come as formErrors / fieldErrors; business errors carry a code.
object
object
Example
{ "code": "connection_missing", "platform": "facebook", "fieldErrors": { "mediaId": [ "media_required" ] }}The Bearer token is missing or invalid.
object
object
Example
{ "statusCode": 400, "message": "Invalid request", "error": "Bad Request"}The requested resource was not found.
object
object
Example
{ "statusCode": 400, "message": "Invalid request", "error": "Bad Request"}The network is not connected to the project (connection_missing) or the connection is not active, e.g. it needs re-authorization (connection_not_ready).
Error with a machine-readable code. Body validation errors come as formErrors / fieldErrors; business errors carry a code.
object
object
Example
{ "code": "connection_missing", "platform": "facebook", "fieldErrors": { "mediaId": [ "media_required" ] }}The publishing rate limit was exceeded.
object
object
Example
{ "statusCode": 400, "message": "Invalid request", "error": "Bad Request"}