Callifly API — Developer documentation
Callifly
Sign in
REST API

Callifly API

Read your assistant's calls and conversations, and trigger AI calls, SMS and multi-step outreach from your own systems. One key, one assistant.

Base URL https://api.callifly.com/client

Getting started

Quick start

Create a key, check it, and queue your first call.

1

Create a key

In the Callifly dashboard, open Settings → API Management → New key. Pick the assistant and the scopes. For this quick start: assistants:read, calls:write and calls:read. Copy the key: it starts with cfly_ and is shown only once.

2

Check the key

A 200 with your assistant in the array means the key works.

curl https://api.callifly.com/client/assistants \ -H "Authorization: Bearer cfly_YOUR_KEY"
3

Queue a call

Send the number in E.164 format. A 202 means the call is queued.

curl -X POST https://api.callifly.com/client/calls \ -H "Authorization: Bearer cfly_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber": "+33612345678", "firstname": "Marie", "lastname": "Dupont"}'
{ "id": "3f9a1c2e-7b4d-4e8a-9c61-5d2f0b8e4a17", "status": "queued" }

Authentication

API keys

Send your key on every request:

Authorization: Bearer cfly_YOUR_KEY

Each key is bound to one assistant. It reads only that assistant's data and queues calls only for that assistant. Create, scope and revoke keys in Settings → API Management. A revoked key stops working on the next request. Keep keys on your server: browser calls are not supported.

Orchestration has its own base URL and accepts the same header. The older X-API-Key header still works there.

Scopes

A request outside the key's scopes returns 403 FORBIDDEN_SCOPE.

ScopeAllows
assistants:readGET /assistants, GET /assistants/{id}
calls:readGET /calls, GET /calls/{id}
calls:writePOST /calls
conversations:readGET /chat-conversations
sms:writePOST /send-sms
orchestratePOST /external/v1/orchestrate and GET /external/v1/orchestrate/{jobId}
statusGET /external/v1/orchestrate/{jobId}

Key errors

These use the short error shape, {"code","message"}. See Errors.

HTTP code When
401 UNAUTHORIZED No key was sent. Message: Missing API key. Send `Authorization: Bearer cfly_...`.
401 INVALID_API_KEY Unknown or revoked key. Message: Invalid or revoked API key
403 FORBIDDEN_SCOPE The key lacks the scope. Example message: API key lacks required scope: calls:write

Do

  • ›Store the key in an environment variable or a secrets manager
  • ›Create one key per assistant, with only the scopes it needs
  • ›Revoke a leaked key right away in Settings → API Management

Don't

  • ›Commit a key, or ship it in code that runs in a browser
  • ›Share one key across several assistants

Reference

API reference

All paths are relative to https://api.callifly.com/client, except orchestration, which lives under https://api.callifly.com/external/v1. Requests and responses are JSON. A path that is not listed here returns 404.

Read

Data retrieval

Every read is limited to the assistant bound to your key. The examples show the fields you can rely on. Responses can contain more fields: ignore the ones that are not documented here.

GET /assistants assistants:read

List your assistant

Returns an array with the assistant bound to your key. The array is empty if that assistant was deleted. No query parameters.

Response fields

FieldTypeNotes
assistantIdstringThe assistant bound to your key.
namestring
descriptionstringPresent when set.
assistantTypestringvoice, chat or hybrid. Present when set.
statusstringpending, active or failed
isDisabledbooleanThe assistant itself is turned off.
companyDisabledbooleanYour account is disabled.
effectivelyDisabledbooleantrue when either of the two above is true.
effectiveDisabledReasonstringPresent only when disabled: manual, credits_exhausted, payment_failed or system.
attachedPhoneobjectThe Callifly number attached to the assistant: phoneNumber, enabled, createdAt, updatedAt. Absent when no number is attached.

Example

curl https://api.callifly.com/client/assistants \ -H "Authorization: Bearer cfly_YOUR_KEY"
const res = await fetch("https://api.callifly.com/client/assistants", { headers: { Authorization: `Bearer ${process.env.CALLIFLY_KEY}` } }); const [assistant] = await res.json();
import os, requests r = requests.get( "https://api.callifly.com/client/assistants", headers={"Authorization": f"Bearer {os.environ['CALLIFLY_KEY']}"}, ) assistants = r.json()

