All error codes
opted_out
HTTP 422Not retryableRecipient has opted out (replied STOP). The send cannot complete.
How to resolve
- The recipient replied STOP to a previous message.
- Opted-out contacts can only be re-opted-in if they send a START keyword.
- Attempting to send to opted-out contacts violates carrier regulations.
Example response
JSON
{
"object": "error",
"code": "opted_out",
"message": "Recipient has opted out (replied STOP). The send cannot complete.",
"request_id": "req_example123",
"docs_url": "https://docs.statxt.com/api/errors/opted_out"
}SDK handling
TypeScript
import { StatxtClient, StatxtApiError } from "@statxt/sdk"
const client = new StatxtClient({ apiKey: process.env.STATXT_API_KEY! })
try {
await client.messages.send({ ... })
} catch (err) {
if (err instanceof StatxtApiError && err.code === "opted_out") {
// Recipient has opted out (replied STOP). The send cannot complete.
console.error(err.requestId) // include in support tickets
}
}Public reference: /docs/errors/opted_out