Skip to main content

Call Requests API

Use the Call Requests API to place a single outbound call outside a campaign's normal schedule, or to bulk-queue a batch of ad-hoc calls. A click-to-call button in a CRM is a typical use case.

The examples below assume the BASE_URL and HEADERS client from API authentication. Creating call requests requires an Editor role. Contact, Call Campaign, Flow, Call Router, and Caller ID IDs are opaque values; copy them from DialerAI rather than constructing them.

Two ways to place a call​

Every call request is created against exactly one of:

  • call_campaign_id: the call runs the Flow attached to that campaign, follows the campaign's retry, do-not-call, and contact-list rules, and counts toward the campaign's reporting. The contact must belong to one of the campaign's contact lists.
  • flow_id: the call runs that Flow directly, with no campaign involved. There is no retry handling, no campaign counters, and no contact-list restriction, so this is the path for a one-off call.

Providing both, or neither, is rejected with a validation error.

call_router_id is optional either way. Against a campaign it defaults to the organization's first Call Router. Against a Flow it defaults to the Flow's own Call Router if one is configured, otherwise the organization's first Call Router.

callerid_id names the Caller ID the call is placed from. It must be an authorized Caller ID of your organization. Against a campaign it is optional, and when given it overrides the campaign's Caller ID and Caller ID Group for that call. Against a Flow it is required, since there is no campaign to take a Caller ID from.

Create against a Call Campaign​

payload = {
"contact_id": "ct_GJXQ063CGZ5OY",
"call_campaign_id": "callcp_H4O6nAfjag",
"priority": 1,
"call_date": "2025-11-01T10:00:00Z",
# "callerid_id": "cid_R7VQ0KMD3A", # optional, overrides the campaign's Caller ID
}
response = requests.post(f"{BASE_URL}/call-request/create", json=payload, headers=HEADERS)
response.raise_for_status()
call_request_id = response.json()["id"]

The contact must belong to one of the contact lists associated with call_campaign_id, or the request is rejected.

Create against a Flow (no campaign)​

payload = {
"contact_id": "ct_GJXQ063CGZ5OY",
"flow_id": "flow_NYB01UDCGO",
"callerid_id": "cid_R7VQ0KMD3A",
"priority": 1,
"call_date": "2025-11-01T10:00:00Z",
}
response = requests.post(f"{BASE_URL}/call-request/create", json=payload, headers=HEADERS)
response.raise_for_status()
call_request_id = response.json()["id"]

A campaign-backed request is picked up by the call dispatcher right away. A Flow-only request (no campaign) is instead picked up by a periodic task that runs about every 15 seconds and still respects the organization's authorized calling window, so expect a short delay before the call goes out.

Bulk create​

Both paths are also available on /call-request/bulk-create, up to 50 requests per call. Set call_campaign_id or flow_id once at the top level, not per item. The same goes for callerid_id: one Caller ID for the whole batch, required with flow_id:

payload = {
"contact_list_id": "ctl_example",
"flow_id": "flow_NYB01UDCGO",
"callerid_id": "cid_R7VQ0KMD3A",
"requests": [
{"contact_id": "ct_GJXQ063CGZ5OY", "priority": 1, "call_date": "2025-11-01T10:00:00Z"},
{"contact_id": "ct_A1B2C3D4E56F", "priority": 2, "call_date": "2025-11-01T11:00:00Z"},
],
}
response = requests.post(f"{BASE_URL}/call-request/bulk-create", json=payload, headers=HEADERS)
response.raise_for_status()
created = response.json()["call_requests"]

contact_list_id is required either way, since it is used to validate the contacts. With call_campaign_id, that list must also be one of the contact lists associated with the campaign; with flow_id, any contact belonging to the list is accepted.

List call requests​

Filter by campaign or by Flow:

by_campaign = requests.get(f"{BASE_URL}/call-request/list", params={"call-campaign-id": "callcp_H4O6nAfjag"}, headers=HEADERS)
by_flow = requests.get(f"{BASE_URL}/call-request/list", params={"flow-id": "flow_NYB01UDCGO"}, headers=HEADERS)

GET /call-request/get/{id} retrieves a single call request. In the response, call_campaign and flow_id are mutually exclusive: whichever path was not used comes back null. callerid_id carries the Caller ID stored on the request, or null when a campaign request left it to the campaign.

Error responses​

The API returns a validation error when a request gives neither or both of call_campaign_id and flow_id, when a flow_id or call_campaign_id does not resolve to an object the caller's organization owns, when a Flow path omits callerid_id or names a Caller ID that is not an authorized one of the organization, or when a campaign path's contact does not belong to one of the campaign's contact lists. Check the response body's detail for the specific message before retrying.