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

# Verify OTP

> Verify OTP to complete user login



## OpenAPI

````yaml POST /auth/verify
openapi: 3.0.1
info:
  title: User Authentication API
  version: 1.0.0
  description: API for user registration, OTP request, and OTP verification
servers:
  - url: https://our-secret-api-url.com
security: []
paths:
  /auth/verify:
    post:
      description: Verify OTP to complete user login
      parameters:
        - $ref: '#/components/parameters/X-API-KEY'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserVerificationRequest'
      responses:
        '200':
          description: OTP code successfully verified and session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
        '400':
          description: Bad Request - Wrong OTP code or code has expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity - Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    X-API-KEY:
      name: X-API-KEY
      description: API key required for authentication
      in: header
      required: true
      schema:
        type: string
  schemas:
    UserVerificationRequest:
      type: object
      properties:
        code:
          type: string
          description: OTP code
        userId:
          type: integer
          description: User ID
        isPhone:
          type: boolean
          description: Indicates if the code is for phone verification
      required:
        - code
        - userId
        - isPhone
    SessionResponse:
      type: object
      properties:
        id:
          type: string
          description: Session ID (token)
        expiresAt:
          type: string
          format: date-time
          description: Session expiration time
        fresh:
          type: boolean
          description: Indicates if the session is fresh
        userId:
          type: integer
          description: User ID
      required:
        - id
        - expiresAt
        - fresh
        - userId
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: Path of the error
              message:
                type: string
                description: Error message

````