Publish now
Publish now (posts:publish)
Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.
From draft, scheduled or failed. The post becomes publishing and a job publishes each target;
the post ends published when every target is, failed when one is not (retry a target with
POST /v1/posts/{id}/targets/{channel}/retry). Targets on your own automation (provider custom)
emit post.publish_requested and wait for POST .../result. A post carrying a file in Deleted is refused
(422 on media), as scheduling it is: restore the file first.
AuthorizationBearer <token>API key (stk_...), or in the Community Edition the access token (stk_local_...)
id*stringIdempotency-Key?stringReplays the stored response when the same key is repeated with the same method, path,
query string and body within 24 hours (422 idempotency_mismatch with a different
request, 409 idempotency_in_progress while the first one runs). Not applied to
multipart uploads or to responses that carry a secret.
length <= 200Publishing
application/json- response
id*stringcollection_id*stringcollection_name*stringcontent*stringmedia*array<string>Media ids, in order
media_items*array<>The same media, resolved
status*PostStatusdraft (being written), scheduled (goes out at publish_at), publishing (a job is at work), published (every target is), failed (a target is; retry it or edit and publish again)
"draft""scheduled""publishing""published""failed"publish_at*|When it goes out (scheduled), or the time it kept as a note (draft after cancel)
date-timepublished_at*|date-timetags*array<string>metadata*Free JSON for your own use
source*stringWho created it: a client name, an agent, a schedule
external_ref*stringYour own reference
repeat_every*RepeatEveryRepeat the post: once it is published, staqly schedules a copy this long after its publish time (every 1 to 6 days, every 1 or 2 weeks, every month); the copy repeats too. Empty: no repeat. To stop, clear repeat_every on the next scheduled copy, or delete it.
"""1d""2d""3d""4d""5d""6d""1w""2w""1mo"thread*array<>Replies published under the post after it, in order
version*integerGrows with every edit; see PostPatch.expected_version
targets*array<>created_at*stringdate-timeupdated_at*stringdate-timecreated_by*stringWho created the post: a person, or the API key (agent, automation) that did; empty when unknown
open_comments*integerReviewers' comment threads not resolved yet
curl -X POST 'https://staqly.example.com/v1/posts/string/publish'{ "id": "string", "collection_id": "string", "collection_name": "string", "content": "string", "media": [ "string" ], "media_items": [ { "id": "string", "mime_type": "string", "size_bytes": 0, "original_name": "string", "url": "string", "sha256": "string", "created_at": "2019-08-24T14:15:22Z", "alt_text": "string", "width": 0, "height": 0, "duration_ms": 0, "folder_id": "string", "tags": [ "string" ], "deleted_at": "2019-08-24T14:15:22Z", "purge_at": "2019-08-24T14:15:22Z", "duplicate_of": "string" } ], "status": "draft", "publish_at": "2019-08-24T14:15:22Z", "published_at": "2019-08-24T14:15:22Z", "tags": [ "string" ], "metadata": {}, "source": "string", "external_ref": "string", "repeat_every": "", "thread": [ { "content": "string", "media": [ "string" ], "delay_seconds": 0, "media_items": [ { "id": "string", "mime_type": "string", "size_bytes": 0, "original_name": "string", "url": "string", "sha256": "string", "created_at": "2019-08-24T14:15:22Z", "alt_text": "string", "width": 0, "height": 0, "duration_ms": 0, "folder_id": "string", "tags": [ "string" ], "deleted_at": "2019-08-24T14:15:22Z", "purge_at": "2019-08-24T14:15:22Z", "duplicate_of": "string" } ] } ], "version": 0, "targets": [ { "channel_id": "string", "channel_name": "string", "provider": "string", "avatar_url": "string", "content": "string", "settings": { "property1": "string", "property2": "string" }, "status": "pending", "external_id": "string", "external_url": "string", "error": "string", "attempts": 0, "published_at": "2019-08-24T14:15:22Z", "replies": [ { "index": 0, "status": "pending", "external_id": "string", "external_url": "string", "error": "string", "published_at": "2019-08-24T14:15:22Z" } ] } ], "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "created_by": "string", "open_comments": 0}