# Deletions ## Get a deletion **get** `/deletions/{task_id}` The SDKs do not wrap this method yet; call it over HTTP. Poll a generation deletion task returned by DELETE /generations/{generation_id}. Poll until state is `completed` or `cancelled`; only `completed` means the content was removed. See the [Generation deletion guide](/guides/generation-deletion/) for the states, phases and blocked reasons. Errors: `404` "Deletion not found" when the id is not a UUID, does not exist, is not yours, or is not a generation deletion. `404` "Not Found" when generation deletion is not enabled for your API client. ### Path Parameters - `task_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/deletions/$TASK_ID \ -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" } ``` ## Domain Types ### Deletion Blocked Reason - `DeletionBlockedReason = "fk_dependency" or "settlement_pending" or "shared_bytes" or 3 more` Why a deletion task is blocked; null unless its state is blocked. - `"fk_dependency"` - `"settlement_pending"` - `"shared_bytes"` - `"external_error"` - `"dependency_cancelled"` - `"operator_hold"` ### Deletion Phase - `DeletionPhase = "stopping" or "discovering" or "waiting_for_children" or 2 more` 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"` ### Deletion State - `DeletionState = "waiting" or "scheduled" or "queued" or 5 more` 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"` ### Deletion Task - `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.