# Create outbound call (legacy path)

> POST https://api.nabrah.ai/api/ext/make-call

Group: Calls. Page: https://www.nabrah.ai/en/docs/api-reference/calls/create-outbound-call-legacy-path

Legacy path kept for existing integrations. New integrations should use [Create outbound call](https://www.nabrah.ai/en/docs/api-reference/calls/create-outbound-call.md).

Backward-compatible alias of POST /api/ext/call/make-call — creates an outbound phone call with identical request and response shapes. Specify the handling agent (agent_id), the originating number (call_from), and a destination (call_to); the response returns call_ids. Prefer the canonical /api/ext/call/make-call for new integrations; this path exists only for compatibility with older clients.

## Alias notice

- **Equivalent to /api/ext/call/make-call**: Same behavior, same request body (CreateOutboundCallRequest), same response (call_ids). Use the canonical /api/ext/call/make-call path going forward.

## Request fields

- **agent_id**: UUID of the agent conducting the call. List agents with GET /api/ext/agent. Fields: `agent_id`.
- **call_from / call_to**: Originating number and destination number. call_to accepts a single number or a list of destinations (max 100) for batch dialing. Fields: `call_from`, `call_to`.
- **injected_data / variables / tags**: Optional context injected for single calls, prompt template variables, and labels used later for filtering in search/analytics/export. Fields: `injected_data`, `variables`, `tags`.

Response call_ids is always a list — one id per created call.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Body (application/json)

### Example: Single call

Place one outbound call to a single number.

```json
{
  "agent_id": "00000000-0000-4000-8000-000000000000",
  "call_from": "+966510000000",
  "call_to": "+966500000000"
}
```

### Example: With context

Outbound call with injected data, variables, and tags.

```json
{
  "agent_id": "00000000-0000-4000-8000-000000000000",
  "call_from": "+966510000000",
  "call_to": "+966500000000",
  "injected_data": "Customer: Ahmed, order #4821 ready for pickup",
  "variables": {
    "customer_name": "Ahmed",
    "order_id": "4821"
  },
  "tags": [
    "pickup-reminder"
  ]
}
```

## Response

### 200 Successful Response

Content type: `application/json`

```json
{
  "call_ids": [
    "00000000-0000-4000-8000-000000000000"
  ]
}
```

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request POST \
  --url 'https://api.nabrah.ai/api/ext/make-call' \
  --header 'X-API-Key: <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "agent_id": "00000000-0000-4000-8000-000000000000",
  "call_from": "+966510000000",
  "call_to": "+966500000000"
}'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/make-call"
headers = {
    "X-API-Key": "<your-api-key>",
}
payload = {
    "agent_id": "00000000-0000-4000-8000-000000000000",
    "call_from": "+966510000000",
    "call_to": "+966500000000"
}

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/make-call", {
  method: "POST",
  headers: {
    "X-API-Key": "<your-api-key>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "agent_id": "00000000-0000-4000-8000-000000000000",
    "call_from": "+966510000000",
    "call_to": "+966500000000"
  }),
});

const data = await response.json();
console.log(data);
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	payload := strings.NewReader(`{
  "agent_id": "00000000-0000-4000-8000-000000000000",
  "call_from": "+966510000000",
  "call_to": "+966500000000"
}`)

	req, _ := http.NewRequest("POST", "https://api.nabrah.ai/api/ext/make-call", payload)
	req.Header.Set("X-API-Key", "<your-api-key>")
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
