---
title: "Verify code"
description: "Request"
canonical: "https://docs.cm.com/verification/otp/verify-code"
---

# Verify code

> Request

Source: https://docs.cm.com/verification/otp/verify-code

## Request

```text title="Request"
POST https://api.cm.com/otp/v2/otp/{id}/verify
```

### HTTP headers

| Header | Description |
| - | - |
| X-CM-ProductToken | Your product token. Retrieve from [Messaging Gateway app](https://www.cm.com/app/gateway/). |
| Content-Type | application/json |

### Request body

```json title="Request body"
{
    "code": "12345"
}
```

### URL parameter

| Parameter | Type | Description |
| - | - | - |
| id | string | The identifier for the OTP, returned in the response after creating the OTP. |

### Parameter

| Parameter | Type | Description |
| - | - | - |
| code | string | The code received via the specified channel. |

```json title="Response body"
{
    "id": "1e12cb10-d14a-4cd6-8d86-e5263cf122ee",
    "channel": "sms",
    "verified": true,
    "createdAt": "2026-01-01T13:00:00+0000",
    "expiresAt": "2026-01-01T13:01:00+0000"
}
```

:::note
Once a code has been successfully validated, it cannot be validated again.
:::

### Parameters

| Parameter | Description |
| - | - |
| id | The identifier of the OTP. |
| channel | The channel used to send the code. |
| verified | Indicates if the code was valid. |
| createdAt | The date the OTP was created. |
| expiresAt | The date the OTP will expire. |
