Retry a message's failed deliveries
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/messages/v2-messages-retry.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
PUT/
Sends an outbound message again to the recipients it failed to reach. Recipients who already got it are not sent it again. The resend is queued: the response is empty, and each recipient's status updates as delivery happens.
Check delivery_summary.retryable (or retryable) first. To retry one recipient only, use the recipient retry operation.
Business rules
- Only outbound messages whose delivery failed or partly failed can be retried.
- Emails can be retried only while YoPrint still keeps the original send, normally 7 days.
- On texts, and on emails sent by YoPrint's current email sending, every failed recipient must still be retryable: if one is not (for example its email is past the 7 days), the whole call answers 422. Retry the others one at a time with the recipient retry operation.
- Each recipient is sent to the same address or number as the first time, even if the contact changed since.
Side effects
- Spends money Sends the email again (through YoPrint's email provider) or the text again, through your team's Twilio account, which Twilio charges you for.
- When an email sent through YoPrint's tracked email delivery fails again, the creator of the order or purchase order gets another delivery failure email.
- People with the message open see the delivery status update live.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The message's
id, from the message list. A hash id; unique keys and document numbers are refused with 404.- Example
u7HKhdhT6tkEUy
- Example
Request body
application/json, optional.
external_integration_idstringOptional. A texting integration id of your team. It does not change which account sends today: texts go through the message's own or your team's active Twilio integration.
Response
200Successful response.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.- When
- The message is on a sales order or quote you can't message (
user_is_not_authorized). - Fix
- Ask a team admin for permission to message that order.
404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.- When
- No message of this team has this id, or
external_integration_idmatches no integration of your team. - Fix
- Use ids from the API.
422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
external_integration_idis not a valid id (validation_failed;error.fieldsnames the field). Checked first.- Fix
- Leave it out.
- When
- The message can't be retried: it is inbound, nothing failed, a failed email is past the 7 days, YoPrint no longer keeps the original, or a failed recipient can't be retried (
message_not_retryable, "Message is not retryable"). Same answer asdelivery_summary.retryablefalse. - Fix
- Retry single recipients, or send a new message.
500A business rule refused the request (see the operation's errors), or something failed inside YoPrint. Refusals use the error envelope with a code such as
action_not_allowed; an unexpected failure answers{"message": "Server Error"}. Repeating a refusal gets the same answer; after an unexpected failure, read the record back before you retry a change.- When
- It is a text message and your team has no active Twilio integration: a server error, not a 422. Nothing is queued.
- Fix
- Connect Twilio again in the web app, then retry.
Notes
- A
200means the resend was queued, not that it was delivered. Read the message or its recipients again to see the outcome. - If YoPrint can no longer read its stored copy of the message, the call still answers
200, but nothing is sent and the recipients stay failed. Instead,latest_error_reasonchanges on every failed recipient (on the one-recipient retry, on that recipient only): topostmark_retry_mailable_unavailablefor an email sent through YoPrint's tracked email delivery (a message of version 3 or with a dispatch id, or, on the one-recipient retry, a recipient with a tracked send attempt), otherwise tomailable_serialization_failed, for example for older emails and for texts. Read the recipients after a retry.
Related
- PUTRetry delivery to one recipient
/v2/ api/ store/ {team_slug}/ messages/ {hash_id}/ recipients/ {id}/ retry - GETGet a message
/v2/ api/ store/ {team_slug}/ messages/ {hash_id}