Response 200

[ { "assistantId": "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", "name": "Reception", "description": "Answers calls for the Paris office", "assistantType": "voice", "status": "active", "isDisabled": false, "effectivelyDisabled": false, "companyDisabled": false, "attachedPhone": { "phoneNumber": "+33187654321", "enabled": true, "createdAt": "2026-09-02T08:15:00.000Z", "updatedAt": "2026-09-02T08:15:00.000Z" } } ]
GET /assistants/{id} assistants:read

Read your assistant's configuration

Returns the configuration of the assistant bound to your key, including its prompt. Any other id returns 403. The fields depend on how the assistant is set up: the example shows a typical voice assistant.

Path parameters

ParamTypeNotes
id requiredstringYour key's assistantId.

Example

curl https://api.callifly.com/client/assistants/8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34 \ -H "Authorization: Bearer cfly_YOUR_KEY"
const id = "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34"; const res = await fetch(`https://api.callifly.com/client/assistants/${id}`, { headers: { Authorization: `Bearer ${process.env.CALLIFLY_KEY}` } }); const assistant = await res.json();
import os, requests r = requests.get( "https://api.callifly.com/client/assistants/8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", headers={"Authorization": f"Bearer {os.environ['CALLIFLY_KEY']}"}, ) assistant = r.json()

Response 200

{ "id": "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", "assistantId": "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", "name": "Reception", "model": { "messages": [ { "role": "system", "content": "You are the receptionist of the Paris office…" } ] }, "firstMessage": "Hello, Paris office, how can I help you?", "status": "active", "allowEditing": false, "isDisabled": false, "effectivelyDisabled": false, "companyDisabled": false, "attachedPhone": { "phoneNumber": "+33187654321", "enabled": true } }

Response 403

{ "success": false, "error": { "code": 403, "name": "FORBIDDEN", "message": "Assistant is not available for this key" } }
GET /calls calls:read

List calls

Lists your assistant's calls, newest first, as {"calls": [...], "nextKey": "..."}. nextKey is missing on the last page.

Query parameters

ParamTypeDefaultNotes
fromDate optionalISO 8601Calls on or after this date or time.
endDate optionalISO 8601 dateCalls up to the end of this day (UTC), inclusive.
customerNumber optionalE.164Calls with this number. Encode + as %2B.
pageSize optionalinteger 1–100100Values outside 1–100 are brought back into range.
lastKey optionalstringnextKey from the previous page.
view optionalfull | leanfulllean leaves out messages and structuredOutputs for lighter pages.

Call fields

FieldTypeNotes
callIdstringPass it to GET /calls/{id}.
assistantIdstring
assistantNamestring
callTypestringReport type: end-of-call-report. It does not tell inbound from outbound.
customerNumberstringThe other party, in E.164.
phoneNumberstringYour assistant's number on the call.
phoneNamestringLabel of that number.
startedAtnumberUnix time in milliseconds.
endedAtnumberUnix time in milliseconds.
durationnumberSeconds.
billableMinsnumberDuration rounded up to the minute.
callEndReasonstringWhy the call ended, for example customer-ended-call.
summarystring
transcriptstring
recordingUrlstring
stereoRecordingUrlstring
analysisobjectsummary, structuredData and successEvaluation as produced after the call.
structuredDataobjectThe fields your assistant extracts.
successEvaluationstring, boolean or object
structuredOutputsobjectLeft out with view=lean.
overrideVariablesobjectVariables the call ran with.
messagesarrayThe conversation, turn by turn. Left out with view=lean.
languagestringLanguage code, for example fr-FR. Present when known.
sentimentEscalatedbooleanCaller sentiment signals. Other sentiment… fields appear when available.

A field with no value can hold a placeholder instead of being left out: "N/A" for text such as summary, transcript or recordingUrl, and "unknown" for numbers and names such as customerNumber. The webhook after a call uses the same placeholders.

Example

