---
title: "Cancel in-flight content generation"
method: POST
path: "/api/v1/content/{id}/cancel"
tags: ["Content"]
---

# Cancel in-flight content generation

`POST /api/v1/content/{id}/cancel`

## Request

- Base URL: `https://app.promptingco.com`
- URL: `https://app.promptingco.com/api/v1/content/{id}/cancel`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Cancel a draft whose generation is still `pending` or `generating`. The draft is marked `cancelled` and soft-deleted so it leaves the generating queue. Completed, failed, rejected, approved, or published drafts return 409 — delete or revert those instead.

## Path parameters

- `id` string, required

## Response `200`

Successful response

- object
  - `ok` true, required
  - `data` object, required
    - `draftId` string, required
    - `status` 'cancelled', required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Not found
- `409`: The draft is no longer pending or generating and cannot be cancelled.
- `422`: Validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api.md) - [All operations](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/llms.txt) - [OpenAPI document](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/revisions/c0451ea10e9a?raw)
