# Delete a generation

URL: https://www.atmee.ai/docs/api/reference/generation/deleteGeneration

`DELETE /v1/generation/{requestId}`

Deletes a generation's outputs: their files go at once, their links
stop working, and `GET /v1/generation` shows the generation as
`deleted` (its inputs and poster stay, so it can be made again).
Any member of the account may delete any of its generations; an API
key scoped to an avatar only those of its avatar. Deleting again
answers `204` too. A generation still rendering cannot be deleted
yet (`409 generation_rendering`). Requires `generation:write` or
`avatars:write`. Nothing is refunded.

A request id is unique per operation. If the same id was used for two
(say a clip and a voice), pass `operation` (the list's `operation`),
or the delete answers `409 generation_ambiguous` and deletes nothing.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `requestId` | path | yes | The `Idempotency-Key` the generation's `POST` was sent with (`requestId` in `GET /v1/generation`). |
| `operation` | query | no | The generation's `operation`, as `GET /v1/generation` lists it. Needed only when the request id was used for more than one operation. |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `204` | The outputs are deleted. | none |
| `400` | invalid_input -- the request id is not a UUID. | `ApiErrorResponse` |
| `401` | Missing or invalid API key, or a user token that is invalid, anonymous or of a user who may act for no account (`invalid_login`). | none |
| `403` | insufficient_scope (needs generation:write or avatars:write) \| account_not_allowed (`X-Account-Id` names an account the user may not act for) | `ApiErrorResponse` |
| `404` | generation_not_found -- no generation under this request id in this account (or, for an avatar-scoped key, of its avatar). | `ApiErrorResponse` |
| `409` | generation_rendering (the call is still running; delete it once it has finished) \| generation_ambiguous (the request id was used for several operations; pass `operation`) \| account_ambiguous | `ApiErrorResponse` |
| `503` | generation_unavailable -- this instance does not offer generation. | `ApiErrorResponse` |