curl "https://api.callifly.com/client/calls?fromDate=2026-11-01&pageSize=20&view=lean" \ -H "Authorization: Bearer cfly_YOUR_KEY"
const url = new URL("https://api.callifly.com/client/calls"); url.searchParams.set("fromDate", "2026-11-01"); url.searchParams.set("pageSize", "20"); url.searchParams.set("view", "lean"); const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.CALLIFLY_KEY}` } }); const { calls, nextKey } = await res.json();
import os, requests r = requests.get( "https://api.callifly.com/client/calls", params={"fromDate": "2026-11-01", "pageSize": 20, "view": "lean"}, headers={"Authorization": f"Bearer {os.environ['CALLIFLY_KEY']}"}, ) payload = r.json() calls, next_key = payload["calls"], payload.get("nextKey")

Response 200

{ "calls": [ { "callId": "b2e7c4d1-9a3f-4c6e-8b15-7f0d2a9e6c38", "assistantId": "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", "assistantName": "Reception", "callType": "end-of-call-report", "customerNumber": "+33612345678", "phoneNumber": "+33187654321", "phoneName": "Paris office", "startedAt": 1794905218016, "endedAt": 1794905338016, "duration": 120, "billableMins": 2, "callEndReason": "customer-ended-call", "summary": "Marie confirmed her delivery slot for Wednesday morning.", "transcript": "AI: Hello, Paris office, how can I help you?\nUser: Hi, I'm calling about my delivery…", "recordingUrl": "https://…/recording.wav", "stereoRecordingUrl": "https://…/stereo.wav", "analysis": { "summary": "Marie confirmed her delivery slot for Wednesday morning.", "structuredData": { "slot": "2026-11-18T10:00" }, "successEvaluation": "true" }, "structuredData": { "slot": "2026-11-18T10:00" }, "successEvaluation": "true", "overrideVariables": {}, "language": "fr-FR", "sentimentEscalated": false, "sentimentEscalationRecommended": false } ], "nextKey": "eyJ…" }
GET /calls/{id} calls:read

Read one call

Returns one call with every field from the list, including messages and structuredOutputs. The object is not wrapped. A call that does not exist, or belongs to another assistant, returns 404. The message varies (Call not found, Call with id <id> not found or Access denied to call): switch on error.name.

ParamTypeNotes
id requiredstringA callId from the list or from the webhook.

Example

curl https://api.callifly.com/client/calls/b2e7c4d1-9a3f-4c6e-8b15-7f0d2a9e6c38 \ -H "Authorization: Bearer cfly_YOUR_KEY"
const res = await fetch("https://api.callifly.com/client/calls/b2e7c4d1-9a3f-4c6e-8b15-7f0d2a9e6c38", { headers: { Authorization: `Bearer ${process.env.CALLIFLY_KEY}` } }); const call = await res.json();
import os, requests r = requests.get( "https://api.callifly.com/client/calls/b2e7c4d1-9a3f-4c6e-8b15-7f0d2a9e6c38", headers={"Authorization": f"Bearer {os.environ['CALLIFLY_KEY']}"}, ) call = r.json()

Response 200

{ "callId": "b2e7c4d1-9a3f-4c6e-8b15-7f0d2a9e6c38", "assistantId": "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", "assistantName": "Reception", "callType": "end-of-call-report", "customerNumber": "+33612345678", "phoneNumber": "+33187654321", "startedAt": 1794905218016, "endedAt": 1794905338016, "duration": 120, "callEndReason": "customer-ended-call", "summary": "Marie confirmed her delivery slot for Wednesday morning.", "structuredData": { "slot": "2026-11-18T10:00" }, "structuredOutputs": {}, "messages": [ { "role": "bot", "message": "Hello, Paris office, how can I help you?", "time": 1794905219120, "secondsFromStart": 1.1 }, { "role": "user", "message": "Hi, I'm calling about my delivery.", "time": 1794905223480, "secondsFromStart": 5.46 } ] }

Shortened: the full object has every call field listed above. messages can start with the assistant's system prompt.

Response 404

{ "success": false, "error": { "code": 404, "name": "NotFound", "message": "Call not found" } }
GET /chat-conversations conversations:read

List chat conversations

Lists your assistant's chat conversations (web chat, SMS, WhatsApp, and email with includeEmail=true). Each one carries its full messages array and, by default, its report.

Query parameters

ParamTypeDefaultNotes
startDate optionalISO 8601Conversations started on or after.
endDate optionalISO 8601Conversations started on or before.
phoneNumber optionalE.164Conversations with this number. Encode + as %2B.
includeReports optionalbooleantrueSet to false to leave out report.
includeEmail optionalbooleanfalseInclude email conversations.
includeDeleted optionalbooleanfalseInclude deleted conversations.
pageSize optionalinteger 1–100100Outside 1–100 returns 400.
lastEvaluatedKey optionalstringpagination.lastEvaluatedKey from the previous page. An invalid value returns 400.

Conversation fields

FieldTypeNotes
sessionIdstring
assistantIdstring
assistantNamestring
channelstringFor example WEB, SMS, WHATSAPP or EMAIL.
statusstringFor example active, ended or completed.
phoneNumberstringThe contact's number, for SMS and WhatsApp.
createdAtstringISO 8601.
updatedAtstringISO 8601.
timestampnumberStart time, Unix milliseconds.
totalMessagesnumber
messagesarrayEach message has messageId, role (user, assistant or tool), content and timestamp (Unix milliseconds).
overrideVariablesobjectPresent when set.
reportobjectanalysis (summary, structuredData, successEvaluation) and processingStatus: pending, processing, processed or failed. Absent until a report exists.

Example

curl "https://api.callifly.com/client/chat-conversations?pageSize=20" \ -H "Authorization: Bearer cfly_YOUR_KEY"
const url = new URL("https://api.callifly.com/client/chat-conversations"); url.searchParams.set("pageSize", "20"); const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.CALLIFLY_KEY}` } }); const { data } = await res.json(); const conversations = data.conversations;
import os, requests r = requests.get( "https://api.callifly.com/client/chat-conversations", params={"pageSize": 20}, headers={"Authorization": f"Bearer {os.environ['CALLIFLY_KEY']}"}, ) conversations = r.json()["data"]["conversations"]

