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

# Phone Verification

> Verify phone number ownership by sending an SMS or call verification code via the iDenfy API for customer identity and fraud checks.

<Note>
  **Requirements**

  * **API** key pair
  * Service **enabled** (done by iDenfy staff)
  * Number verification **credits**
</Note>

<Card title="Learn More" icon="globe" href="https://idenfy.com/phone-verification/">
  Verify identity seamlessly using phone number OTP -- fast verification for genuine users (under 30 seconds), global coverage, 2FA security, and automated onboarding.
</Card>

***

## Step 1: Send SMS with Verification Code

<Info>
  **Authorization:** `API key pair`
  **Method:** `POST`
  **Endpoint:** `https://ivs.idenfy.com/fraud/send-sms`
</Info>

Calling this endpoint sends an SMS message containing a verification code to your user.

### Request Structure

| Key            | Required | Type     | Constraints                                         | Default  | Explanation                                                             |
| -------------- | -------- | -------- | --------------------------------------------------- | -------- | ----------------------------------------------------------------------- |
| `phone_number` | Yes      | `String` | [E.164](https://en.wikipedia.org/wiki/E.164) format | --       | Phone number with country code to receive the verification code via SMS |
| `sender_name`  | No       | `String` | Max length 11                                       | `iDenfy` | Name or number displayed as the sender                                  |

### Response Structure

| Key          | Type     | Explanation                                  |
| ------------ | -------- | -------------------------------------------- |
| `request_id` | `String` | You will need this for the verification step |

<Tabs>
  <Tab title="Request">
    ```json theme={"system"}
    {
      "phone_number": "+12025550163",
      "sender_name": "The Sender"
    }
    ```
  </Tab>

  <Tab title="Response">
    ```json theme={"system"}
    {
      "request_id": "3d50e1584e0946e789e0185c009aaadf"
    }
    ```
  </Tab>
</Tabs>

**Example SMS message sent to your user:**

```
The Sender code: 1234. Valid for 5 minutes.
```

***

## Step 2: Verify User-Entered Code

<Info>
  **Authorization:** `API key pair`
  **Method:** `POST`
  **Endpoint:** `https://ivs.idenfy.com/fraud/verify-sms`
</Info>

After you send the verification code, your user enters the code they received and you verify whether it is valid.

### Request Structure

| Key             | Required | Type     | Constraints                  | Explanation                                             |
| --------------- | -------- | -------- | ---------------------------- | ------------------------------------------------------- |
| `request_id`    | Yes      | `String` | Min length 32, Max length 40 | The `request_id` returned from the SMS sending endpoint |
| `received_code` | Yes      | `String` | Length 4                     | Numerical verification code entered by the user         |

### Response Structure

| Key           | Type   | Explanation                                                                                                                      |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `is_verified` | `Bool` | `true` if the code was valid. `false` if the code was invalid, already validated, or the wrong code was provided too many times. |

<Tabs>
  <Tab title="Request">
    ```json theme={"system"}
    {
      "request_id": "3d50e1584e0946e789e0185c009aaadf",
      "received_code": "1234"
    }
    ```
  </Tab>

  <Tab title="Response">
    ```json theme={"system"}
    {
      "is_verified": true
    }
    ```
  </Tab>
</Tabs>
