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

# Create Call

> Create Call.

### Authorizations

<ParamField header="X-Api-Key" type="string" required>
  Your Agni API key used to authenticate the request. Pass it in the `X-Api-Key` header. Find or rotate it from your Ravan AI account settings.
</ParamField>

***

### Body

<ParamField body="type" type="string" required>
  The call type to create. Use `web_call` for a browser-based call or `outbound_call` to place a phone call.
</ParamField>

<ParamField body="agent_id" type="string" required>
  The unique ID of the agent that should own, handle, or be assigned to this resource. Use the `id` returned by the Agent API.
</ParamField>

<ParamField body="from_phone_number" type="string" required>
  The caller ID used for outbound calls, in E.164 format. The number must be purchased, imported, or connected in Agni. Example: `+14157774444`.
</ParamField>

<ParamField body="to_phone_number" type="string" required>
  The destination phone number for an outbound call, in E.164 format. Example: `+12137774445`.
</ParamField>

<ParamField body="metadata" type="object">
  Custom key-value data to attach to the resource. Use this for IDs or attributes from your own systems.
</ParamField>

<ParamField body="prompt_dynamic_variables" type="object">
  Dynamic variables injected into the agent prompt for this call. Keys should match variables used in the prompt template.
</ParamField>

***

### Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="access_token" type="string">
  LiveKit access token.
</ResponseField>

<ResponseField name="room_id" type="string">
  Room ID for the created call session.
</ResponseField>

<ResponseField name="session_id" type="string">
  Call session UUID.
</ResponseField>

<ResponseField name="url" type="string">
  LiveKit WebSocket URL.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "access_token": "<string>",
    "message": "call created successfully",
    "room_id": "call_019eb7e0-075d-742b-91ea-94cddde0534a",
    "session_id": "019eb7e0-075d-742b-91ea-94cddde0534a",
    "success": true,
    "url": "<string>"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /api/v1/calling/create-call
openapi: 3.0.1
info:
  title: Agni API
  version: 1.0.0
  description: >-
    Agni API for managing agents, tools, widget settings, telephony, and
    integrations.
servers:
  - url: https://api.ravan.ai
security:
  - X-Api-Key: []
tags:
  - name: AgentService
  - name: AgentToolService
  - name: WidgetSettingsService
  - name: PhoneService
  - name: AppointmentService
  - name: GHLService
  - name: CalComService
  - name: CampaignService
  - name: ContactService
  - name: CallingService
  - name: RAGService
  - name: ModelService
  - name: HealthService
paths:
  /api/v1/calling/create-call:
    post:
      tags:
        - CallingService
      summary: Create Call
      operationId: CreateCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallRequest'
            example:
              type: outbound_call
              agent_id: <string>
              from_phone_number: <string>
              to_phone_number: <string>
              metadata: {}
              prompt_dynamic_variables: {}
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCallResponse'
              example:
                success: true
                message: call created successfully
                access_token: <string>
                room_id: call_019eb7e0-075d-742b-91ea-94cddde0534a
                session_id: 019eb7e0-075d-742b-91ea-94cddde0534a
                url: <string>
components:
  schemas:
    CreateCallRequest:
      type: object
      required:
        - type
        - agent_id
        - from_phone_number
        - to_phone_number
      properties:
        type:
          type: string
          enum:
            - web_call
            - outbound_call
          description: Call type
          example: outbound_call
        agent_id:
          type: string
          description: Agent UUID
          example: <string>
        from_phone_number:
          type: string
          description: Caller ID (for outbound)
          example: <string>
        to_phone_number:
          type: string
          description: Destination phone (for outbound)
          example: <string>
        metadata:
          type: object
          description: Custom key-value metadata
          example: {}
        prompt_dynamic_variables:
          type: object
          description: Variables for agent prompt
          example: {}
      example:
        type: outbound_call
        agent_id: <string>
        from_phone_number: <string>
        to_phone_number: <string>
        metadata: {}
        prompt_dynamic_variables: {}
    CreateCallResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        access_token:
          type: string
          description: LiveKit access token
        room_id:
          type: string
          description: Room ID for the created call session
        session_id:
          type: string
          description: Call session UUID
        url:
          type: string
          description: LiveKit WebSocket URL
      example:
        success: true
        message: call created successfully
        access_token: <string>
        room_id: call_019eb7e0-075d-742b-91ea-94cddde0534a
        session_id: 019eb7e0-075d-742b-91ea-94cddde0534a
        url: <string>
  securitySchemes:
    X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key

````