# 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


---

# Agent Instructions: 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:

```
GET https://docs.talkstack.ai/authentication/verify-email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
