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

# Verify By Voice

> Verify whether the reference audio and the real-time audio match.

This endpoint compares two voice samples:
- `registered_audio`: Reference audio
- `query_audio`: Real-time audio recorded by your application




## OpenAPI

````yaml post /verify-by-voice
openapi: 3.1.0
info:
  title: Authentica API Documentation
  version: 2.0.0
  description: >
    Authentica provides secure and flexible customer authentication through
    **OTP verification** via **SMS**, **WhatsApp**, and **Email**.

    It also supports **Face** and **Voice** verification for enhanced identity
    assurance.


    You can easily integrate with our system using RESTful APIs and manage your
    authentication process through multiple secure and customizable channels.


    Our system provides many templates to send OTP messages via SMS channel
    using Authentica default sender name.


    Our APIs are designed for easy integration, offering clear endpoints to help
    you implement robust authentication solutions in your applications.


    ## Getting Started


    1. Sign up for an Authentica account at
    [https://portal.authentica.sa](https://portal.authentica.sa)

    2. [Get Your API Key](https://portal.authentica.sa/applications/)

    3. Use your API key in the `X-Authorization` header for all requests


    ## Workflows


    ### OTP Verification Workflow


    1. **Send OTP** - Use the `/send-otp` endpoint to send an OTP via SMS,
    WhatsApp, or Email

    2. **Verify OTP** - Use the `/verify-otp` endpoint to validate the OTP
    entered by your customer


    ### Face Verification Workflow


    Use the `/verify-by-face` endpoint to compare two images: a reference image
    and a real-time image captured by your application.


    ### Voice Verification Workflow


    Use the `/verify-by-voice` endpoint to compare two audio samples: a
    reference audio and a real-time audio recorded by your application.
  contact:
    name: Authentica Support
    url: https://wa.me/966536553944
servers:
  - url: https://api.authentica.sa/api/v2
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Balance Monitoring
    description: Monitor your account balance and credits
  - name: OTP Verification
    description: Send and verify one-time passwords via SMS, WhatsApp, or Email
  - name: Face Verification
    description: Verify users through facial recognition
  - name: Voice Verification
    description: Verify users through voice biometrics
paths:
  /verify-by-voice:
    post:
      tags:
        - Voice Verification
      summary: Verify By Voice
      description: |
        Verify whether the reference audio and the real-time audio match.

        This endpoint compares two voice samples:
        - `registered_audio`: Reference audio
        - `query_audio`: Real-time audio recorded by your application
      operationId: verifyByVoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
                - registered_audio
                - query_audio
              properties:
                user_id:
                  type: string
                  description: Unique identifier of your user
                  example: user123
                registered_audio:
                  type: string
                  format: byte
                  description: Base64-encoded reference audio
                  example: SUQzBAAAAAAAIVRYWFgAAAA...
                query_audio:
                  type: string
                  format: byte
                  description: Base64-encoded real-time audio recorded by your application
                  example: SUQzBAAAAAAAIVRYWFgAAAA...
            examples:
              verify_voice:
                summary: Verify voice samples
                value:
                  user_id: user123
                  registered_audio: SUQzBAAAAAAAIVRYWFgAAAA...
                  query_audio: SUQzBAAAAAAAIVRYWFgAAAA...
      responses:
        '200':
          description: Voice verification completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      user_id:
                        type: string
                        example: user123
                      result:
                        type: boolean
                        description: >-
                          Verification result - true if voices match, false
                          otherwise
                        example: true
              examples:
                match:
                  summary: Voices match
                  value:
                    success: true
                    data:
                      user_id: user123
                      result: true
                no_match:
                  summary: Voices don't match
                  value:
                    success: true
                    data:
                      user_id: user123
                      result: false
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
                example: Unauthorized
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization
      description: >
        API key for authentication. [Get Your API
        Key](https://portal.authentica.sa/applications/)

````