# whatsapp_opt_in_required (/errors/whatsapp_opt_in_required)

| HTTP status | Type | Code |
| --- | --- | --- |
| 409 | `conflict_error` | `whatsapp_opt_in_required` |

## What it means [#what-it-means]

The recipient has not opted in to WhatsApp messages from you. Collect consent first and send it in `optIn` (`source`, and the consent `text` the customer agreed to) with the message, or use a utility or authentication template.

## How to handle it [#how-to-handle-it]

Fetch the resource again to see its current state, then decide whether to retry.

## Example response [#example-response]

```json
{
  "detail": "Marketing templates need a recorded opt-in.",
  "error": {
    "type": "conflict_error",
    "code": "whatsapp_opt_in_required",
    "message": "Marketing templates need a recorded opt-in.",
    "param": null,
    "docUrl": "https://docs.callmitra.ai/errors/whatsapp_opt_in_required",
    "requestId": "req_3f9c2a7d1b8e4c6a9f0e2d4b6a8c0e1f"
  }
}
```

Branch on `error.code`; it never changes once published. The `message` text can change. See [Errors](/errors) for the envelope.

## Returned by [#returned-by]

- `POST /api/v1/whatsapp/messages` — Send a WhatsApp message