> For the complete documentation index, see [llms.txt](https://docs.talkstack.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talkstack.ai/authentication/verify-email.md).

# Verify Email

**Step 1: Prepare Your Request**

* **Endpoint:** `/auth/verify-email`
* **Method:** `POST`
* **URL:** `https://api.talkstackai.com/auth/verify-email`
* **Headers:** Include `Content-Type: application/json`.

**Step 2:** **Create the Request Body**

* `email`: Email of the user.
* `code` : The code sent to the email entered.

**Example Request Body:**

```
{
    "email": "example@host.com",
    "code": "xxxxxx"
}
```

**Step 3: Send the Request**

Use your preferred HTTP client to send the POST request with the JSON body.

**Step 4: Handle the response**

**Success Response:**

* **Status Code:** `200 OK`
* `userData`: It is the data about the user.
* `verificationStatus`: The verification statuses are based on this enum:

```javascript
export const EMAIL_VERIFICATION_STATUS = {
    'CREDENTIALS_MISSING': 0,
    'INVALID_CODE': 1,
    'SUCCESS': 2,
    'RESEND_INVITE': 3,
    'ACCOUNT_EXISTS': 4,
    'ACCOUNT_NOT_FOUND': 5
}
```

**Response Body**

```json
{
    "message": "email verification successful.",
    "status": "success",
    "userData": {
        "email": "example@host.com",
        "name": "John",
        "active_project": null,
        "created_at": "2025-03-11T06:50:31.798Z",
        "updated_at": "2025-03-11T06:52:07.501Z"
    },
    "verificationStatus": 2
}
```

**Troubleshooting**

* `400 Bad Request`:  Bad request is only thrown if one of the scenarios occur:\
  \- `email` or `code` missing in request body.\
  \- `email` is invalid.\
  \- A verified account already exists with this email.
* `404 Not Found`: Is the email has not been registered for verification.
* `500 Internal Server Error`: For errors in email verification.

Last updated 17 hours ago
