Sign inGet Started

Create a voice call with the API

Use POST /v1/voice/calls to call a phone number and start a published sequence when the recipient answers. The request places a real call; normal calling charges apply.

Before you start

Prepare these resources in the same workspace:
  • An enabled, unarchived sequence with an active publication.
  • Its sequence ID and the Voice call entry ID. Open the sequence's API connection guidance to copy the request for that entry.
  • An API key with both voice_management:write and voice:write permissions.
  • A calling number the workspace may present, such as an owned or verified caller ID, and an enabled destination country.
  • A recipient you control for the first call.
Create Call selects the active publication in production mode. For a saved-draft test, use the dashboard's Place a call controls. Inline definitions, historical version selection, and draft/test selectors are not accepted by Create Call.

Send the request

Set BIRD_API_KEY to your key and BIRD_API_URL to its regional base URL, such as https://eu1.platform.bird.com for an eu1 key.
Save the request as call.json, replacing the example numbers, sequence ID, and entry ID with your values:
कोड उदाहरण
{
  "from": "+12025550100",
  "to": "+12025550101",
  "sequence": {
    "id": "YOUR_SEQUENCE_ID",
    "entry_node_id": "YOUR_ENTRY_NODE_ID",
    "trigger_data": {}
  }
}
trigger_data is a required object matching the entry's data schema. Use {} when the entry accepts empty data, or supply its declared fields. The Create Call reference documents request limits and the optional ringing timeout.
Send the request:
कोड उदाहरण
curl --request POST "$BIRD_API_URL/v1/voice/calls" \
  --header "Authorization: Bearer $BIRD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-binary @call.json
A 202 Accepted response confirms admission. The sequence begins after the recipient answers. Publishing a newer version after acceptance does not change this call's selected definition or entry data.

Read the acceptance result

Retain the response's id, initial_leg_id, and sequence.run_id for correlation. The top-level id identifies the call across its legs; initial_leg_id identifies its first leg.
The response is an immutable acceptance snapshot. Its started_at and ended_at are null, observation booleans are false, and parties is empty. These fields describe acceptance, so they do not become a live status report when you replay the request.
Open the sequence's Runs to inspect progress. Once a leg record exists, use GET /v1/voice/legs/{leg_id} with initial_leg_id, or inspect the call log. Reading legs requires voice:read permission.
Acceptance does not guarantee dialing, an answer, or a readable call record. A call that fails before registration may appear in run history without a leg record. An answered call also does not establish that the sequence completed its intended business task.

Handle errors and retries

Idempotency is optional. Without a key, each request accepts a new call attempt. The SDKs generate a key for automatic retries. To protect retries across separate calls or direct HTTP requests, supply a key on the first attempt and reuse it with the exact original request bytes. See the idempotency guide.
An identical replay within three hours returns the original acceptance and Idempotency-Replay: true. Changed input with that key returns 409. Authorization and calling-number permission are checked again on replay. After the replay window, the key can admit a new call, so reconcile the original result before resubmitting.
SymptomWhat to check
400 or 422Read the error's field details. Check number format, calling-number eligibility and ownership, sequence and entry IDs, explicit data object, and request limits.
401 or 403Check the API key, both required write permissions, and workspace access.
404Check the sequence belongs to the key's workspace and that call creation is available on the regional service.
409Check for a changed-body retry or an unavailable active production sequence. Publish or resume as needed before beginning a new call.
429Respect the response's retry guidance. If you supplied a key, reuse it for the same call attempt.
Accepted, then failedInspect the run and any leg record for destination, limits, balance, or runtime failures before deciding to place another call.

Next steps

संबंधित संसाधन

इस विषय के लिए डॉक्यूमेंटेशन, गाइड और उदाहरणों के साथ आगे बढ़ें। संसाधन अंग्रेज़ी में हैं।