---
title: "Cancel a verification"
description: "Cancels a verification. A cancelled verification can no longer be checked."
version: "v2"
---

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

Path: MessagePort API › Verify

`POST /v3/verify/{verify}/cancel`

Cancels a verification. A cancelled verification can no longer be checked.

## Authentication

- `basicAuth`, http, header `Authorization`

## Path parameters

- `verify` (`cancelVerification.path.verify`; string, required) — Verification ID returned when it was created.
  - format `uuid`

## Code samples

### cURL

```bash
curl --request POST \
  --url https://app.messageport.com.au/api/v3/verify/cb4d9527-1d3a-4def-85ba-f1fec9489c4f/cancel \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.messageport.com.au/api/v3/verify/cb4d9527-1d3a-4def-85ba-f1fec9489c4f/cancel';
const options = {method: 'POST', 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.messageport.com.au/api/v3/verify/cb4d9527-1d3a-4def-85ba-f1fec9489c4f/cancel"

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

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

print(response.text)
```

## Responses

### 200

The cancelled verification.

#### Example

```json
{
  "data": {
    "id": "cb4d9527-1d3a-4def-85ba-f1fec9489c4f",
    "status": "sent",
    "type": "sms",
    "destination": "+61412345678",
    "source": "SHARED_NUMBER",
    "metadata": {
      "action": "login"
    },
    "template": "Your verification code is %code%",
    "expires_at": "2024-03-11T02:19:07.000000Z",
    "created_at": "2024-03-11T02:14:07.000000Z"
  }
}
```

- `data` (`cancelVerification.response.200.data`; object, optional)
  - example `{"id":"cb4d9527-1d3a-4def-85ba-f1fec9489c4f","status":"sent","type":"sms","destination":"+61412345678","source":"SHARED_NUMBER","metadata":{"action":"login"},"template":"Your verification code is %code%","expires_at":"2024-03-11T02:19:07.000000Z","created_at":"2024-03-11T02:14:07.000000Z"}`
  - `id` (`cancelVerification.response.200.data.id`; string, optional)
    - format `uuid`
  - `status` (`cancelVerification.response.200.data.status`; string, optional)
    - one of `"created"`, `"sent"`, `"expired"`, `"failed"`, `"verified"`, `"cancelled"`
  - `type` (`cancelVerification.response.200.data.type`; string, optional)
    - one of `"sms"`, `"email"`
  - `destination` (`cancelVerification.response.200.data.destination`; string, optional)
  - `source` (`cancelVerification.response.200.data.source`; string, optional)
  - `metadata` (`cancelVerification.response.200.data.metadata`; object | null, optional)
  - `template` (`cancelVerification.response.200.data.template`; string, optional)
  - `expires_at` (`cancelVerification.response.200.data.expires_at`; string, optional)
    - format `date-time`
  - `created_at` (`cancelVerification.response.200.data.created_at`; string, optional)
    - format `date-time`

### 400

The verification has already been verified.

#### Example

```json
{
  "message": "Verification already verified"
}
```

- `message` (`cancelVerification.response.400.message`; string, required)

### 401

Missing, malformed or invalid API credentials.

#### Example

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

- `message` (`cancelVerification.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` (`cancelVerification.response.403.message`; string, required)

### 404

The resource does not exist.

#### Example

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

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


Source: https://dev.messageport.com.au/api/verify/cancel/index.md
