Skip to content

API reference

Base URL https://api.airfone.app. Version 2026-10-04. Authenticate with Authorization: Bearer af_sk_.... Download the OpenAPI document.

Fallback copy committed with the portal. The build replaces it with the live document when AIRFONE_OPENAPI_URL is set.

Calls

GET/v1/calls

List calls.

Scope calls:read

ParameterInDescription
limitquery1 to 100, default 20
starting_afterqueryCursor from the previous page

POST/v1/calls

Start an outbound AI call.

Scope calls:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
tostringE.164 number to call
agent_idstringAssistant that handles the call
fromstringYour AirFone number, E.164
contextobjectFacts the assistant may use on this call
metadataobjectYour own key-value pairs, returned in webhooks

GET/v1/calls/{id}

Get a call.

Scope calls:read

ParameterInDescription
id (required)pathCall id, call_...

POST/v1/calls/{id}/transfer

Transfer a live call.

Scope calls:write

ParameterInDescription
id (required)pathCall id
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
tostringNumber or user to transfer to

POST/v1/calls/{id}/end

End a live call.

Scope calls:write

ParameterInDescription
id (required)pathCall id
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.

GET/v1/calls/{id}/transcript

Get a call transcript.

Scope calls:read

ParameterInDescription
id (required)pathCall id

POST/v1/bulk-calls

Start a bulk call campaign.

Scope calls:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
agent_idstringAssistant
form_idstringForm to fill on each call
contactsarrayNumbers to call

Messages

POST/v1/messages

Send a message.

Scope messages:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
channelstringwhatsapp or sms
tostringE.164 number
textstringMessage text
templateobjectWhatsApp template name, language and parameters, required outside the 24 hour window

GET/v1/conversations

List conversations.

Scope messages:read

GET/v1/conversations/{id}/messages

List messages in a conversation.

Scope messages:read

ParameterInDescription
id (required)pathConversation id

Agents

GET/v1/agents

List assistants.

Scope agents:read

POST/v1/knowledge

Add a knowledge document.

Scope agents:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
agent_idstringAssistant
titlestringTitle
textstringContent

Contacts

GET/v1/contacts

List contacts.

Scope contacts:read

POST/v1/contacts

Create or update a contact.

Scope contacts:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
phonestringE.164
namestringName
external_idstringYour id for this person

POST/v1/records

Push records about a contact.

Scope records:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
contactobjectphone or external_id
recordsarrayRecords shown to staff and given to the assistant

Webhooks

GET/v1/webhook-endpoints

List webhook endpoints.

Scope webhooks:read

POST/v1/webhook-endpoints

Create a webhook endpoint.

Scope webhooks:write

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
urlstringHTTPS URL
eventsarrayEvent types, or ["*"]

GET/v1/events

List events.

Scope events:read

Usage

GET/v1/usage

Get usage for a period.

Scope usage:read

ParameterInDescription
fromqueryISO date
toqueryISO date

Connectors

GET/v1/connectors

List connectors you publish.

Scope connectors:read

POST/v1/connectors/{id}/versions

Upload a connector version.

Scope connectors:write

ParameterInDescription
id (required)pathConnector id, reverse DNS
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
bundlestringSigned tar bundle, base64
signaturestringEd25519 signature of the bundle's sha256

Widget

POST/v1/widget/session

Open a widget session.

Called by widget.js with a publishable key.

Body fieldTypeDescription
visitor_idstringStable id for this browser
identityobjectuser_id and user_hash for a verified visitor

POST/v1/widget/messages

Send a widget message.

ParameterInDescription
Idempotency-KeyheaderMakes a retried POST safe. Any unique string, kept 24 hours.
Body fieldTypeDescription
textstringVisitor's message

GET/v1/widget/stream

Stream widget events (SSE).

ParameterInDescription
token (required)querySession token

POST/v1/widget/voice

Start a browser voice call.

Returns a LiveKit URL, room and token. The assistant joins the room.