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

# Trigger Test Call

> Initiate a test phone call using this agent to verify its configuration before going live. The call behaves exactly like a production call.



## OpenAPI

````yaml /api-reference/openapi.json post /agents/{agent_id}/test-call
openapi: 3.1.0
info:
  title: Truedy API
  description: >-
    Truedy Public API - Build voice AI agents and make automated phone calls.


    ## Authentication

    All requests require **Authorization: Bearer <your_api_key>**.

    Get your API key from the [Truedy Dashboard](https://app.truedy.ai).


    ## Response Format

    All successful responses follow this format:

    ```json

    {
      "data": { /* resource or list of resources */ },
      "meta": {
        "request_id": "req_xxx",
        "ts": "2026-03-03T20:30:21.310278Z"
      },
      "pagination": { /* optional, for list endpoints */ }
    }

    ```


    ## Error Handling

    Errors return appropriate HTTP status codes with structured error messages.
    Always check the `error` field in the response body for details.
  version: 1.0.0
servers:
  - url: https://api.truedy.ai/api/public/v1
    description: Truedy Public API
security:
  - BearerAuth: []
paths:
  /agents/{agent_id}/test-call:
    post:
      tags:
        - Agents
      summary: Trigger Test Call
      description: >-
        Initiate a test phone call using this agent to verify its configuration
        before going live. The call behaves exactly like a production call.
      operationId: test_agent_call
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
          description: Agent ID
          example: agt_f9447372
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
              properties:
                to:
                  type: string
                  description: Destination phone number in E.164 format
                  example: '+12125551234'
                from_number:
                  description: Caller ID (E.164). Must be a phone number you own in Truedy.
                  example: '+18005559876'
                  type:
                    - string
                    - 'null'
            example:
              to: '+12125551234'
              from_number: '+18005559876'
      responses:
        '201':
          description: Test call initiated
          content:
            application/json:
              example:
                data:
                  call_id: call_a1b2c3d4
                  status: initiated
                  to: '+12125551234'
                  agent_id: agt_f9447372
                meta:
                  request_id: req_32e7531c
                  ts: '2026-04-05T10:22:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                error:
                  code: bad_request
                  message: Invalid request parameters
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Invalid or missing API key
                  details:
                    reason: 'Include Authorization: Bearer <your_api_key>'
        '404':
          description: Not Found
          content:
            application/json:
              example:
                error:
                  code: not_found
                  message: Call not found
        '422':
          description: Validation Error
          content:
            application/json:
              example:
                detail:
                  - loc:
                      - body
                      - name
                    msg: field required
                    type: value_error.missing
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests
                  details:
                    reset_at: '2026-04-01T21:00:00Z'
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                error:
                  code: internal_error
                  message: An unexpected error occurred
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Include your API key in the Authorization
        header: Bearer <your_api_key>

````