# DELETE /v1/scheduled-posts/:scheduledPostId (/docs/api/reference/publishing/cancel-post)



<Endpoint method="DELETE" path="/v1/scheduled-posts/:scheduledPostId" auth="Bearer" scope="publish:write" phase="1" />

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`](/docs/api/reference/publishing/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.

<Parameters
  title="Path"
  rows="[
  { name: 'scheduledPostId', type: 'string', required: true, description: 'Id returned by schedule or publish.' },
]"
/>

<Parameters
  title="Body"
  rows="[
  { name: 'reason', type: 'string', description: 'Free-form note stored on the audit log. 1024 chars max.' },
]"
/>

## Example request [#example-request]

<Tabs items="['curl', 'TypeScript', 'Python']">
  <Tab value="curl">
    ```bash
    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." }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const result = await layers.publishing.cancel({
      id: "sp_01HXZN4K5M6P7QRS8TUV9WXYZA",
      reason: "Brand asked us to hold — legal review pending.",
    });
    ```
  </Tab>

  <Tab value="Python">
    ```python
    result = layers.publishing.cancel(
        id="sp_01HXZN4K5M6P7QRS8TUV9WXYZA",
        reason="Brand asked us to hold — legal review pending.",
    )
    ```
  </Tab>
</Tabs>

## Response [#response]

<Response status="200" description="Canceled">
  ```json
  {
    "id": "sp_01HXZN4K5M6P7QRS8TUV9WXYZA",
    "status": "canceled",
    "canceledAt": "2026-04-18T19:22:41Z"
  }
  ```
</Response>

## Errors [#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 [#see-also]

* [`GET /v1/scheduled-posts/:id`](/docs/api/reference/publishing/get-scheduled-post) — check status before canceling
* [`POST /v1/scheduled-posts/:id/reschedule`](/docs/api/reference/publishing/reschedule-post) — reschedule if the issue is timing, not content
