---
title: "Destroy the stored content of a finished task"
method: POST
path: "/api/v1/jobs/purge"
tags: ["Tasks"]
---

# Destroy the stored content of a finished task

`POST /api/v1/jobs/purge`

## Request

- Base URL: `https://api.popnow.ai`
- URL: `https://api.popnow.ai/api/v1/jobs/purge`
- Auth: HTTP bearer

Removes the task's generated media objects, its result payload, and the
stored request text including the prompt.

**Billing evidence is never touched.** The ledger, the charged amount,
the model identifier, the state, the timestamps and the request_id all
remain, so the task stays fully auditable in billing. What is destroyed
is the content, not the spend record; the response repeats this as
`billingRetained`.

Only a finished task can be destroyed; a task that is still queued or
running returns 400. Its outputs have not landed yet, and removing half
of them is worse than removing none. An accepted generation task cannot
be stopped, so the only thing to do is wait for it to reach a terminal
state and call this endpoint then.

The call is idempotent by `taskId`: destroying an already destroyed task
returns 200 with the original `purgedAt`, so a client may safely retry
after a timeout. This endpoint does not read an `Idempotency-Key` header;
the `taskId` itself is the idempotency key.

Media objects are removed by a background sweep within about a minute,
so `mediaDeletionPending` can be true while `contentState` is already
`purged`. Deleting them inline would let one undeletable object block the
whole request.

## Request body

- TaskActionRequest
  - `taskId` string, required

## Response `200`

Content destroyed, or already destroyed by an earlier call.

- TaskPurgeEnvelope
  - `code` 200, required
  - `msg` 'success', required
  - `request_id` string, required: Correlation identifier. Include it in support requests.
  - `data` TaskPurgeResponse, required
    - `taskId` string, required
    - `contentState` 'present' | 'expired' | 'purged', required: `purged` after a successful destroy, and on any idempotent repeat. Still `present` means this call removed nothing and may be retried later; the reason is deliberately not disclosed.
    - `purgedAt` string, date-time: Time of the **first** destroy, not of this call.
    - `contentRemovedBy` 'user' | 'system': Omitted while `contentState` is `present`.
    - `billingRetained` true, required: Always true. Destroying content never changes the ledger, the charged amount, or any other billing fact. It is stated explicitly because it is the one thing a caller is likely to get wrong about an endpoint named "purge".
    - `mediaDeletionPending` boolean, required: True while the background sweep has not finished removing the stored media objects.

## Other responses

- `400`: Invalid JSON, query, callback URL, model input, or media declaration. Invalid callBackUrl values return code 400 and msg "Invalid callback URL" with request_id. Submitted hosts, IP addresses, and DNS diagnostics are not echoed.
- `401`: Missing, malformed, expired, revoked, or otherwise invalid API key.
- `403`: Account, model, API-key, IP, or region authorization failed.
- `404`: Resource does not exist or is not visible to this account and API key. These cases are intentionally indistinguishable.
- `429`: Account-level request limit exceeded.
- `500`: Internal failure. Details are not exposed; report `request_id` to support.

## Changes

- **2026-10-20** `fede911a6e9b`: 72 warning
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `400`
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `401`
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `403`
  - added the new `agent_project_budget` enum value to the `allOf[subschema #2]/data/reason` response property for the response status `404`
  - …68 more

[Operation history](https://skmtc.dev/popnow/apis/popnow-api/changes/api/v1/jobs/purge/post.md)

---

[API](https://skmtc.dev/popnow/apis/popnow-api.md) · [All operations](https://skmtc.dev/popnow/apis/popnow-api/llms.txt) · [OpenAPI document](https://skmtc.dev/popnow/apis/popnow-api/revisions/fede911a6e9b?raw)
