DELETE /v1/scheduled-posts/:scheduledPostId
Cancel a queued post before it publishes.
DELETE
/v1/scheduled-posts/:scheduledPostIdPhase 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
scheduledPostIdstringrequiredId returned by schedule or publish.
Body
reasonstringoptionalFree-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
| Status | Code | When |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks publish:write. |
| 404 | NOT_FOUND | Post not in your organization. |
| 409 | CONFLICT | Post already terminal — published, failed, canceled, or draft_in_inbox. |
See also
GET /v1/scheduled-posts/:id— check status before cancelingPOST /v1/scheduled-posts/:id/reschedule— reschedule if the issue is timing, not content