# Verify OTP

## Verify OTP

<mark style="color:green;">`POST`</mark> `https://api.oneroute.io/api/oneotp/verify`

Use this endpoint to verify that the customer entered the same OTP that was sent with the Send OTP endpoint.&#x20;

#### Headers

| Name   | Type   | Description                  |
| ------ | ------ | ---------------------------- |
| apikey | string | API key, for Authentication. |

#### Request Body

| Name       | Type   | Description                                  |
| ---------- | ------ | -------------------------------------------- |
| key        | string | Verification Key, from the Send OTP request. |
| otp        | string | OTP to verify                                |
| identifier | string | email or phone number the OTP was sent to    |

{% tabs %}
{% tab title="200 " %}

```
{
    "message": "Otp verified successfully",
    "body": {
        "status": "Success",
        "response": "OTP Matched"
    },
    "success": true
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "data": null,
    "message": "OTP already used!!",
    "success": false
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "data": null,
    "message": "Invalid API Key",
    "success": false
}
```

{% endtab %}
{% endtabs %}

### **Verify with USSD**

When you include USSD as one of your preferred OneOTP channels, your customers can verify their OTP by dialing your USSD code which you can find on your [Account Settings Page](https://app.oneroute.io/settings/account-settings).

Once verification is complete, a notification will be sent to the `webhook url`configured on your [Account Settings Page](https://app.oneroute.io/settings/account-settings) to notify you that the OTP has been verified successfully.

#### Webhook Payload Sample

```
{
    "id": "63d45b42-0898-43b3-b81d-1fb2d45bc78f",
    "otp": "1234",
    "identifier": "+234XXXXXXXX",
    "expiration_time": "1941-06-22T16:36:45.742Z"
    "createdAt": "1941-06-22T16:36:45.742Z"
}
```
