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 Sendarrow-up-right 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


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.

Last updated

Was this helpful?