> For the complete documentation index, see [llms.txt](https://postman-v2.guides.gov.sg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://postman-v2.guides.gov.sg/technical-users-api/api-reference/post-retry-batch-send.md).

# POST - Retry batch send

Retries all failed messages that belong to a batch. All messages that are retried will retain their original message IDs.

```
POST /campaigns/<campaignId>/batch/<batchId>/retry
```

***

**Prerequisites**

The batch retry will only return a HTTP 201 response if:

* The batch status is `messages_enqueued` or `messages_enqueuing_failed`

The batch retry will fail if:

* Any message in the batch still has a `latestStatus` of `created` (in this case, the batch status will be set to `messages_enqueuing_failed`)
* All messages in the batch are successful
* All failed messages have already exceeded the maximum number of retry attempts (3 per message)

***

**Path Parameters**

| Parameter    | Type   | Required | Description                                                                                                                                                                    |
| ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `campaignId` | string | Yes      | The ID of the campaign the batch belongs to.                                                                                                                                   |
| `batchId`    | string | Yes      | The ID of the batch to retry. This is the same `batchId` returned from the original [Batch Send](https://postman-v2.guides.gov.sg/endpoints-for-api-users/batch-send) request. |

***

**Request Headers**

| Header          | Value                 | Required |
| --------------- | --------------------- | -------- |
| `Authorization` | `Bearer YOUR_API_KEY` | Yes      |

***

**Request Body**

This endpoint does not require a request body. The retry uses the same recipients, languages, and template values from the original batch.

***

**Response**

**HTTP 201 Created**

This endpoint has no response body. A HTTP 201 response indicates the batch retry has been attempted.

***

**Error Responses**

**HTTP 400 Bad Request**

| Error Code                            | Message                                                                                                                            | Cause                                                                                                                                         |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_not_found_or_is_not_retryable` | Batch cannot be retried as it does not exist or is currently not retryable.                                                        | The batch ID does not exist, or the batch is still processing (status is not `messages_enqueued` or `messages_enqueuing_failed`).             |
| `unresolved_batch_messages`           | Batch cannot be retried as there is at least one batch message that is still unresolved.                                           | One or more messages in the batch still have a `latestStatus` of `created`. Wait for all messages to reach a terminal status before retrying. |
| `no_failed_batch_messages_to_retry`   | Batch cannot be retried as either all messages are successful or all failed messages have exceeded the maximum number of attempts. | No retryable messages remain. Either all messages succeeded, or all failed messages have already been retried 3 times.                        |

**HTTP 401 Unauthorized**

| Error Code                 | Message                                          | Cause                                           |
| -------------------------- | ------------------------------------------------ | ----------------------------------------------- |
| `invalid_api_key_provided` | The API key provided is invalid.                 | API key is incorrect, expired, or deleted.      |
| `invalid_ip_address_error` | The IP address used for this request is invalid. | Request sent from a non-whitelisted IP address. |

**HTTP 429 Too Many Requests**

| Error Code          | Message           | Cause                                                                                                                      |
| ------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `too_many_requests` | Too many requests | Rate limit exceeded. Default is 10 TPS per campaign, shared across all endpoints. Implement exponential backoff and retry. |

***

**Example: cURL**

```bash
curl -X POST \
  https://postman.gov.sg/api/v2/campaigns/<YOUR_CAMPAIGN_ID>/batch/<YOUR_BATCH_ID>/retry \
  -H "Authorization: Bearer YOUR_API_KEY"
```

***

**Notes**

* The `batchId` in the retry endpoint is the same ID returned from the original Batch Send request. It does not change across retries.
* Batch retry retries **all** failed messages in the batch at once. You cannot selectively retry individual messages within a batch using this endpoint. To retry a single message, use the Retry Single Send endpoint with the individual message ID.
* Each message can be retried a maximum of **3 times**. After that, a new batch must be created.
* Before retrying, use the Retrieve Batch Messages endpoint to check the batch status and confirm all messages have resolved (no messages with `latestStatus` of `created`).
* After retrying, use the Retrieve Batch Messages endpoint to check the updated delivery statuses.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://postman-v2.guides.gov.sg/technical-users-api/api-reference/post-retry-batch-send.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
