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

# Validates the OTP code and authenticates the user if the code is correct.



## OpenAPI

````yaml https://raw.githubusercontent.com/FooBarBizarre/docs/refs/heads/main/api-reference/openapi.json post /authentication/validate-otp
openapi: 3.0.1
info:
  title: Maia Backend API
  version: v1
servers: []
security: []
paths:
  /authentication/validate-otp:
    post:
      tags:
        - Authentication
      summary: >-
        Validates the OTP code and authenticates the user if the code is
        correct.
      requestBody:
        description: The request containing the OTP request ID, OTP code, and phone number.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateOtpRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/ValidateOtpRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ValidateOtpRequest'
      responses:
        '200':
          description: >-
            OTP validated successfully. Returns authentication token with portal
            information.
        '400':
          description: Invalid OTP code, or user has no associated portals.
components:
  schemas:
    ValidateOtpRequest:
      type: object
      properties:
        phoneNumber:
          type: string
          nullable: true
        requestId:
          type: string
          nullable: true
        otp:
          type: string
          nullable: true
      additionalProperties: false

````