Verify Email

This section provides instructions on using /auth/verify-email endpoint to use for verifying user after signup.

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": "[email protected]",
    "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:

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

{
    "message": "email verification successful.",
    "status": "success",
    "userData": {
        "email": "[email protected]",
        "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

Last updated