> 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-single-send.md).

# POST - Retry single send

Retries a single failed message. The message will retain its original message ID.

```
POST /campaigns/<campaignId>/messages/<messageId>/retry
```

***

**Prerequisites**

The message retry will only go through if:

* The message `latestStatus` is `failure`
* If the message belongs to a batch, the batch status is either `messages_enqueued` or `messages_enqueuing_failed`

After a message is retried, the message `latestStatus` will be set to `created`.

***

**Path Parameters**

| Parameter    | Type   | Required | Description                                                                                                  |
| ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `campaignId` | string | Yes      | The ID of the campaign the message belongs to.                                                               |
| `messageId`  | string | Yes      | The ID of the failed message to retry. This is the same `id` returned from the original Single 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 recipient, language, and template values from the original message.

***

**Response**

**HTTP 201 Created**

Returns the message object with the `latestStatus` reset to `created`.

```json
{
  "createdAt": "2024-05-16T16:48:42.247+08:00",
  "updatedAt": "2024-05-16T16:48:59.157+08:00",
  "id": "<YOUR_GENERATED_MESSAGE_ID>",
  "recipient": "6522222222",
  "values": {
    "name": "Emily Yeo"
  },
  "fullMessage": "<YOUR_FULL_MESSAGE>",
  "latestStatus": "created",
  "templateBodyId": "<YOUR_TEMPLATE_BODY_ID>",
  "campaignId": "<YOUR_CAMPAIGN_ID>",
  "creatorId": "<USER_ID_OF_MESSAGE_CREATOR>"
}
```

| Field            | Type   | Description                                                                                                                |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| `createdAt`      | string | ISO 8601 timestamp of when the message was originally created.                                                             |
| `updatedAt`      | string | ISO 8601 timestamp of the last update to the message.                                                                      |
| `id`             | string | The original message ID. This does not change on retry.                                                                    |
| `recipient`      | string | The recipient's phone number.                                                                                              |
| `values`         | object | The template parameter values used in the message.                                                                         |
| `fullMessage`    | string | The full rendered message text, including Postman's header and footer.                                                     |
| `latestStatus`   | string | Reset to `created` after a successful retry. Poll the Retrieve a Single Message endpoint to get the final delivery status. |
| `templateBodyId` | string | The ID of the template body used.                                                                                          |
| `campaignId`     | string | The campaign ID the message belongs to.                                                                                    |
| `creatorId`      | string | The user ID of the message creator.                                                                                        |

***

**Error Responses**

**HTTP 400 Bad Request**

| Error Code                                                 | Message                                                                                 | Cause                                                                                                          |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `message_not_found_or_retry_message_not_in_failure_status` | Message cannot be retried as it does not exist or it has not failed.                    | The message ID does not exist, or the message `latestStatus` is not `failure`.                                 |
| `too_many_message_attempts_error`                          | Message can no longer be retried as it has reached the maximum number of attempts of 3. | The message has already been retried 3 times. You will need to create a new message via Single Send if needed. |

**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>/messages/<YOUR_MESSAGE_ID>/retry \
  -H "Authorization: Bearer YOUR_API_KEY"
```

***

**Notes**

* The `messageId` in the retry endpoint is the same ID generated from the original Single Send request. It does not change across retries.
* Each message can be retried a maximum of **3 times**. After that, you must create a new message.
* Not all messages are suitable for retries, especially OTPs. By the time a retry is processed, the recipient may have already requested a new OTP.
* After retrying, poll the Retrieve a Single Message endpoint to check the new delivery status.
* Postman does not automatically retry failed messages. All retries must be triggered manually via this endpoint.


---

# 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-single-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.
