# List OptOuts

### <mark style="color:green;">`GET`</mark> `/addressbook/optout`

&#x20;List all of your OptOuts between two set dates.

{% tabs %}
{% tab title="Curl" %}

```hsts
curl -X GET \
"https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01&endDate=2023-01-02" \
-H 'Authorization: Bearer [API Key]'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Authorization': 'Bearer [API Key]',
}

params = {
    'startDate': '2023-01-01',
    'endDate': '2023-01-02',
}

response = requests.get('https://api.mobivatebulksms.com/addressbook/optout', params=params, headers=headers)
```

{% endtab %}
{% endtabs %}

Retrieve 100 Optouts between 2023-01-01 00:00:00 (UTC) and 2023-01-02 00:00:00 (UTC).

{% tabs %}
{% tab title="Curl" %}

```hsts
curl -X GET \
"https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01&endDate=2023-01-02&pageSize=100" \
-H 'Authorization: Bearer [API Key]'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Authorization': 'Bearer [API Key]',
}

params = {
    'startDate': '2023-01-01',
    'endDate': '2023-01-02',
    'pageSize': '100',
}

response = requests.get('https://api.mobivatebulksms.com/addressbook/optout', params=params, headers=headers)
```

{% endtab %}
{% endtabs %}

Retrieve Opt-Outs between 2023-01-01 12:00:00 (AEST) and 2023-01-02 12:00:00 (AEST).

{% tabs %}
{% tab title="Curl" %}

```hsts
curl -X GET \
"https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01T12:00:00%2B1200&endDate=2023-01-02T12:00:00%2B1200" \
-H 'Authorization: Bearer [API Key]'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Authorization': 'Bearer [API Key]',
}

response = requests.get(
    'https://api.mobivatebulksms.com/addressbook/optout?startDate=2023-01-01T12:00:00%2B1200&endDate=2023-01-02T12:00:00%2B1200',
    headers=headers,
)
```

{% endtab %}
{% endtabs %}

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer [Api Key]` |

**Body**

<table><thead><tr><th>Name</th><th width="131">Type</th><th width="111">Required?</th><th>Description</th></tr></thead><tbody><tr><td>startDate</td><td>string</td><td>Yes</td><td><p></p><p>Start Date Format(s):</p><ul><li>YYYY-MM-DD</li><li>YYYY-MM-DDTHH:MM:SS+TZ </li></ul><p><strong>Examples</strong>:</p><ul><li><code>2023-01-01</code></li><li><code>2023-01-01T00:00:00+0000</code></li><li><code>2023-01-01T00:09:00+0900</code>.</li></ul></td></tr><tr><td>endDate</td><td>string</td><td>Yes</td><td><p>End Date. </p><p><strong>Examples</strong>: See startDate. </p></td></tr><tr><td>page</td><td>integer</td><td>No</td><td>Page number.<br><strong>Default</strong>: <em>1.</em></td></tr><tr><td>pageSize</td><td>integer</td><td>No</td><td>Number of message records to return.<br><strong>Default</strong>: <em>10</em><br><strong>Max</strong>: 1000.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
   {
      "id":1354505990,
      "mobile":"4400111222",
      "note":"MO",
      "created":1672704203000
   }
]
```

{% endtab %}

{% tab title="400" %}

```json
{
   "code":400,
   "message":"startDate: Invalid format: \"2023-01-011\" is malformed at \"1\""
}
```

{% endtab %}

{% tab title="401" %}

```json
{
   "code":401,
   "message":"Unauthorized"
}
```

{% endtab %}
{% endtabs %}

We use conventional HTTP response codes to indicate the success or failure of an API request. In general:

**2xx** indicate success\
**4xx** indicate an error that failed given the information provided (e.g., a required parameter was omitted)\
**5xx** errors indicate an error with ours servers (these are rare).

To see a full list of our **Response codes**, please [click here](/overview/introduction/understanding-response-codes.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.mobivatebulksms.com/archived-docs/list-optouts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
