CallFluent API: Agent Services
The Agent Services API allows you to create, configure, and manage AI-powered voice agents within your CallFluent workspace. Agents can handle inbound/outbound calls, execute actions (email, SMS, webhooks), and integrate with third-party services.
Base URL
All requests must be sent to:https://api.callfluent.ai/api
Authentication
Include your API key in the Authorization
header:
Authorization: Bearer {api_key}
Agent Endpoints
1. Get Twilio Number List
GET /agent/number-list/{id}/{agentType}
Retrieves available Twilio numbers for an agent.
Path Parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
id | number | ✅ | Workspace ID | 1 |
agentType | string | ✅ | outbound or inbound | outbound |
Example Request
curl -X GET https://api.callfluent.ai/api/agent/number-list/1/outbound \
-H "Authorization: Bearer {api_key}"
Response (Success – 200)
{
"status": true,
"data": {
"number_list": [
{"number": "+123456789", "sid": "TWXXXXXX", "type": "twilio/verified"}
],
"agentNumMap": {"used_number": "avatar_url"}
}
}
Possible Errors
- 403 (Forbidden) – Permission denied.
- 500 (Server Error) – Internal server error.
2. Create a New Agent
POST /agent/create
Creates a new voice agent with customizable settings.
Request Body (agentPayload
)
Field | Type | Required | Description | Example |
---|---|---|---|---|
workspaceId | number | ✅ | Workspace ID | 1 |
format | string | ✅ | outbound or inbound | outbound |
timezone | string | ✅ | Agent timezone | UTC+00:00 |
name | string | ✅ | Agent name | Sales Assistant |
avatar | string | ❌ | Image URL/base64 | https://... |
lang | string | ✅ | Language code | en |
voice | string | ✅ | Voice type | alloy |
phone_number | string | ✅ (outbound) | Twilio number | +123456789 |
welcome_msg_flag | boolean | ❌ | Enable welcome message | true |
welcome_msg | string | ❌ | Welcome message text | "How are you today?" |
welcome_msg_delay | number | ❌ | Delay (seconds) | 3 |
call_recording | boolean | ❌ | Enable recording | true |
blocked_phone_types | string | ❌ | Comma-separated blocked types | 1,2,3 |
enable_voice_mail | boolean | ❌ | Enable voicemail | true |
voice_mail_mode | number | ❌ | 1 (leave message) or 2 (hang up) | 1 |
voice_mail_text | string | ❌ | Voicemail prompt | "Please try again." |
machine_detection_timeout | number | ❌ | Timeout (seconds) | 10 |
openai_model | string | ❌ | OpenAI model | gpt-4o |
answer_creativity | number | ❌ | Temperature (0–10) | 3 |
context_max_tokens | number | ❌ | Max tokens | 350 |
speech_stop_sensitivity | number | ❌ | Word stop sensitivity (0–10) | 5 |
answer_length | number | ❌ | Max words per answer | 25 |
silence_message_delay | number | ❌ | “Are you there?” delay (seconds) | 10 |
silence_end_call | number | ❌ | Auto-end call delay (seconds) | 20 |
utterance_detection | number | ❌ | Utterance end delay (ms, min 500) | 1000 |
transcribe_filler_words | boolean | ❌ | Transcribe “uhm”/”hmm” | true |
agent_type | string | ✅ | sales , support , or lead | sales |
background | string | ✅ | Agent background | "You are a sales agent." |
goal | string | ✅ | Agent goal | "Close deals." |
tone | string | ✅ | Professional , Conversational , etc. | Professional |
instructions | string | ✅ | Custom instructions | "Be polite." |
script_option | boolean | ❌ | Enable script | true |
script | text | ❌ | Script text | "Hello, this is [Name]." |
background_sound | string | ❌ | Background noise | office-ambience.wav |
Example Request
curl -X POST https://api.callfluent.ai/api/agent/create \
-H "Authorization: Bearer {api_key}" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": 1,
"format": "outbound",
"name": "Sales Bot",
"voice": "alloy",
"phone_number": "+123456789",
"agent_type": "sales",
"background": "You are a sales agent.",
"goal": "Close deals."
}'
Response (Success – 200)
{ "status": true, "data": "new_agent" }
Possible Errors
- 400 (Bad Request) – Agent limit reached.
- 403 (Forbidden) – Permission denied.
- 500 (Server Error) – Internal server error.
3. Get All Agents in Workspace
GET /agent/get-all/{workspaceId}
Retrieves all agents in a workspace.
Path Parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
workspaceId | number | ✅ | Workspace ID | 1 |
Example Request
curl -X GET https://api.callfluent.ai/api/agent/get-all/1 \
-H "Authorization: Bearer {api_key}"
Response (Success – 200)
{ "status": true, "data": "agent_list" }
Possible Errors
- 403 (Forbidden) – Permission denied.
- 500 (Server Error) – Internal server error.
4. Get Agent Details
GET /agent/get-one/{agentId}
Retrieves details for a specific agent.
Path Parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
agentId | number | ✅ | Agent ID | 1 |
Response (Success – 200)
{
"status": true,
"data": {
"agent": {...},
"files": [...],
"totalCalls": 10,
"averageDuration": 120
}
}
5. Update an Agent
PUT /agent/update/{id}
Updates agent settings (same fields as POST /agent/create
).
Path Parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
id | number | ✅ | Agent ID | 14 |
Response (Success – 200)
{ "status": true, "data": "updated_agent" }
6. Delete an Agent
DELETE /agent/delete/{agentId}
Permanently deletes an agent.
Path Parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
agentId | number | ✅ | Agent ID | 11 |
Response (Success – 200)
{ "status": true, "data": "agent_list" }
7. Agent Actions (Webhooks, Email, SMS, etc.)
Endpoints for configuring agent actions:
POST /agent/create-action
– Create actions (email, SMS, forwarding).PUT /agent/update-action/{actionId}
– Update actions.DELETE /agent/delete-action/{actionId}
– Remove actions.
Supported Action Types
Type | Key | Example Use Case |
---|---|---|
Send Email | sendEmail | Follow-up emails |
Call Forwarding | callForwarding | Transfer to human |
SMS | sms | Text notifications |
Webhook | webhook | Zapier integrations |
Data Collection | dataCollection | Capture user info |
Calendar Booking | ghl_calendar | Schedule meetings |
Conclusion
This covers all Agent Services API endpoints. For workspace management, refer to the Workspace API Documentation.
Let me know if you need further enhancements! 🚀
Automate your phone calls with AI
Create artificial inteligence powered, human-like voice agents ready to handle inbound and outbound calls 24/7
Discover CallfluentFrequently asked questions
Get answers to commonly asked questions about our cutting-edge AI voice call technology & learn how our platform revolutionizes customer engagement line never before.
No, you don’t need to download or install anything. Callfluent is a cloud based app, that means that it is hosted in the cloud and you can access it from any device anytime.
Have more questions ? Check out our Knowledge base