---
title: "Cancel verifications by destination"
description: "Cancels every verification sent to `destination`. Note the response body is an array\ncontaining a single object.\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 › Verify

`POST /v3/verify/cancel-by`

Cancels every verification sent to `destination`. Note the response body is an array
containing a single object.

## Authentication

- `basicAuth`, http, header `Authorization`

## Request body

_Required._

- `destination` (`cancelVerificationByDestination.destination`; string, required) — The number being verified, in the same format used when the verification was created.

## Example request

```json
{
  "destination": "+61412345678"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://app.touchsms.com.au/api/v3/verify/cancel-by \
  --header 'Authorization: Basic <credentials>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "destination": "+61412345678"
}
'
```

### TypeScript

```typescript
const url = 'https://app.touchsms.com.au/api/v3/verify/cancel-by';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Basic <credentials>'},
  body: JSON.stringify({destination: '+61412345678'})
};

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/v3/verify/cancel-by"

payload = { "destination": "+61412345678" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Basic <credentials>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Number of verifications cancelled.

#### Example

```json
[
  {
    "data": {
      "cancelled_count": 2
    }
  }
]
```

- `data` (`cancelVerificationByDestination.response.200.data`; object, optional)
  - `cancelled_count` (`cancelVerificationByDestination.response.200.data.cancelled_count`; integer, optional)

### 401

Missing, malformed or invalid API credentials.

#### Example

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

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

### 422

The request failed validation. `errors` lists the messages for each invalid field.

#### Example

```json
{
  "message": "The messages field is required.",
  "errors": {
    "messages": [
      "The messages field is required."
    ]
  }
}
```

- `message` (`cancelVerificationByDestination.response.422.message`; string, optional)
- `errors` (`cancelVerificationByDestination.response.422.errors`; map<array<string>>, optional)


Source: https://dev.touchsms.com.au/api/verify/cancel-by-destination/index.md
