Layers

DELETE /v1/scheduled-posts/:scheduledPostId

Cancel a queued post before it publishes.

View as Markdown
DELETE/v1/scheduled-posts/:scheduledPostId
Phase 1stable
Auth
Bearer
Scope
publish:write

Cancel a post that hasn't started publishing yet. The row stays in the database with status: canceled for audit — it does not disappear.

Cancel is also the escape hatch for publish-content: the 30-second lead time is your window to abort a mistaken immediate publish.

Once a post moves to publishing, cancel is best-effort. If the platform upload already went out, the post completes and cancel returns 409 CONFLICT. Already-published posts cannot be pulled back through this API — you'd delete upstream on the platform.

Path
  • scheduledPostId
    stringrequired
    Id returned by schedule or publish.
Body
  • reason
    stringoptional
    Free-form note stored on the audit log. 1024 chars max.

Example request

curl -X DELETE https://api.layers.com/v1/scheduled-posts/sp_01HXZN4K5M6P7QRS8TUV9WXYZA \
  -H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..." \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Brand asked us to hold — legal review pending." }'
const result = await layers.publishing.cancel({
  id: "sp_01HXZN4K5M6P7QRS8TUV9WXYZA",
  reason: "Brand asked us to hold — legal review pending.",
});
result = layers.publishing.cancel(
    id="sp_01HXZN4K5M6P7QRS8TUV9WXYZA",
    reason="Brand asked us to hold — legal review pending.",
)

Response

200Canceled
{
  "id": "sp_01HXZN4K5M6P7QRS8TUV9WXYZA",
  "status": "canceled",
  "canceledAt": "2026-04-18T19:22:41Z"
}

Errors

StatusCodeWhen
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks publish:write.
404NOT_FOUNDPost not in your organization.
409CONFLICTPost already terminal — published, failed, canceled, or draft_in_inbox.

See also

On this page