> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wavix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WhatsApp recipient opted out

> The message wasn't delivered because the recipient turned off marketing messages, or blocked your sender or template.

**Error code:** `RECIPIENT_OPTED_OUT`

**Should you try again?** No. The message fails again until the recipient changes their choice in WhatsApp.

## Why it happens

The `subcode` field gives the cause, and `action` says what to do:

| `subcode` | `action` | Cause |
| - | - | - |
| `MARKETING_OPT_OUT` | `do_not_resend` | The recipient turned off marketing messages in WhatsApp. |
| `TEMPLATE_BLOCKED_BY_RECIPIENT` | `do_not_resend` | The recipient blocked this template. |
| `SENDER_BLOCKED_BY_RECIPIENT` | `do_not_resend` | Messages from your sender to this recipient are blocked. |

If `subcode` is `null`, `action` is `do_not_resend`.

## How to fix it

1. Stop sending this message to the recipient.
2. For `MARKETING_OPT_OUT`, stop sending marketing templates to this recipient, and record the opt-out in your system. Utility and authentication templates aren't affected. The `whatsapp.contact.marketing_resumed` event tells you when the recipient asks for marketing messages again.

For more information, see [Opt-in](https://docs.wavix.com/messaging/whatsapp/concepts.md#opt-in).

## Technical details

| Detail | Value |
| - | - |
| Returned in | The `whatsapp.message.failed` event, in `data.error`, and the `error` field of [Retrieve a WhatsApp message](https://docs.wavix.com/api-reference/whatsapp/retrieve-a-whatsapp-message.md) and [List WhatsApp messages](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-messages.md). The request that sent the message succeeded. |
| `code` | `RECIPIENT_OPTED_OUT` |
| `subcode` | A value from [Why it happens](#why-it-happens), or `null` |
| `action` | `do_not_resend` |

For the error format and how to handle it, see [WhatsApp delivery errors](https://docs.wavix.com/messaging/whatsapp/troubleshooting.md#how-delivery-errors-reach-you).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.