Platform REST API
Create and configure assistants, prompts, TTS/ASR/LLM voice, RAG knowledge bases, tools and analytics. Everything you do in the portal, done in code.
REST API and webhooks to let AI4CALL voice assistants call, answer and take action inside your systems. OpenAPI spec, copy-paste examples, no SDK to install.
Free trial with starting credit included.
/api/v1# Have your AI assistant call a lead
curl -X POST https://client-api.ai4call.com/webhook/outbound_call \
-H "x-client-email: you@company.com" \
-H "x-portal-api-key: $AI4CALL_PORTAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistantApiKey": "ast_xxx",
"to": "+39081...",
"from": "+3902...",
"metadata": { "lead_id": "123" }
}'
// Have your AI assistant call a lead
const res = await fetch("https://client-api.ai4call.com/webhook/outbound_call", {
method: "POST",
headers: {
"x-client-email": "you@company.com",
"x-portal-api-key": process.env.AI4CALL_PORTAL_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
assistantApiKey: "ast_xxx",
to: "+39081...",
from: "+3902...",
metadata: { lead_id: "123" },
}),
});
console.log(res.status, await res.text());
# Have your AI assistant call a lead
import os, requests
res = requests.post(
"https://client-api.ai4call.com/webhook/outbound_call",
headers={
"x-client-email": "you@company.com",
"x-portal-api-key": os.environ["AI4CALL_PORTAL_KEY"],
},
json={
"assistantApiKey": "ast_xxx",
"to": "+39081...",
"from": "+3902...",
"metadata": {"lead_id": "123"},
},
)
print(res.status_code, res.text)
// Have your AI assistant call a lead
$ch = curl_init('https://client-api.ai4call.com/webhook/outbound_call');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-client-email: you@company.com',
'x-portal-api-key: ' . getenv('AI4CALL_PORTAL_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'assistantApiKey' => 'ast_xxx',
'to' => '+39081...',
'from' => '+3902...',
'metadata' => ['lead_id' => '123'],
]),
]);
echo curl_exec($ch);
One call, layer by layer: voice is only the first. Every row is a point where your code can step in.
Bianchi Clinic, good morning Marco. How can I help?
Your server receives the caller's number, recognizes them and enriches the prompt with customer data.
pre-call webhook
The LLM answers using the knowledge base and calls your tools whenever it needs data or actions.
HTTP tools · MCP · RAG
Transfer, redirect or close. The AI extracts the fields you define and POSTs them to your hang-up URL.
hang-up webhook
Call history, usage, tool and SMS events to feed into your CRM, data warehouse or BI.
/account/analytics/*
AI4CALL sends a POST to your endpoint. Reply with enable to accept or reject the call and with callerInfo to give the assistant context: the fields are added to the system prompt.
POST https://yourserver.com/api/verify-caller
Content-Type: application/json
{
"number": "+393331234567",
"timestamp": "2025-12-13T10:30:00Z",
"assistantId": "ast_abc123",
"callId": "call_xyz789"
}
{
"enable": true,
"callerInfo": {
"name": "Mario",
"surname": "Rossi",
"custom_field_1": "VIP since 2020"
}
}
Use only what you need: from a single webhook to fully automating the platform.
Create and configure assistants, prompts, TTS/ASR/LLM voice, RAG knowledge bases, tools and analytics. Everything you do in the portal, done in code.
One POST from your backend and the assistant calls your customer, over the AI4CALL trunk or your own PBX. Pass custom metadata (lead, ticket, order) and find it again in analytics.
Before the assistant answers, AI4CALL calls your endpoint with the caller's number. You decide whether to accept the call and what context to give the AI.
Mid-call, the assistant invokes your APIs: look up customers, open tickets, check orders. Bearer, API Key or OAuth2 auth, or your own MCP server.
Connect the assistant to your phone system via SIP trunk or the FreePBX module, and keep the numbers and routing you already have.
The API doesn't replace the AI4CALL portal, it works alongside it with the same logic. Automate only what you need and use the web interface for everything else, with no need to build your own admin panel.
A typical flow: the team sets up and fine-tunes the assistant in the portal, while developers integrate outbound calls, webhooks and analytics via API.
No SDK, no dependencies: any HTTP client will do.
Sign up on the portal and create your first assistant. The trial includes credit for test calls.
Go to the portal →Create one key per environment (test, production) in the portal. You send it in the headers together with your email.
How to generate the API key →List your assistants to get the assistantApiKey, then trigger an outbound call or configure prompt and voice.
curl https://client-api.ai4call.com/api/v1/assistants \
-H "x-client-email: you@company.com" \
-H "x-portal-api-key: $AI4CALL_PORTAL_KEY"
The main areas exposed by client-api.ai4call.com. Requests, responses and errors are documented in Swagger.
GET · POST /api/v1/assistants
GET · PATCH /api/v1/assistants/{key}/prompt
PATCH /api/v1/assistants/{key}/runtime/{tts|asr|llm|dtmf}
GET /api/v1/catalog/providers/tts
/api/v1/catalog/rag/…
PATCH /api/v1/assistants/{key}/runtime/rag
GET /api/v1/catalog/tools
PATCH /api/v1/assistants/{key}/runtime/tools
/api/v1/assistants/{key}/runtime/precall/number-validation
/api/v1/assistants/{key}/runtime/precall/mcp-config
PATCH /api/v1/assistants/{key}/runtime/hangup
…/runtime/hangup/save-conversation · /schema
POST /webhook/outbound_call
POST /webhook/outbound_call_pbx
GET /api/v1/account/analytics/calls
…/calls-outbound · /recharges · /tool-responses
GET · PATCH /api/v1/account/allowed-ips
GET · PATCH /api/v1/account/call-limits
No lock-in to a single vendor: for each assistant, pick the model that best fits quality, cost, latency and privacy requirements. Switch any time, via API too.
Where call data is processed also depends on the models you use. With AI4CALL you compose the pipeline around your own and your customers' privacy requirements.
Each assistant's provider and model can also be changed via API, without going through the portal:
PATCH /api/v1/assistants/{key}/runtime/llm
With BYOK you connect the credentials of your own provider account (API key, service account, IAM keys or token) to AI4CALL instead of AI4CALL's. Model requests run from your account and the provider bills you directly.
Usage of the component you run on your key (LLM, voice or transcription) doesn't draw down your AI4CALL top-up credit.
At high volumes it's the most cost-effective option: you pay the rates in your own provider contract, with no markup.
Account, region and data processing agreement (DPA) are managed by you directly with the provider: one more lever for GDPR requirements.
Some providers are only available with your own credentials, e.g. Anthropic, Google Gemini, OpenRouter, Vertex AI and AWS Bedrock.
Email and portalApiKey in headers for the account, assistantApiKey in the path for a single assistant. HTTPS only.
Restrict API access to your own servers, managing the list via /account/allowed-ips.
Read and tune concurrent and per-period calls with /account/call-limits.
Endpoints live under /api/v1. Breaking changes will ship in a new major version, with a transition period.
Servers in Europe and GDPR compliance. Public health check at GET /health for your monitoring.
Yes. The Trial plan includes starting credit for test calls. To keep test and production apart you can use dedicated credentials; if you need an extra test account, contact us from the portal.
The API is standard REST/JSON described in OpenAPI 3.0.3, so it works with any HTTP client. From Swagger you can download openapi.yaml and generate a typed client with tools such as OpenAPI Generator.
Define the properties to extract (e.g. customer_email, outcome) and a hang-up URL: when the call ends you receive a POST with the extracted data. You can also get the full transcript by email.
Yes, with custom tools: define endpoint, HTTP method, parameters and authentication (Bearer, API Key, OAuth2) and the AI invokes them when needed. For more structured integrations you can connect your own MCP server.
The main constraint is the number of concurrent and per-period calls in your plan, which you can read and adjust with /account/call-limits. For high-volume use cases, contact us for a dedicated plan.
Usage depends on your plan (pay-as-you-go or with included minutes). On the Trial and Freedom plans you can bring your own API keys for LLMs and voices and pay the provider directly. Details on the pricing page.
All business endpoints are versioned under /api/v1/. Any breaking changes will ship in /api/v2/, with v1 kept running during the transition.
Yes. You can choose European providers (Mistral, IONOS, OVHcloud, Scaleway), OpenAI's European endpoint, your own Azure, Vertex AI or AWS Bedrock accounts in the region you prefer, or a self-hosted model with Ollama. The final compliance assessment rests with the data controller: contact us for specific cases.
Create an account, generate your key and place your first AI call from code. Got a complex project? Let's talk it through with our engineering team.
Chiama e prova la qualità dei nostri assistenti A.I.