# Dispatch call (/docs/api-reference/calls/dispatchCall)

> Initiate a call to a phone number using a specified agent. The
phone number must include a country code with a leading plus.




**POST** `/calls/dispatch`

Initiate a call to a phone number using a specified agent. The
phone number must include a country code with a leading plus.

```yaml
operationId: dispatchCall
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - agent_id
          - to_number
        properties:
          agent_id:
            type: integer
            description: The ID of the agent that will handle the call.
            example: 158910
          to_number:
            type: string
            description: The phone number to call. Must include country code (e.g., +15551234567).
            example: '+15551234567'
          from_number_id:
            type: integer
            description: The imported phone number id to call.
            example: 23
          call_context:
            type: object
            description: >-
              Optional context information as key-value pairs to be passed to the agent during the
              call. Can contain any custom fields relevant to your use case.
            additionalProperties: true
            example:
              user_name: Jane Doe
              account_id: A-2031
              last_order: '2026-04-15'
        example:
          agent_id: 158910
          to_number: '+15551234567'
          from_number_id: 23
          call_context:
            user_name: Jane Doe
            account_id: A-2031
            last_order: '2026-04-15'
responses:
  '200':
    description: Call dispatched.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            status:
              type: string
              description: >-
                Dispatch state on the platform side. `dispatched` means the call has been queued for
                the dialer.
              example: dispatched
            requestId:
              type: integer
              description: >-
                Internal call request id. Use it to correlate with `call_request_id` on
                `/calls/logs`.
              example: 3166940
            custom_variables_count:
              type: integer
              description: Number of keys the platform extracted from `call_context`.
        example:
          success: true
          status: dispatched
          requestId: 3166940
          custom_variables_count: 1
```

**Python SDK**

```python
# Dispatch a call to a specific number using an agent
agent_id = 123  # Replace with your agent ID
to_number = "+15551234567"  # Must include country code
from_number_id = 23 # get the from number id from phone number API. /api/v1/phone_number/list
call_context = {
    "customer_name": "John Doe",
    "account_id": "ACC-12345",
    "priority": "high"
}

response = client.call.dispatch_call(agent_id, to_number, call_context=call_context)
print(response)
```

**curl**

```bash
curl -X POST "https://backend.omnidim.io/api/v1/calls/dispatch" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": 158910,
  "to_number": "+15551234567",
  "from_number_id": 23,
  "call_context": {
    "user_name": "Jane Doe",
    "account_id": "A-2031",
    "last_order": "2026-04-15"
  }
}'
```