Response 200

{ "success": true, "data": { "conversations": [ { "sessionId": "c71e0f3a-2d5b-4a8c-9e14-6b3f8d2a7c50", "assistantId": "8f1c2e4a-6b3d-4f7e-a2c9-1d5b7e9f0a34", "assistantName": "Reception", "channel": "WHATSAPP", "status": "completed", "phoneNumber": "+33612345678", "createdAt": "2026-11-17T09:12:00.000Z", "updatedAt": "2026-11-17T09:20:00.000Z", "timestamp": 1794906720000, "totalMessages": 2, "messages": [ { "messageId": "m-01", "chatId": "c71e0f3a-…", "role": "user", "content": "Can I move my delivery to Wednesday?", "timestamp": 1794906720000 }, { "messageId": "m-02", "chatId": "c71e0f3a-…", "role": "assistant", "content": "Of course, Marie. Wednesday at 10:00 is booked.", "timestamp": 1794906726000 } ], "report": { "sessionId": "c71e0f3a-2d5b-4a8c-9e14-6b3f8d2a7c50", "analysis": { "summary": "Marie moved her delivery to Wednesday at 10:00.", "structuredData": { "slot": "2026-11-18T10:00" }, "successEvaluation": "true" }, "processingStatus": "processed" } } ], "pagination": { "hasMore": false, "pageSize": 20, "totalCount": 1 } } }

pagination.lastEvaluatedKey is present only when hasMore is true. totalCount can be missing: don't depend on it.

Lists

Pagination

Calls and chat conversations use different cursors. Pass each cursor back exactly as you received it.

RouteSendReceiveLast page
GET /callslastKeynextKeynextKey is missing.
GET /chat-conversationslastEvaluatedKeypagination.lastEvaluatedKeypagination.hasMore is false.

Act

Trigger actions with AI

Have your assistant call, text or follow up with a customer, straight from your own systems.

POST /calls calls:write

Queue an outbound call

Queues an AI call from the assistant bound to your key to one phone number. A 202 means the call is queued.

JSON body

FieldTypeRequiredNotes
phoneNumberstringYesE.164, for example +33612345678. number is accepted as an alias.
firstnamestringNoThe recipient's first name.
lastnamestringNoThe recipient's last name.

Example

