Source: https://fyno.docs.pageloop.ai/api-reference/fyno-verify/post-wsid-version-verify-validate

# Verify OTP

POST `https://api.fyno.io/v1/{WSID}/{version}/verify/validate`

This API enables you to validate the OTP entered by the user using either `request_id` (received in response of the Fire an Event API) or `destination` (such as phone number, email).

## Authorization

#### Authorization (header, string, required)

Enter your API Key. If you don't have it already, you can create one from the API Keys page within your Fyno account

## Path Parameters

#### WSID (path, string, required)

Enter your workspace ID. You can obtain this value from the API Keys page within your Fyno account.

#### version (path, enum (string), required) — allowed: live, test

Specify the version for which you would like to manage the user profile.

## Query Parameters

#### request\_id (query, string)

Specify the request id of the triggered notification event that sent the OTP to the user.
You must use this query parameter if **you've disabled "Use destination as id"** in the Fyno Verify setting.

#### destination (query, string)

Enter the destination where the OTP is sent. It can be either mobile no or email id.
You must use this query parameter if **you've enabled "Use destination as id"** in the Fyno Verify setting.

#### otp (query, string, required)

Enter the OTP which you want to validate.

## Response

#### 200

OTP successfully validated

#### \_message (string, required)

#### status (string, required)

#### 400

Invalid OTP entered by user

#### \_message (string, required)

#### status (string, required)

#### 401

API Key or Workspace ID is invalid. User is unauthorised.

#### \_message (string, required)

#### status (string, required)

#### Request

```bash cURL
curl -X POST 'https://api.fyno.io/v1/{WSID}/{version}/verify/validate' \
  -H 'Authorization: Bearer <token>'
```

```javascript JavaScript
const res = await fetch('https://api.fyno.io/v1/{WSID}/{version}/verify/validate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
  },
});
const data = await res.json();
```

```python Python
import requests

res = requests.post(
    'https://api.fyno.io/v1/{WSID}/{version}/verify/validate',
    headers={'Authorization': 'Bearer <token>'}
)
data = res.json()
```

#### Response

```json 200
{
  "_message": "OTP successfully validated.",
  "status": "ok"
}
```

```json 400
{
  "_message": "user entered the wrong OTP",
  "status": "error"
}
```

```json 401
{
  "_message": "Invalid API details",
  "status": "error"
}
```
