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

# Trigger a Call

> Dial a phone number and connect it to an agent immediately.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. Use the [`/v1` version](/docs/api-reference/v1/calls/create) for new integrations. This endpoint remains available for existing integrations until then.
</Warning>

Initiates a single outbound call to the specified phone number using the given agent. The call starts as soon as the recipient answers.

## When to use this

Use this when you need to make a single, immediate call, for example when triggering a follow-up after a form submission, sending a verification call, or making a click-to-call request from your CRM.

## Destination validation

`phone_number` must be a valid international phone number in E.164 format (including the country code). For non-SIP routes, the destination country and prefix must also be enabled in **Workspace Settings > Telephony Config** before the call is created.

Invalid phone number formats return `400 Bad Request`. Unsupported countries, unsupported prefixes, and workspaces with no enabled destination countries return `403 Forbidden`.

## Dynamic variables

Pass a `metadata` object to inject context into the agent's prompt at call time. Reference these values in the prompt using `{{variable_name}}`:

```json theme={null}
{
  "phone_number": "+919876543210",
  "agent_id": "agt_abc123",
  "metadata": {
    "customer_name": "Priya Sharma",
    "appointment_time": "3pm on Friday",
    "product": "Home Loan"
  }
}
```

In your prompt, you can then write: *"Hi {{customer_name}}, calling to confirm your {{appointment_time}} appointment."*


## OpenAPI

````yaml POST /calls
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /calls:
    post:
      tags:
        - Calls
      summary: Create a single outbound call
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 


        Creates a new call log entry for single outbound call automation. The
        call will be processed by the scheduler and initiated when resources are
        available.
      operationId: CallsController_createCall
      parameters:
        - name: x-organization-id
          in: header
          description: RSA encrypted organization ID (base64 format)
          required: true
          schema:
            type: string
            example: BASE64_ENCRYPTED_ORG_ID_HERE
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallDto'
      responses:
        '201':
          description: Call created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCallResponseDto'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized
        '404':
          description: Not found - organization, agent, or phone number not found
        '500':
          description: Internal server error
      deprecated: true
components:
  schemas:
    CreateCallDto:
      type: object
      properties:
        phone_number:
          type: string
          example: '+911234567890'
          description: >-
            Phone number to call (must include country code). Format: +[country
            code][phone number]
        agent_id:
          type: string
          example: mgao6051Rk718Y
          description: >-
            Agent ID to use for the call. Must belong to the authenticated
            organization.
        agent_version_number:
          type: number
          example: 2
          description: >-
            Specific agent version number to use (optional). If provided, must
            be a published version. If not provided, will use the latest
            published version.
        metadata:
          type: object
          example:
            customer_name: John Doe
            customer_email: john@example.com
            priority: high
          description: >-
            Metadata for the call including customer information and any
            additional context. This data will be available during the call for
            personalization.
        notes:
          type: object
          example:
            customer_name: John Doe
            follow_up_required: true
            source: dashboard
          description: >-
            Optional notes stored on the call log. Must be a JSON object with at
            most 15 top-level keys.
      required:
        - phone_number
        - agent_id
        - metadata
    CreateCallResponseDto:
      type: object
      properties:
        id:
          type: string
          example: call_mfgsn90vwcozgb
          description: >-
            Unique call ID for tracking. Use this ID to reference the call in
            other API endpoints.
        to_phone_number:
          type: string
          example: '+911234567890'
          description: The phone number that will receive the call.
        agent_id:
          type: string
          example: agent_mfgsn90vwcozgb
          description: The ID of the agent used for this call.
        agent_version_number:
          type: number
          example: 2
          description: The version number of the agent used for this call.
      required:
        - id
        - to_phone_number
        - agent_id
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````