> ## Documentation Index
> Fetch the complete documentation index at: https://onextel-09023014.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Opt In / Opt Out

> Manage WhatsApp marketing and utility message consent: list, add, and remove opt-in and opt-out entries per recipient number.

Use these endpoints to manage recipient consent for WhatsApp messaging. Opt-out entries
suppress messages of a given type to a number; opt-in entries record explicit consent.
Each endpoint pair mirrors the same shape for `/opt/out/wa` and `/opt/in/wa`.

<ParamField header="apikey" type="string" required>
  API key generated for the TUC associated with the sending phone number. Required on
  every request below.
</ParamField>

## Get Opt Out

Lists numbers currently opted out.

```
GET /opt/out/wa
```

### Sample cURL request

```bash theme={null}
curl --location 'https://api.onexaura.com/opt/out/wa' \
--header 'apikey: YOUR_API_KEY'
```

***

## Get Opt In

Lists numbers currently opted in.

```
GET /opt/in/wa
```

### Sample cURL request

```bash theme={null}
curl --location 'https://api.onexaura.com/opt/in/wa' \
--header 'apikey: YOUR_API_KEY'
```

***

## Add Opt Out

Adds one or more numbers to the opt-out list for the given message type(s).

```
POST /opt/out/wa
```

<ParamField body="numbers" type="array" required>
  Array of recipient phone numbers to opt out.
</ParamField>

<ParamField body="sender" type="string" required>
  Sender's registered WhatsApp number.
</ParamField>

<ParamField body="message_types" type="array" required>
  Message categories to opt out of. Values: `marketing`, `utility`.
</ParamField>

### Sample JSON payload

```json theme={null}
{
  "numbers": ["919999999991", "919999999992"],
  "sender": "919888888888",
  "message_types": ["marketing", "utility"]
}
```

### Sample cURL request

```bash theme={null}
curl --location 'https://api.onexaura.com/opt/out/wa' \
--header 'apikey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "numbers": ["919999999991", "919999999992"],
  "sender": "919888888888",
  "message_types": ["marketing", "utility"]
}'
```

***

## Add Opt In

Adds one or more numbers to the opt-in list for the given message type(s).

```
POST /opt/in/wa
```

<ParamField body="numbers" type="array" required>
  Array of recipient phone numbers to opt in.
</ParamField>

<ParamField body="sender" type="string" required>
  Sender's registered WhatsApp number.
</ParamField>

<ParamField body="message_types" type="array" required>
  Message categories to opt into. Values: `marketing`, `utility`.
</ParamField>

### Sample JSON payload

```json theme={null}
{
  "numbers": ["919999999991", "919999999992"],
  "sender": "919888888888",
  "message_types": ["marketing", "utility"]
}
```

### Sample cURL request

```bash theme={null}
curl --location 'https://api.onexaura.com/opt/in/wa' \
--header 'apikey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "numbers": ["919999999991", "919999999992"],
  "sender": "919888888888",
  "message_types": ["marketing", "utility"]
}'
```

***

## Remove Opt Out

Removes a number from the opt-out list for a given message type.

```
DELETE /opt/out/wa
```

### Query parameters

<ParamField query="number" type="string" required>
  Recipient phone number to remove from the opt-out list.
</ParamField>

<ParamField query="sender" type="string" required>
  Sender's registered WhatsApp number.
</ParamField>

<ParamField query="message_type" type="string" required>
  Message category to remove the opt-out for. Values: `marketing`, `utility`.
</ParamField>

### Sample cURL request

```bash theme={null}
curl --location --request DELETE 'https://api.onexaura.com/opt/out/wa?number=919999999991&sender=919888888888&message_type=marketing' \
--header 'apikey: YOUR_API_KEY'
```

***

## Remove Opt In

Removes a number from the opt-in list for a given message type.

```
DELETE /opt/in/wa
```

### Query parameters

<ParamField query="number" type="string" required>
  Recipient phone number to remove from the opt-in list.
</ParamField>

<ParamField query="sender" type="string" required>
  Sender's registered WhatsApp number.
</ParamField>

<ParamField query="message_type" type="string" required>
  Message category to remove the opt-in for. Values: `marketing`, `utility`.
</ParamField>

### Sample cURL request

```bash theme={null}
curl --location --request DELETE 'https://api.onexaura.com/opt/in/wa?number=919999999991&sender=919888888888&message_type=marketing' \
--header 'apikey: YOUR_API_KEY'
```


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