---
title: "Delete an opt-out"
description: "Removes an opt-out so the number can be messaged again. Use [List opt-outs](#listOptouts)\nwith `search` to find the opt-out ID for a number.\n"
version: "v2"
---

> Documentation Index
> Fetch the complete documentation index at: https://dev.touchsms.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

Path: touchSMS API › Opt-outs

`DELETE /v2/optouts/{optout}`

Removes an opt-out so the number can be messaged again. Use [List opt-outs](#listOptouts)
with `search` to find the opt-out ID for a number.

## Authentication

- `basicAuth`, http, header `Authorization`

## Path parameters

- `optout` (`deleteOptout.path.optout`; integer, required) — Opt-out ID.

## Code samples

### cURL

```bash
curl --request DELETE \
  --url https://app.touchsms.com.au/api/v2/optouts/12345 \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.touchsms.com.au/api/v2/optouts/12345';
const options = {method: 'DELETE', headers: {Authorization: 'Basic <credentials>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.touchsms.com.au/api/v2/optouts/12345"

headers = {"Authorization": "Basic <credentials>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

Opt-out deleted. The response body is empty.

### 401

Missing, malformed or invalid API credentials.

#### Example

```json
{
  "message": "Unauthenticated."
}
```

- `message` (`deleteOptout.response.401.message`; string, required)

### 403

The resource exists but does not belong to you, or you lack permission.

#### Example

```json
{
  "message": "This action is unauthorized."
}
```

- `message` (`deleteOptout.response.403.message`; string, required)

### 404

The resource does not exist.

#### Example

```json
{
  "message": "Not Found"
}
```

- `message` (`deleteOptout.response.404.message`; string, required)


Source: https://dev.touchsms.com.au/api/optouts/delete/index.md
