Every endpoint on this page requires either a Clerk-issued JWT (
Authorization: Bearer <token>) or
an organization API key (x-api-key: pk_…). Anonymous calls return 401 Unauthorized. See
Authentication for the full setup.The end-to-end loop
- Configure the agent. Define the system prompt with
{{placeholders}}and turn on the post-call analysis fields you want returned (intent, resolution, sentiment, structured data extraction). - Trigger the call.
POST /api/v1/phone-numbers/{phone_number_id}/calls/startwith the destination number,agent_id, and a free-formsession_variablesmap. - Receive a webhook. Agentix calls your registered endpoint on
session.createdandsession.ended. Use the echoedsession_variablesto map the call back to your CRM record. - Pull full details (optional).
GET /api/v1/chat/sessions/{id}and/messagesto fetch the full transcript and analysis when you need more than the webhook summary.
Session variables
How
{{placeholders}} in the system prompt are resolved from session_variables and built-in system.* values.Post-call analysis
Configure intent, resolution, sentiment, and data-extraction so the webhook carries structured fields, not raw transcript.
Find the IDs you need
To kick off a call programmatically you need three things plus yoursession_variables:
agent_id— which agent to use.phone_number_id— which outbound number to dial from.to_phone_number— destination number in E.164 format.
Finding the agent_id
Open the agent in the Agentix dashboard. The ID is surfaced in two places on the agent detail screen:
- Header line — directly under the agent name, shown as
ID: d796…953awith a copy icon. - Browser URL — the path is
app.agntix.ai/en/agents/<agent_id>, so the last segment is the ID.
d796c919-7ef3-413a-8bf1-351b6442953a.
Finding the phone_number_id
Call the phone-numbers listing endpoint. This returns every outbound number provisioned to your org along with its UUID:
id of the number you want to dial from. The IDs are stable — cache them once on your side.
Trigger the call
POST /api/v1/phone-numbers/{phone_number_id}/calls/start
Path parameters
The UUID of the outbound phone number to dial from.
Destination number in E.164 format (e.g.
+971501234567).UUID of the agent that will drive the conversation.
Maximum call duration in seconds. The call is force-terminated when this elapses.
Free-form key/value map. Every key is available as
{{key}} in the system prompt and is echoed back verbatim in webhooks regardless of whether the prompt referenced it. Use this for both prompt context and correlation IDs.sessionId you can store immediately for correlation. The same ID flows in webhooks and in the session GET API.
Map a call back to your CRM
This is the most important design point. Production traffic almost always means many parallel calls. Webhooks arrive asynchronously and order is not guaranteed. To map each webhook back to its originating task, include a unique identifier insession_variables at trigger time:
metadata.sessionVariables in the webhook — regardless of whether the agent prompt actually referenced them. So they double as pure correlation IDs without polluting the prompt.
When your endpoint receives a session.ended event:
- Read
webhook.metadata.sessionVariables.crmContactId. - Look up the contact in your DB.
- Persist
analysis.*fields against the contact / task. - If transcripts are needed, fetch via the session messages API.
session.created and session.ended payload schemas.
Fetch full session details
When you need the full picture — transcript turns, tool calls, raw recording — pull from the chat session API using the session ID from the webhook.End-to-end example
The full lifecycle for one outbound call:Quick reference
Endpoints
| Purpose | Method | Path |
|---|---|---|
| List phone numbers | GET | /api/v1/phone-numbers?size=50 |
| Trigger outbound call | POST | /api/v1/phone-numbers/{phone_number_id}/calls/start |
| Get session summary | GET | /api/v1/chat/sessions/{sessionId} |
| Get session messages | GET | /api/v1/chat/sessions/{sessionId}/messages |
https://api.agntix.ai and require the x-api-key header.
Webhook events
| Event | Fires when | Has analysis? |
|---|---|---|
session.created | Call initiated | No |
session.ended | Call closed | Yes |
Pre-launch checklist
- Decide your correlation keys. Standardise on
session_variableskeys for CRM mapping (crmContactId,campaignId,taskId). - Define resolution + extraction schemas. Write the resolution definition and lock the data-extraction field set in the dashboard. See Post-call analysis.
- Whitelist webhook IPs. Allow the Agentix outbound webhook IPs through your firewall.
- Set dialing rate limits. Match your outbound concurrency to your telephony trunk capacity and the receiving population’s tolerance.
- Set transcript retention. Decide where you persist transcripts + recordings (recommend S3/GCS with a lifecycle policy).
- Stage a soft-launch run. Trigger 10–20 calls in a controlled window before turning on full-volume traffic.
Next steps
Session variables
Hydrate the system prompt with per-call context and built-in time / channel / telephony placeholders.
Post-call analysis
Configure intent, resolution, sentiment, and structured data extraction.
Outbound call API
Full request/response schema for the trigger endpoint.
Webhook events
session.created and session.ended payload schemas.