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

# Test API Tool Configuration

> Validates API connectivity with retry logic and streams real-time test results via Server-Sent Events.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/voice-agents/web-tool/test-api-tool
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v1/voice-agents/web-tool/test-api-tool:
    post:
      summary: Test API Tool connectivity and validate configuration.
      description: >-
        Validates API connectivity with retry logic and streams real-time test
        results via Server-Sent Events.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestApiToolRequest'
      responses:
        '200':
          description: Server-Sent Events stream with test results
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/TestApiToolResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TestApiToolRequest:
      type: object
      properties:
        projectId:
          type: string
          format: uuid
          description: UUID of the project.
          example: d949f13f-40d2-4e48-ac86-b66633070603
        apiKey:
          type: string
          format: uuid
          description: API key UUID (optional).
          example: d949f13f-40d2-4e48-ac86-b66633070603
        userId:
          type: string
          format: uuid
          description: UUID of the user (optional).
          example: d949f13f-40d2-4e48-ac86-b66633070603
        serverUrl:
          type: string
          format: uri
          description: The API endpoint URL to test. Must be a valid external URL.
          example: https://api.example.com/endpoint
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          description: HTTP method to use for the API call.
          example: POST
        authPrefix:
          type: string
          description: Authorization header prefix (e.g., 'Bearer', 'Basic').
          example: Bearer
        authToken:
          type: string
          description: Authentication token to include in the request.
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        timeout:
          type: number
          minimum: 1
          maximum: 15
          default: 5
          description: Request timeout in seconds (1-15 seconds).
          example: 5
        httpHeaders:
          type: object
          additionalProperties:
            type: string
          description: Custom HTTP headers to include in the request.
          example:
            Content-Type: application/json
            X-Custom-Header: value
        queryParams:
          type: object
          additionalProperties:
            type: string
          description: Query parameters to append to the URL.
          example:
            filter: active
            limit: '10'
        body:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
            - type: array
          nullable: true
          description: >-
            Request body (max 10MB). Can be string, number, boolean, object,
            array, or null.
          example:
            name: Test
            value: 123
      required:
        - projectId
        - serverUrl
        - method
    TestApiToolResponse:
      type: object
      description: >-
        Server-Sent Events stream containing test results. Events include:
        'connected', 'attempt', 'complete', and 'error'.
      properties:
        event:
          type: string
          enum:
            - connected
            - attempt
            - complete
            - error
          description: Type of SSE event.
          example: attempt
        data:
          oneOf:
            - $ref: '#/components/schemas/TestApiToolConnectedEvent'
            - $ref: '#/components/schemas/TestApiToolAttemptEvent'
            - $ref: '#/components/schemas/TestApiToolCompleteEvent'
            - $ref: '#/components/schemas/TestApiToolErrorEvent'
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    TestApiToolConnectedEvent:
      type: object
      properties:
        message:
          type: string
          example: Starting API test...
    TestApiToolAttemptEvent:
      type: object
      properties:
        attempt:
          type: number
          description: The attempt number.
          example: 1
        success:
          type: boolean
          description: Whether this attempt was successful.
          example: true
        statusCode:
          type: number
          description: HTTP status code received.
          example: 200
        data:
          description: Response data from the API call.
          example:
            result: success
        headers:
          type: object
          description: Response headers received.
          example:
            content-type: application/json
        error:
          type: string
          description: Error message if the attempt failed.
          example: null
        responseTime:
          type: number
          description: Response time in milliseconds.
          example: 245
    TestApiToolCompleteEvent:
      type: object
      properties:
        message:
          type: string
          example: API test completed
        result:
          $ref: '#/components/schemas/TestApiToolAttemptEvent'
    TestApiToolErrorEvent:
      type: object
      properties:
        message:
          type: string
          example: An error occurred during testing
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````