# Replay a dead letter

URL: /docs/api/services/deadletter/replay

`POST /apis/funcd.io/v1alpha1/namespaces/{namespace}/deadletters/{id}/replay`

## Authentication

One of:

- `bearer`: A credential of funcd's config, sent as Authorization: Bearer followed by its token.
- `apiKey`: A credential of funcd's config, sent in the X-Api-Key header.

## Parameters

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `namespace` | path | string, required | The dead letter's namespace. |
| `id` | path | string, required | The dead letter's ID. |

## Answers

| Status | Problem type | When | What to do |
| --- | --- | --- | --- |
| 204 |  | No Content |  |
| 400 | `urn:funcd:problem:invalid` | The action's input in the Sensor is not a JSON object, or holds an expression that does not evaluate; the dead letter stays. | Correct the action's input in the Sensor, then retry. |
| 401 | `urn:funcd:problem:unauthorized` | The request carries no bearer token or API key, or one that funcd does not know. | Send a credential of funcd's config as a bearer token in the Authorization header, or in X-Api-Key. |
| 403 | `urn:funcd:problem:forbidden` | The credential's role or namespaces do not allow it to delete Sensors in the namespace. | Use a credential whose role allows it, such as a developer of the namespace or an admin. |
| 404 | `urn:funcd:problem:not-found` | No dead letter of that ID exists in the namespace. | Check the ID: funcdctl eventing dlq list lists the namespace's dead letters. |
| 404 | `urn:funcd:problem:not-found` | The Sensor that the dead letter names no longer exists. | Apply the Sensor again, then retry, or discard the dead letter. |
| 404 | `urn:funcd:problem:not-found` | The Sensor no longer has the dead letter's action. | Add the action back to the Sensor, then retry, or discard the dead letter. |
| 409 | `urn:funcd:problem:conflict` | Another replay of the dead letter is running. | Retry once that replay has ended. |
| 409 | `urn:funcd:problem:conflict` | The action's Function serves HTTP, so only the edge calls it; the dead letter stays. | Point the action at a Function that does not serve HTTP, then retry. |
| 422 | `about:blank` | The namespace in the path is not a DNS-1123 label. | Use at most 63 lowercase letters, digits and hyphens, starting and ending with a letter or a digit. |
| 422 | `about:blank` | The query holds a parameter that the operation does not take. | Send only the parameters that the operation lists. |
| 503 | `urn:funcd:problem:unavailable` | The platform is held, or the namespace is held for its data or while a Restore loads it, so funcd delivers no event. | Retry once the hold is released: funcdctl hold release releases the platform's hold, and funcdctl hold release --namespace the namespace's, once any Restore that loads it has ended. |
| 503 | `urn:funcd:problem:unavailable` | The delivery failed again, such as on a Function that is missing, has no ready worker or answers an error; the dead letter stays, with its attempts reset and the new reason. | Correct what the dead letter's reason names, then retry. |