# Create an opt out request

```
POST https://www.example.com/api/v2/opt_outs
```

## Request

### Query Parameters

**set_cookie** boolean

Whether or not the Do Not Sell cookie should be set on form submit

**Example:** `true`

### Header Parameters

**authorization** string required

**Example:** `Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9`

- application/json

### Body

**first_name** string required

The first name of the person wanting to opt out of the sharing or selling of their data

**Example:** `Chuck`

**last_name** string required

The last name of the person wanting to opt out of the sharing or selling of their data

**Example:** `Norris`

**email_address** string required

The email address of the person wanting to opt out of sharing or selling of their data

**Example:** `chuck.norris@example.com`

**location** string

The location of the person wanting to opt out

**Example:** `US-CA`

**privacy_request_policy_id** string

The privacy request policy UUID that is associated with the opt out request

**Example:** `7e12e442-bb40-4df7-b18e-b0f802af0a99`

**additional_info** string

Any additional details the user might want to add to their request

**Example:** `Additional information`

**authorized_agent** boolean

Whether or not the request has been submitted by an authorized agent or not

**Example:** `false`

**authorized_agent_first_name** string

The first name of the authorized agent that is submitting the request. Required if authorized_agent is true.

**Example:** `John`

**authorized_agent_last_name** string

The last name of the authorized agent that is submitting the request. Required if authorized_agent is true.

**Example:** `Wayne`

**authorized_agent_email** string

The email of the authorized agent that is submitting the request. Required if authorized_agent is true.

**Example:** `jwayne@example.com`

```json
{
  "first_name": "Chuck",
  "last_name": "Norris",
  "email_address": "chuck.norris@example.com",
  "location": "US-CA",
  "privacy_request_policy_id": "7e12e442-bb40-4df7-b18e-b0f802af0a99",
  "additional_info": "Additional information",
  "authorized_agent": false,
  "authorized_agent_first_name": "John",
  "authorized_agent_last_name": "Wayne",
  "authorized_agent_email": "jwayne@example.com"
}
```

## Responses

- 201
- 422

Opt Out Request created

- application/json

**Schema**

**data** object

**created_at** string

Datetime of when the opt out was created.

**Example:** `2024-08-09T21:14:49.444Z`

**due_date** string

Date of when the opt out is due.

**Example:** `2024-12-09T21:14:49.444Z`

**data** object

**canonical_email** string

The email associated with the data subject.

**Example:** `john@example.com`

**email** string

The email associated with the data subject.

**Example:** `john@example.com`

**first_name** string

The first name of the data subject.

**Example:** `John`

**last_name** string

The last name of the data subject.

**Example:** `Smith`

**location** object

The location the data subject when they submitted the request.

oneOf

- string
- null

string

**status** string

The status of the request.

**Example:** `not_started`

**additional_info** string

returning the additional_info passed in when the Opt Out was created

**Example:** `Some additional data`

**uuid** string

The unique identifier of the request.

**Example:** `967e34da-4863-4fcf-842d-176dd102d032`

**intake_data** object

The intake data associated with the request.
If submitted through an intake form, data subject specific information will be included here.

**property name*** object

oneOf

- string
- string[]

string

```json
{
  "data": {
    "created_at": "2024-08-09T21:14:49.444Z",
    "due_date": "2024-12-09T21:14:49.444Z",
    "data": {
      "canonical_email": "john@example.com"
    },
    "email": "john@example.com",
    "first_name": "John",
    "last_name": "Smith",
    "location": "US",
    "status": "not_started",
    "additional_info": "Some additional data",
    "uuid": "967e34da-4863-4fcf-842d-176dd102d032",
    "intake_data": {
      "first_name": "Guinevere",
      "last_name": "Camelot",
      "reported_country_code": "CA",
      "reported_sub_region_code_1": "QB",
      "favorite_colors": [
        "Red",
        "Blue"
      ]
    }
  }
}
```

## Invalid Request

- curl
- go
- java
- nodejs
- php
- python
- ruby
- rust
- swift

### CURL

```bash
curl -L 'https://www.example.com/api/v2/opt_outs' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
  "first_name": "Chuck",
  "last_name": "Norris",
  "email_address": "chuck.norris@example.com",
  "location": "US-CA",
  "privacy_request_policy_id": "7e12e442-bb40-4df7-b18e-b0f802af0a99",
  "additional_info": "Additional information",
  "authorized_agent": false,
  "authorized_agent_first_name": "John",
  "authorized_agent_last_name": "Wayne",
  "authorized_agent_email": "jwayne@example.com"
}'
```
