> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.voicebip.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.voicebip.com/_mcp/server.

# Initiate an outbound call

POST https://api.voicebip.com/v1/calls
Content-Type: application/json

Starts an outbound call. Returns `201` with the `Call` object.

The `status` field tells you which path served the request:

* `initiated` — the call was dialed synchronously (default).
* `queued` — outbound calls are paced through the carrier-safe
  priority lane (the platform stays within per-carrier rate limits);
  the call dials as soon as the carrier has headroom. The response is
  immediate; you learn the live outcome from the `call.*` webhooks you
  already receive (`call.initiated`, `call.completed`, …).

Either way the response shape is identical and the returned `call_id`
is immediately queryable via `GET /v1/calls/{call_id}`. A `queued` call
carries no `mno`/`started_at` yet — those land once it dials.

Reference: https://docs.voicebip.com/api/calls/initiate-call

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.voicebip.com` (Production, default)
- `https://sandbox.voicebip.com` (Sandbox)

## Request

### Body (application/json)

This endpoint expects an object.

- `agent_id` (string, required)
- `from_number` (string, required)
- `to_number` (string, required)
- `webhook_url` (string, optional)

## Response

### 200

Call accepted. `status` is `initiated` (dialed synchronously) or `queued` (accepted onto the paced priority lane; dials when the carrier has headroom — outcome via `call.*` webhooks).

- `call_id` (string, optional)
- `agent_id` (string, optional)
- `from_number` (string, optional)
- `to_number` (string, optional)
- `direction` (enum, optional)
  - Allowed values: `inbound`, `outbound`
- `status` (enum, optional)
  - Allowed values: `queued`, `initiated`, `ringing`, `in_progress`, `completed`, `failed`, `no_answer`, `busy`
- `mno` (string, optional)
- `quality_mos` (double, optional) — Mean Opinion Score (1.0-5.0) for voice quality. Estimated from RTP statistics (jitter, packet loss, RTT). Null if call did not complete.
- `resolution` (enum, optional) — AI-classified call outcome. Null if not yet classified.
  - Allowed values: `resolved`, `unresolved`
- `classified_at` (datetime, optional) — Timestamp when the call outcome was classified by AI.
- `recording_url` (string, optional) — URL to download the call recording (audio/wav). Null if recording was not enabled or the caller opted out.
- `started_at` (datetime, optional)
- `ended_at` (datetime, optional) — Timestamp when the call ended. Omitted while the call is in progress.
- `duration_seconds` (integer, optional) — Call duration in seconds. Omitted while the call is in progress (or for a 0-second call).
- `cost_minor` (long, optional) — Per-call charge in minor currency units (e.g. kobo). Omitted until the call is billed; a present 0 means no charge.
- `currency` (string, optional) — ISO 4217 currency code paired with cost_minor (e.g. NGN). Omitted when there is no cost.

## Examples

**Request**

```json
{
  "agent_id": "agent_id",
  "from_number": "from_number",
  "to_number": "to_number"
}
```

**Response**

```json
{
  "call_id": "call_id",
  "agent_id": "agent_id",
  "from_number": "from_number",
  "to_number": "to_number",
  "direction": "inbound",
  "status": "queued",
  "mno": "mno",
  "quality_mos": 1.1,
  "resolution": "resolved",
  "classified_at": "2024-01-15T09:30:00Z",
  "recording_url": "recording_url",
  "started_at": "2024-01-15T09:30:00Z",
  "ended_at": "2024-01-15T09:30:00Z",
  "duration_seconds": 1,
  "cost_minor": 1000000,
  "currency": "currency"
}
```

**SDK Code**

```python
import requests

url = "https://api.voicebip.com/v1/calls"

payload = {
    "agent_id": "agent_id",
    "from_number": "from_number",
    "to_number": "to_number"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.voicebip.com/v1/calls';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"agent_id":"agent_id","from_number":"from_number","to_number":"to_number"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.voicebip.com/v1/calls"

	payload := strings.NewReader("{\n  \"agent_id\": \"agent_id\",\n  \"from_number\": \"from_number\",\n  \"to_number\": \"to_number\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.voicebip.com/v1/calls")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agent_id\": \"agent_id\",\n  \"from_number\": \"from_number\",\n  \"to_number\": \"to_number\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voicebip.com/v1/calls")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agent_id\": \"agent_id\",\n  \"from_number\": \"from_number\",\n  \"to_number\": \"to_number\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voicebip.com/v1/calls', [
  'body' => '{
  "agent_id": "agent_id",
  "from_number": "from_number",
  "to_number": "to_number"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.voicebip.com/v1/calls");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agent_id\": \"agent_id\",\n  \"from_number\": \"from_number\",\n  \"to_number\": \"to_number\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "agent_id": "agent_id",
  "from_number": "from_number",
  "to_number": "to_number"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voicebip.com/v1/calls")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```