## Delete a generation **delete** `/generations/{generation_id}` The SDKs do not wrap this method yet; call it over HTTP. Accept deletion of one of your finished generations. Deletion is asynchronous: the response is a deletion task, which you poll with GET /deletions/{task_id} until its state is terminal. A repeat request answers with the same task while it is active, and with the most recent task once the generation is gone; after a cancelled task, a request for a generation that still exists starts a new task. See the [Generation deletion guide](/guides/generation-deletion/) for the full lifecycle and what a deletion removes. Errors: `409` `GENERATION.NOT_TERMINAL` when your generation is still running or settling. `404` "Generation not found" when the id is not a UUID, does not exist, is not yours, or cannot be deleted, so another client's id looks the same as a missing one. `404` "Not Found" when generation deletion is not enabled for your API client. ### Path Parameters - `generation_id: string` ### Returns - `DeletionTask = object { id, blocked_reason, completed_at, 9 more }` One generation deletion task, as returned by DELETE /generations/{generation_id} and GET /deletions/{task_id}. See the [Generation deletion guide](/guides/generation-deletion/) for what each state, phase and blocked reason means. - `id: string` Deletion task identifier. Poll it with GET /deletions/{task_id}. - `blocked_reason: DeletionBlockedReason` Why a deletion task is blocked; null unless its state is blocked. - `"fk_dependency"` - `"settlement_pending"` - `"shared_bytes"` - `"external_error"` - `"dependency_cancelled"` - `"operator_hold"` - `completed_at: string` When the task completed; set only when state is completed. - `delete_deadline: string` The deadline recorded on the task, if any. - `overdue: boolean` True when delete_deadline passed before the task completed, or the task completed after it. Does not change state. - `phase: DeletionPhase` The last execution phase a deletion task reached; null before the task first runs and once it is completed. - `"stopping"` - `"discovering"` - `"waiting_for_children"` - `"deleting"` - `"verifying"` - `requested_at: string` When the deletion was requested. - `resource_id: string` The id of the generation the task deletes. - `resource_type: "generation"` The kind of resource the task deletes — always `generation`. - `"generation"` - `scheduled_at: string` When the task is or was due to run. A task created by DELETE is due when it is accepted. - `state: DeletionState` Lifecycle state of a deletion task. `completed` and `cancelled` are terminal; every other state is active. Only `completed` means the content was removed. - `"waiting"` - `"scheduled"` - `"queued"` - `"running"` - `"retry_wait"` - `"blocked"` - `"completed"` - `"cancelled"` - `updated_at: string` When the task last changed. ### Example ```http curl https://agents.lumalabs.ai/v1/generations/$GENERATION_ID \ -X DELETE \ -H "Authorization: Bearer $LUMA_AGENTS_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "blocked_reason": "fk_dependency", "completed_at": "2019-12-27T18:11:19.117Z", "delete_deadline": "2019-12-27T18:11:19.117Z", "overdue": true, "phase": "stopping", "requested_at": "2019-12-27T18:11:19.117Z", "resource_id": "resource_id", "resource_type": "generation", "scheduled_at": "2019-12-27T18:11:19.117Z", "state": "waiting", "updated_at": "2019-12-27T18:11:19.117Z" } ```