# Fix a failed row and send it again

> PATCH /api/v1/bulk-batches/{id}/rows/{row}: Fix a failed row and send it again.

`PATCH https://appliflo.com/api/v1/bulk-batches/{id}/rows/{row}`

Change a failed row's people (by role key: name and/or email) or prefilled boxes (by index), then it is checked like the review step and sent as a new envelope. A change is required: a row the email provider refused or that bounced (needs_fix) would fail the same way again.

Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | batch_id from POST /templates/{id}/bulk |
| `row` | path | yes | The row number GET /bulk-batches/{id} reports |

## Request body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `people` | map of object | no |  |
| `prefill` | map of string | no |  |

## Responses

| Status | Description |
| --- | --- |
| 200 | The row, queued again. |
| 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. |
| 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. |
| 404 | Resource not found in this workspace. |
| 409 | Only a failed row can be fixed (code not_fixable). |
| 422 | Refused, with a `code`: no_change (nothing changed), invalid (a missing name, an invalid or shared email), unknown_role, unknown_field. |
| 500 | Internal error. |

## 200 response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | true | yes |  |
| `data` | object | yes |  |
| `data.row` | integer | yes |  |
| `data.status` | string | yes | One of: queued, sent, failed, excluded, cancelled |
| `data.envelope_id` | string \| null | yes |  |
| `data.error` | string \| null | yes |  |
| `data.error_code` | string \| null | yes | Why it failed: transient (retry-failed can help), permanent (the email provider refused it) or bounced. One of: transient, permanent, bounced, null |
| `data.needs_fix` | boolean | yes | Retrying as is can't help: PATCH /bulk-batches/{id}/rows/{row} with a change first |
| `data.attempts` | integer | yes |  |

See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency).
