> For the complete documentation index, see [llms.txt](https://docs.sfox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfox.com/connect/rest-api/end-users/confirm-verification-code.md).

# Confirm Verification Code

<table data-header-hidden><thead><tr><th width="74.8046875" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><mark style="color:blue;"><strong>POST</strong></mark> </td><td>https://api.sfox.com/v1/enterprise/users/verify/:user_id</td></tr></tbody></table>

Submit verification codes to complete email or sms verification.

***

## Request

### Path Parameters

<table><thead><tr><th width="200.0078125">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>user_id</code> <br><mark style="color:red;">required</mark>, string</td><td>Unique ID for this user defined by you that will serve as the shared identifier for this account between you and sFOX.</td></tr></tbody></table>

### Body Parameters

<table><thead><tr><th width="199.65234375">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><mark style="color:red;">required</mark>, string</td><td><p>Verification requirement method.</p><p><em>Possible values: <code>email</code> , <code>sms</code></em></p></td></tr><tr><td><code>otp</code> <br><mark style="color:red;">required</mark>, string</td><td>Verification code sent to the user.</td></tr></tbody></table>

### Example Requests

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```shell
curl -X POST \
  -H 'Content-type: application/json' \
  -H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
  --data '{ "type": "email", "otp": "12345" }'  \
  "https://api.sfox.com/v1/enterprise/users/verify/${user_id}"
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS" %}

<pre class="language-javascript" data-line-numbers><code class="lang-javascript">const axios = require('axios');

const user_id = "${user_id}"
const data = JSON.stringify({type: 'email', otp: '12345'})
const config = {
  method: 'post',
  url: `https://api.sfox.com/v1/enterprise/users/verify/${user_id}`,
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${process.env.ENTERPRISE_API_KEY}`
  },
  data: data
}

axios(config)
  .then((response) => {
    console.log(response.status)
    console.log(respones.data)
  })
  .catch(err => {
    console.error(err.response.status)
    console.error(err.response.data)
<strong>  });
</strong></code></pre>

{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
import requests
import os

user_id = os.environ['${user_id}']

data = requests.post(
  f"https://api.sfox.com/v1/enterprise/users/verify/${user_id}",
  headers={
    "Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
  },
  json={
    "type": "email",
    "otp": "12345"
  }
)
print(data.status_code)
print(data.json())
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Response

### Response Fields

<table><thead><tr><th width="191.47265625">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>data</code><br>object</td><td>Verification code information.</td></tr><tr><td>    <code>success</code><br>    boolean</td><td>Whether verification was successful or not.</td></tr><tr><td>    <code>user_id</code><br>    string</td><td>The ID of the end user the code was sent to.</td></tr><tr><td>    <code>type</code><br>    string</td><td>The verification method for the code. <br><em>Possible values: <code>email</code> , <code>sms</code></em></td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;">200</mark>: OK</summary>

The following is an example response body from verifying an email verification code

{% code title="Successfully verified email" lineNumbers="true" %}

```json
{
    "data": {
        "success": true,
        "user_id": "client_account_1",
        "type": "email"
    }
}
```

{% endcode %}

The following is an example response body from verifying an sms verification code

{% code title="Successfully verified phone number" lineNumbers="true" %}

```json
{
    "data": {
        "success": true,
        "user_id": "client_account_1",
        "type": "sms"
    }
}
```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sfox.com/connect/rest-api/end-users/confirm-verification-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
