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

# Create Outbound Call

> Initiate an outbound phone call from a configured pool number to a target number

Creates an outbound call request. The call is queued and dispatched by the outbound scheduler; this endpoint returns as soon as the request is accepted, not when the call is connected.

The agent used for the call is automatically resolved from the project — there is no agent selector. Each project corresponds to one agent.

## Request

```bash theme={null}
POST https://api.pathors.com/v1/calls/outbound
```

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token using your developer key (`dk_...`).
</ParamField>

### Body

<ParamField body="projectId" type="string" required>
  The project that will own this call. The authenticated user must be a member of this project.
</ParamField>

<ParamField body="fromNumber" type="string" required>
  The source phone number. Must be `active` in a number pool that the authenticated user is a member of, and must have an outbound trunk configured.
</ParamField>

<ParamField body="toNumber" type="string" required>
  The destination phone number, in E.164 format (e.g. `+886912345678`).
</ParamField>

<ParamField body="dynamicVariables" type="object">
  Optional key-value map injected into the agent session as runtime variables. Values can be referenced from your pathway and prompts.
</ParamField>

### Example

```bash theme={null}
curl -X POST https://api.pathors.com/v1/calls/outbound \
  -H "Authorization: Bearer dk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "proj_abc123",
    "fromNumber": "+886912345678",
    "toNumber": "+886987654321",
    "dynamicVariables": {
      "customerName": "Jane Doe",
      "orderId": "12345"
    }
  }'
```

## Response

Returns `200 OK` once the call request is accepted into the dispatch queue.

```json theme={null}
{
  "success": true
}
```

## Errors

| Status | When                                                                                                            |
| ------ | --------------------------------------------------------------------------------------------------------------- |
| 400    | Validation error, or `fromNumber` exists but is not `active`                                                    |
| 401    | Missing or invalid developer key                                                                                |
| 402    | Project has insufficient credits to start an outbound call                                                      |
| 403    | The user has no access to `projectId`, or `fromNumber` does not belong to a number pool the user is a member of |
| 404    | `fromNumber` is not found, or has no outbound trunk configured                                                  |
| 409    | An outbound call to this `toNumber` is already in flight                                                        |
| 500    | Internal server error                                                                                           |

## Notes

* **Agent**: The agent is resolved from `projectId` automatically. The configured agent for that project will handle the call.
* **From-number ownership**: The caller (developer key user) must be a member of the number pool that owns `fromNumber`. Project membership is checked separately for `projectId`.
* **Variables**: `dynamicVariables` are stringified into the LiveKit room metadata and made available to the agent for the duration of the session.
* **Concurrency**: The same `toNumber` cannot have more than one in-flight outbound call at a time. Wait for the previous call to complete before retrying.
