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

# Dial outbound (Twilio or SIP trunk)

> Call a phone number with this agent. Provide `number` or `destination` (same meaning). Optionally use a SIP trunk, override the opening message or prompt, pass variables in the request body, and set `callbackUrl` to receive status webhooks.



## OpenAPI

````yaml post /v1/agents/{id}/dial
openapi: 3.0.3
info:
  title: Vatel AI REST API
  description: >-
    Programmatic access for agents, documents, telephony, and session tokens.
    Send `Authorization: Bearer <organization API key>` on all requests unless
    noted. Most error responses return JSON with an `error` string message.
  version: 0.2.6
servers:
  - url: https://api.vatel.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: organization
    description: Organization tied to your API key
  - name: llms
    description: LLM model identifiers
  - name: voices
    description: TTS voice catalog
  - name: agents
    description: Agents, outbound dial, agent versions, and graph versions
  - name: twilio
    description: Imported Twilio phone numbers
  - name: sip-trunks
    description: SIP trunk configuration
  - name: session
    description: Session tokens and voice WebSocket connections.
  - name: documents
    description: Organization knowledge documents and indexed chunks
  - name: calls
    description: Call history, recordings, and live eavesdrop for your organization
  - name: usage-logs
    description: Per-request usage rows for calls and chats
  - name: eavesdrop
    description: Listen to live calls and send supervisor commands over WebSocket.
paths:
  /v1/agents/{id}/dial:
    post:
      tags:
        - agents
      summary: Place an outbound call
      description: >-
        Call a phone number with this agent. Provide `number` or `destination`
        (same meaning). Optionally use a SIP trunk, override the opening message
        or prompt, pass variables in the request body, and set `callbackUrl` to
        receive status webhooks.
      operationId: dialAgent
      parameters:
        - name: id
          in: path
          required: true
          description: Agent id
          schema:
            type: string
            format: uuid
        - name: number
          in: query
          required: false
          description: Phone number to call. Same as `destination`.
          schema:
            type: string
        - name: destination
          in: query
          required: false
          description: Phone number to call. Same as `number`.
          schema:
            type: string
        - name: sipTrunkId
          in: query
          required: false
          description: SIP trunk to use for this call.
          schema:
            type: string
            format: uuid
        - name: sipTrunkAgentId
          in: query
          required: false
          description: >-
            SIP trunk assignment for this agent. When set, the trunk is taken
            from that assignment.
          schema:
            type: string
            format: uuid
        - name: outboundContactId
          in: query
          required: false
          description: Outbound contact this call belongs to.
          schema:
            type: string
            format: uuid
        - name: outboundListRunId
          in: query
          required: false
          description: Outbound list run this call belongs to.
          schema:
            type: string
            format: uuid
        - name: callerId
          in: query
          required: false
          description: Caller ID to show the callee when using a SIP trunk.
          schema:
            type: string
        - name: firstMessage
          in: query
          required: false
          description: Override the agent's first message for this call.
          schema:
            type: string
        - name: prompt
          in: query
          required: false
          description: Override the agent's system prompt for this call.
          schema:
            type: string
        - name: sse
          in: query
          required: false
          description: >-
            When true, respond with a Server-Sent Events stream instead of JSON.
            The first event is `call_id`. Later events are call status. The
            stream ends when the call is answered, or when dialing fails.
            Defaults to false.
          schema:
            type: boolean
            default: false
        - name: callbackUrl
          in: query
          required: false
          description: >-
            Absolute public http or https URL. Private, loopback, and link-local
            addresses are rejected. When set, each call status is POSTed here,
            in order, as JSON `{ "callId", "event" }`. Event is initiated,
            ringing, or answered. A call that is not answered ends with busy,
            no-answer, failed, canceled, or completed. Delivery is best-effort
            and does not change this response. Can be combined with `sse`.
          schema:
            type: string
            format: uri
      requestBody:
        required: false
        description: Optional. Pass `variables` for data the agent can use on this call.
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                variables:
                  type: array
                  description: Custom data for the agent on this call.
                  items:
                    $ref: '#/components/schemas/SessionTokenVariable'
      responses:
        '200':
          description: >-
            Outbound call accepted. JSON by default, including `callId`. With
            sse=true, a text/event-stream. The first event is `call_id`; later
            events are call status until the call is answered or dialing fails.
            When callbackUrl is set, each of those statuses is also POSTed to
            that URL as DialStatusCallback.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DialAgentResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  The first event is `event: call_id` and `data: <call id>`.
                  Each later event is `event: <status>` and `data: <status>`.
                  Status is initiated, ringing, or answered. A call that is not
                  answered ends with busy, no-answer, failed, canceled, or
                  completed.
        '400':
          description: >-
            Invalid request — check the phone number, parameters, and agent
            configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing Bearer token or invalid organization API key for this agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: This agent cannot use the requested SIP trunk.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent, inactive agent, phone number record, or SIP trunk not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server or telephony error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Media or SIP credentials required for the trunk dial path are not
            configured on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SessionTokenVariable:
      type: object
      additionalProperties: false
      required:
        - key
        - value
      properties:
        key:
          type: string
          description: Variable name.
        value:
          description: Variable value (string, boolean, or number).
          oneOf:
            - type: string
            - type: boolean
            - type: number
        dataType:
          type: string
          enum:
            - string
            - number
            - boolean
          readOnly: true
          description: >-
            Value type (`string`, `number`, or `boolean`). Returned in
            responses; omit when sending variables.
    DialAgentResponse:
      type: object
      description: Result of the dial request.
      required:
        - success
      properties:
        success:
          type: boolean
          description: Whether the call was accepted.
        callId:
          type: string
          description: >-
            Id of the outbound call. Present when the dial was accepted. The
            calls row may be written after this response.
    ErrorResponse:
      type: object
      description: Standard error body for most non-2xx JSON responses on this API.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message; may include validation detail.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Send your organization API key as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.