curl -X POST https://api.callifly.com/client/calls \ -H "Authorization: Bearer cfly_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber": "+33612345678", "firstname": "Marie", "lastname": "Dupont"}'
const res = await fetch("https://api.callifly.com/client/calls", { method: "POST", headers: { Authorization: `Bearer ${process.env.CALLIFLY_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ phoneNumber: "+33612345678", firstname: "Marie", lastname: "Dupont" }) }); const queued = await res.json();
import os, requests r = requests.post( "https://api.callifly.com/client/calls", headers={"Authorization": f"Bearer {os.environ['CALLIFLY_KEY']}"}, json={ "phoneNumber": "+33612345678", "firstname": "Marie", "lastname": "Dupont", }, ) queued = r.json()

Response 202 Accepted

{ "id": "3f9a1c2e-7b4d-4e8a-9c61-5d2f0b8e4a17", "status": "queued" }

id identifies your call request. It is not a callId: once the call has taken place, find it with GET /calls or the webhook.

Calling hours and countries

Callifly serves both B2C and B2B assistants and follows the calling regulations of each recipient's country. A call queued outside the allowed hours is held until calling is allowed.

Just before dialing, Callifly checks the call again. The call is not placed when the number is blocked or on a do-not-call list, when the assistant has been disabled, or when Callifly does not call that country.

Errors

These use the detailed error shape. Switch on error.name.

{ "success": false, "error": { "code": 400, "name": "INVALID_PHONE", "message": "Phone number must be in E.164 format (e.g., +33612345678)" } }
HTTPerror.nameWhen
400INVALID_BODYThe body is not valid JSON.
400INVALID_PHONEThe number is missing or not in E.164 format.
400MISSING_ASSISTANTThe key is not bound to an assistant.
403PHONE_BLOCKEDThe number is on Callifly's blocklist.
404NOT_FOUNDThe key's assistant can't be found.
409NO_PHONE_LINEThe assistant has no phone number it can call from, for example after it was deleted, or disabled because credits ran out.
429RATE_LIMITEDThe key's per-minute call limit is reached. See Rate limits.
500InternalServerErrorTemporary problem on our side. Don't retry automatically: see Errors.
503RATE_LIMIT_UNAVAILABLE, CONFIG_UNAVAILABLETemporary. Try again shortly. Treat any other 503 the same way.

Country not called

A valid number in a country Callifly does not call is accepted with 202, then not placed. The API returns no error for it and no webhook is sent. In your dashboard logs, the call shows as not called with this reason: "Not called: Callifly does not place calls to this country yet. Contact us to enable it."

POST /send-sms sms:write

Send an SMS

Sends one SMS to one number, right away, from your assistant's SMS number. If the assistant has none, it is sent from a shared Callifly number. A 200 means the message was handed to the carrier.

JSON body

FieldTypeRequiredNotes
tostringYesE.164, for example +33612345678.
messagestringYesThe text to send. It is converted to plain characters to keep the message short: accents and special characters become plain equivalents, and characters with none, such as emojis or Arabic and Chinese script, are removed.

Example

curl -X POST https://api.callifly.com/client/send-sms \ -H "Authorization: Bearer cfly_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"to": "+33612345678", "message": "Hello Marie, your order 48213 is ready for pickup."}'

Response 200

{ "results": [ { "toolCallId": "N/A", "result": "SMS sent successfully" } ] }

Errors

These use the detailed error shape. Switch on error.name.

{ "success": false, "error": { "code": 400, "name": "MissingParameter", "message": "Missing or empty 'to' field" } }
HTTPerror.nameWhen
400MissingParameterto or message is missing or empty.
400InvalidRecipientThe number is not in E.164 format, or cannot receive SMS (for example a French landline).
404NotFoundThe key's assistant no longer exists.
500MissingConfigurationNo number is available to send from.
500InternalServerErrorThe body is not valid JSON, or the message could not be sent.
POST /orchestrate orchestrate

Orchestration: run a multi-step outreach

Reach a customer across several channels in one request. List the steps in the order you want, for example an SMS, then a WhatsApp message, then a call. Callifly runs one step at a time and stops as soon as the customer responds. If nobody responds, it alerts you by email or webhook.

Send Authorization: Bearer cfly_..., like the rest of the API. Integrations that send X-API-Key: cfly_... keep working; if both headers are sent, X-API-Key is used. Its base URL is https://api.callifly.com/external/v1. The key needs the orchestrate scope.

How a job runs

  • Each step starts about one minute after the previous one ends.
  • After a step is sent, Callifly waits delayMinutes, then checks it. An SMS or WhatsApp step succeeds when the customer replies. A call step succeeds when the call is answered.
  • On success the job ends as COMPLETED and the remaining steps are skipped. When every step has been tried without success, the job ends as ESCALATED.
  • Call steps follow the same calling hours and country rules as POST /calls. If the customer hangs up right away on two calls, the remaining steps are skipped and the job is escalated.

JSON body

FieldTypeRequiredNotes
requestIdstringNoYour own reference. Sending a requestId you already used returns that job instead of starting a new one. Generated when omitted.
customerDetails.phoneNumberstringYesThe customer, in E.164.
customerDetails.namestringNoThe customer's name. Fills {{name}} in SMS text and appears in the escalation.
customerDetails.emailstringNoThe customer's email, shown in the escalation.
channelsarrayYesThe steps, in order. At least one.
channels[].typestringYesSMS, WHATSAPP or CALL.
channels[].delayMinutesnumberYesMinutes to wait after the step is sent before checking for a reply or an answer. 0 or more.
channels[].maxRetriesnumberNoHow many more times to try a step that could not be sent. Default 0.
channels[].optionsobjectNoStep settings, see below.
overrideVariablesobjectNoVariables passed to your assistant, and to SMS text placeholders.
escalation.typestringYesEMAIL, WEBHOOK or BOTH.
escalation.emailstringNoRequired with EMAIL or BOTH.
escalation.webhookUrlstringNoRequired with WEBHOOK or BOTH. http or https.
escalation.webhookHeadersobjectNoHeaders sent with the webhook, for example a secret.

SMS step

Sent from your assistant's SMS number. A reply by SMS or WhatsApp counts as a response.

optionsTypeRequiredNotes
messageTemplatestringNoThe text. {{name}} is replaced with the customer's name and {{key}} with a variable. Defaults to the text set on your assistant.
templateVariablesobjectNoPlaceholder values. They take priority over overrideVariables.
skipSessionCreationbooleanNoSet to false when you expect a conversation, so your assistant has the job's context when the customer replies. Default true.

WhatsApp step

WhatsApp only lets a business start a conversation with an approved message template, so a WhatsApp step always sends a template. templateSid is required. Contact us if you need help with templates. A reply on WhatsApp counts as a response, and your assistant continues the conversation.

optionsTypeRequiredNotes
templateSidstringYesThe ID of the approved template.
templateVariablesobjectNoValues for the template's numbered placeholders, for example {"1": "Marie"}. overrideVariables are not used here.
templateNamestringNoA label for your own tracking.

Call step

Your assistant calls the customer. The assistant needs a phone number attached, otherwise the request returns 400 MISSING_PHONE_MAPPING. overrideVariables reach the assistant during the call.

Example

curl -X POST https://api.callifly.com/external/v1/orchestrate \ -H "Authorization: Bearer cfly_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "requestId": "order-48213", "customerDetails": { "phoneNumber": "+33612345678", "name": "Marie Dupont", "email": "marie@example.com" }, "channels": [ { "type": "SMS", "delayMinutes": 30, "options": { "messageTemplate": "Hello {{name}}, your order {{orderId}} is ready. Reply to pick a delivery slot." } }, { "type": "WHATSAPP", "delayMinutes": 60, "options": { "templateSid": "YOUR_TEMPLATE_ID", "templateVariables": { "1": "Marie", "2": "48213" } } }, { "type": "CALL", "delayMinutes": 15, "maxRetries": 1 } ], "overrideVariables": { "orderId": "48213" }, "escalation": { "type": "WEBHOOK", "webhookUrl": "https://example.com/callifly/outreach", "webhookHeaders": { "X-Callifly-Secret": "your-secret" } } }'

Response 202 Accepted

{ "jobId": "job_4f1c9a2e7b3d4e8a9c615d2f0b8e4a17", "requestId": "order-48213", "status": "PENDING", "message": "Orchestration job created successfully. Workflow will begin shortly.", "estimatedCompletionMinutes": 120 }

estimatedCompletionMinutes is the sum of the waits plus 5 minutes per step. Calling hours can make it longer. A repeated requestId returns 200 with the existing job.

Errors

Orchestration errors have their own shape, {"error","message"}. Switch on the HTTP status.

{ "error": "Validation Error", "message": "channels[0].type must be one of: WHATSAPP, CALL, SMS" }
HTTPerrorWhen
400Bad RequestThe body is not valid JSON.
400Validation ErrorA field is missing or invalid. message names it, for example customerDetails.phoneNumber is required.
400Validation ErrorA CALL step was sent but the assistant has no phone number. The body also has code: MISSING_PHONE_MAPPING.
401UnauthorizedNo key was sent. Message: Missing API key. Send Authorization: Bearer cfly_...
401UnauthorizedUnknown, revoked or expired key. Message: Invalid or expired API key
403ForbiddenThe key lacks the orchestrate scope.
403ForbiddenYour account or the assistant is disabled. Message, for example: Assistant is currently disabled. Reason: credits_exhausted
500Internal Server ErrorTemporary. Try again with the same requestId.
GET /orchestrate/{jobId} status

Read a job's status

Send the same header as when you start a job. Returns the job and every step. Works with the status or orchestrate scope. A job that does not exist, or belongs to another account, returns 404.

Example

curl https://api.callifly.com/external/v1/orchestrate/job_4f1c9a2e7b3d4e8a9c615d2f0b8e4a17 \ -H "Authorization: Bearer cfly_YOUR_KEY"

Response 200

{ "jobId": "job_4f1c9a2e7b3d4e8a9c615d2f0b8e4a17", "requestId": "order-48213", "status": "COMPLETED", "currentChannelIndex": 2, "channels": [ { "type": "SMS", "status": "FAILED", "executedAt": 1794916860000, "verifiedAt": 1794918660000, "result": { "success": false, "reason": "NO_REPLY" } }, { "type": "WHATSAPP", "status": "FAILED", "executedAt": 1794918720000, "verifiedAt": 1794922320000, "result": { "success": false, "reason": "NO_REPLY" } }, { "type": "CALL", "status": "SUCCESS", "executedAt": 1794922380000, "verifiedAt": 1794923280000, "result": { "success": true, "reason": "CALL_ANSWERED", "duration": 94 } } ], "result": { "success": true, "completedChannel": "CALL", "completedAt": 1794923281000, "attemptedChannels": [ { "channel": "SMS", "status": "FAILED", "reason": "NO_REPLY", "executedAt": 1794916860000, "verifiedAt": 1794918660000 }, { "channel": "WHATSAPP", "status": "FAILED", "reason": "NO_REPLY", "executedAt": 1794918720000, "verifiedAt": 1794922320000 }, { "channel": "CALL", "status": "SUCCESS", "reason": "CALL_ANSWERED", "executedAt": 1794922380000, "verifiedAt": 1794923280000, "duration": 94 } ] }, "createdAt": 1794916800000, "updatedAt": 1794923281000, "completedAt": 1794923281000 }

Times are Unix milliseconds. result and completedAt appear once the job has ended. duration is in seconds.

Job statuses

statusNotes
PENDINGCreated, not started yet.
IN_PROGRESSSteps are running.
COMPLETEDA step succeeded: the customer responded.
ESCALATEDNo step succeeded. The escalation was sent.
FAILEDThe job could not run.
CANCELLEDCancelled from the dashboard before it ended.

Step statuses

statusNotes
PENDINGNot run yet.
EXECUTINGBeing sent.
WAITING_VERIFICATIONSent. Waiting for delayMinutes before the check.
SUCCESSThe customer replied or answered.
FAILEDNo response, or the step could not be sent.
SKIPPEDNot run, for example because the customer was already reached on another channel.
CALLBACK_SCHEDULEDThe customer asked to be called back. The call runs again at the agreed time.

Errors

{ "error": "Not Found", "message": "Orchestration job not found" }
HTTPerrorWhen
401UnauthorizedNo key was sent. Message: Missing API key. Send Authorization: Bearer cfly_...
401UnauthorizedUnknown, revoked or expired key. Message: Invalid or expired API key
403ForbiddenThe key has neither status nor orchestrate.
404Not FoundUnknown job, or a job from another account.

Escalation

When a job ends as COMPLETED or ESCALATED, Callifly sends the escalation you chose: an email, a JSON POST to webhookUrl with your webhookHeaders, or both. The webhook body carries jobId, requestId, status, success, customer (phoneNumber, name, email), result (completedChannel, completedAt, attemptedChannels) and metadata.

Note: The escalation webhook is sent once, with no automatic retry and no signature, and your webhook URL has 10 seconds to answer. Use a secret header, and read the job status through the API if you miss one.

Chat API

Your assistant holds written conversations on web chat, SMS, WhatsApp and email. Use the API to start them and to read them.

Start a conversation

Add an SMS or WhatsApp step to an orchestration. When the customer replies, your assistant answers in the same thread. For SMS, set skipSessionCreation to false so the assistant has the job's context.

Read conversations, email included

GET /chat-conversations returns every conversation with its messages and report. Email conversations are left out by default: add includeEmail=true to get them, with channel set to EMAIL.

curl "https://api.callifly.com/client/chat-conversations?includeEmail=true&pageSize=20" \ -H "Authorization: Bearer cfly_YOUR_KEY"

Errors

Error handling

The API returns errors in two shapes. Check the HTTP status first, then the body. Orchestration has its own shape, described in Orchestration.

Short shape

For key, scope and route problems, and when the API cannot answer in time. Switch on code.

{ "code": "FORBIDDEN_SCOPE", "message": "API key lacks required scope: calls:read" }

Detailed shape

For everything else: invalid input, not found, business rules. error.code repeats the HTTP status as a number. Switch on error.name.

{ "success": false, "error": { "code": 404, "name": "NotFound", "message": "Call not found" } }
HTTP When Retry?
400Invalid input.No. Fix the request.
401Missing, unknown or revoked key.No. Fix the request.
403Missing scope, another assistant's id on GET /assistants/{id}, or a blocked number.No. Fix the request.
404Unknown route (Route not found), or a call that does not exist or belongs to another assistant.No. Fix the request.
405HTTP method not supported by the API.No. Fix the request.
409The assistant's setup prevents the call, for example NO_PHONE_LINE.Once the setup is fixed.
429Too many requests. See Rate limits.Yes, with backoff.
500Temporary problem on our side.Yes, with backoff, except POST /calls and POST /send-sms: see below.
503Temporary problem on our side.Yes, with backoff.
502UPSTREAM_UNAVAILABLE: the API could not reach the service, or got no answer within 25 seconds. The body includes a requestId to share with support. Other server errors come back with their own status.Yes, with backoff, except POST /calls and POST /send-sms: see below.

Back off exponentially: wait 1 second, then 2, then 4, up to 5 tries.

Don't retry POST /calls or POST /send-sms automatically after a 500, a 502 or a timeout. The first request may have gone through, and the customer would be called or texted twice. For a call, wait for the webhook, or look for it with GET /calls once it would have ended.

Limits

Rate limits

  • POST /calls is limited per key, 60 calls per minute by default. Above that, the API returns 429 with error.name RATE_LIMITED.
  • All requests are also protected by platform-wide throttling. A 429 without error.name means: slow down and retry.
  • Orchestration requests are throttled at 100 per second, with bursts up to 200.

Push

Webhooks

Turn on the webhook for your assistant in the dashboard to get each of its calls and chat conversations pushed to your webhook URL as soon as it is processed. Set the URL and optional custom headers there. Callifly sends a JSON POST with Content-Type: application/json and your headers.

Note: Today each webhook is sent once, with no automatic retry and no signature. It's your responsibility to make sure your webhook URL is reachable and responds quickly, and to verify and reconcile the data on your side (for example by listing calls through the API).

After a call

The body carries callId, callEndReason, assistantName, customerNumber, startedAt, endedAt, duration, summary, transcript, messages (without the system prompt), structuredData, overrideVariables and url, a link to the call in your dashboard. Pass callId to GET /calls/{id} for the full call.

After a chat conversation

The body carries sessionId, assistantName, customerNumber, status, messageCount, channel (WEB when not set), createdAt, updatedAt, summary, messages, structuredData, overrideVariables and url.

Tip: add a secret custom header and reject any request that doesn't carry it.

Coming soon

More ways to reach your customers

Calls, SMS, WhatsApp and orchestration are live. Email is next.

  • Email triggering
  • Email steps in orchestration

FAQ

Frequently asked questions

Need help?

Talk to us

Email support

Integration questions, bug reports and feature requests.

support@callifly.com

Ready to build?

Create a key in API Management and queue your first call.

Open the Callifly dashboard

Contact us

Drop us a line — we'll get back to you the same day.

By submitting this form, you agree that Callifly may use this information to contact you. See our privacy policy.