> ## 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 RCS opt-in and opt-out lists for recipients, per sender and message type.

Manage which recipients are opted in or opted out of receiving RCS messages, scoped by sender
and message type (`promotional` or `transactional`). Use these endpoints to check, add, and
remove numbers from each list.

<Note>
  All requests are authenticated with the `apikey` header. See
  [RCS Messaging Overview](/api-reference/rcs/overview#authentication).
</Note>

## Opt Out list

### Get opt-out list

<ParamField header="apikey" type="string" required>
  Your OneXtel API key.
</ParamField>

```
GET https://api.onexaura.com/opt/out/rcs
```

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

**Response**

```json theme={null}
{
  "status": "success",
  "description": "success",
  "data": [
    {
      "tucid": "YOUR_TUC_ID",
      "sender": "your_rcs_sender",
      "number": "919999999999",
      "name": "Customer name",
      "message_type": "promotional",
      "channel": "rcs",
      "category_id": "1234"
    }
  ]
}
```

<ResponseField name="status" type="string">
  `success` when the request was served. Present on both lists, empty or not.
</ResponseField>

<ResponseField name="data" type="array">
  One entry per number on the list. An empty list returns `"data": []`.
</ResponseField>

<ResponseField name="data[].number" type="string">
  The recipient's number, with country code.
</ResponseField>

<ResponseField name="data[].sender" type="string">
  The RCS sender the entry applies to. The list covers the whole account, so entries for
  several senders can come back together.
</ResponseField>

<ResponseField name="data[].message_type" type="string">
  `promotional` or `transactional` — an entry is scoped to one type.
</ResponseField>

<ResponseField name="data[].tucid" type="string">
  The account the entry belongs to.
</ResponseField>

### Add to opt-out list

<ParamField header="apikey" type="string" required>
  Your OneXtel API key.
</ParamField>

```
POST https://api.onexaura.com/opt/out/rcs
```

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

<ParamField body="sender" type="string" required>
  RCS sender/bot ID the opt-out applies to.
</ParamField>

<ParamField body="message_types" type="array" required>
  Message types to opt the numbers out of, e.g. `["promotional", "transactional"]`.
</ParamField>

```json Request theme={null}
{
  "numbers": ["919999999999", "919888888888"],
  "sender": "your_rcs_sender",
  "message_types": ["promotional", "transactional"]
}
```

```bash cURL theme={null}
curl --location 'https://api.onexaura.com/opt/out/rcs' \
--header 'apikey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "numbers": ["919999999999", "919888888888"],
  "sender": "your_rcs_sender",
  "message_types": ["promotional", "transactional"]
}'
```

### Remove from opt-out list

<ParamField header="apikey" type="string" required>
  Your OneXtel API key.
</ParamField>

```
DELETE https://api.onexaura.com/opt/out/rcs
```

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

<ParamField query="sender" type="string" required>
  RCS sender/bot ID the opt-out applies to.
</ParamField>

<ParamField query="message_type" type="string" required>
  Message type to remove the opt-out for. One of `promotional`, `transactional`.
</ParamField>

```bash cURL theme={null}
curl --location --request DELETE 'https://api.onexaura.com/opt/out/rcs?number=919999999999&sender=your_rcs_sender&message_type=promotional' \
--header 'apikey: YOUR_API_KEY'
```

## Opt In list

### Get opt-in list

<ParamField header="apikey" type="string" required>
  Your OneXtel API key.
</ParamField>

```
GET https://api.onexaura.com/opt/in/rcs
```

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

**Response**

```json theme={null}
{
  "status": "success",
  "description": "success",
  "data": [
    {
      "tucid": "YOUR_TUC_ID",
      "sender": "your_rcs_sender",
      "number": "919999999999",
      "name": "Customer name",
      "message_type": "promotional",
      "channel": "rcs",
      "category_id": "1234"
    }
  ]
}
```

<ResponseField name="status" type="string">
  `success` when the request was served. Present on both lists, empty or not.
</ResponseField>

<ResponseField name="data" type="array">
  One entry per number on the list. An empty list returns `"data": []`.
</ResponseField>

<ResponseField name="data[].number" type="string">
  The recipient's number, with country code.
</ResponseField>

<ResponseField name="data[].sender" type="string">
  The RCS sender the entry applies to. The list covers the whole account, so entries for
  several senders can come back together.
</ResponseField>

<ResponseField name="data[].message_type" type="string">
  `promotional` or `transactional` — an entry is scoped to one type.
</ResponseField>

<ResponseField name="data[].tucid" type="string">
  The account the entry belongs to.
</ResponseField>

### Add to opt-in list

<ParamField header="apikey" type="string" required>
  Your OneXtel API key.
</ParamField>

```
POST https://api.onexaura.com/opt/in/rcs
```

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

<ParamField body="sender" type="string" required>
  RCS sender/bot ID the opt-in applies to.
</ParamField>

<ParamField body="message_types" type="array" required>
  Message types to opt the numbers into, e.g. `["promotional", "transactional"]`.
</ParamField>

```json Request theme={null}
{
  "numbers": ["919999999999", "919888888888"],
  "sender": "your_rcs_sender",
  "message_types": ["promotional", "transactional"]
}
```

```bash cURL theme={null}
curl --location 'https://api.onexaura.com/opt/in/rcs' \
--header 'apikey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "numbers": ["919999999999", "919888888888"],
  "sender": "your_rcs_sender",
  "message_types": ["promotional", "transactional"]
}'
```

### Remove from opt-in list

<ParamField header="apikey" type="string" required>
  Your OneXtel API key.
</ParamField>

```
DELETE https://api.onexaura.com/opt/in/rcs
```

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

<ParamField query="sender" type="string" required>
  RCS sender/bot ID the opt-in applies to.
</ParamField>

<ParamField query="message_type" type="string" required>
  Message type to remove the opt-in for. One of `promotional`, `transactional`.
</ParamField>

```bash cURL theme={null}
curl --location --request DELETE 'https://api.onexaura.com/opt/in/rcs?number=919999999999&sender=your_rcs_sender&message_type=promotional' \
--header 'apikey: YOUR_API_KEY'
```


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