Whitelabel Callfluent AI for your agency’s services with full flexibility Explore Whitelabel

CallFluent API: Agent Services

Share this guide
David Perrin
2 mins read

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

FieldTypeRequiredDescriptionExample
idnumberWorkspace ID1
agentTypestringoutbound or inboundoutbound

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)

FieldTypeRequiredDescriptionExample
workspaceIdnumberWorkspace ID1
formatstringoutbound or inboundoutbound
timezonestringAgent timezoneUTC+00:00
namestringAgent nameSales Assistant
avatarstringImage URL/base64https://...
langstringLanguage codeen
voicestringVoice typealloy
phone_numberstring✅ (outbound)Twilio number+123456789
welcome_msg_flagbooleanEnable welcome messagetrue
welcome_msgstringWelcome message text"How are you today?"
welcome_msg_delaynumberDelay (seconds)3
call_recordingbooleanEnable recordingtrue
blocked_phone_typesstringComma-separated blocked types1,2,3
enable_voice_mailbooleanEnable voicemailtrue
voice_mail_modenumber1 (leave message) or 2 (hang up)1
voice_mail_textstringVoicemail prompt"Please try again."
machine_detection_timeoutnumberTimeout (seconds)10
openai_modelstringOpenAI modelgpt-4o
answer_creativitynumberTemperature (0–10)3
context_max_tokensnumberMax tokens350
speech_stop_sensitivitynumberWord stop sensitivity (0–10)5
answer_lengthnumberMax words per answer25
silence_message_delaynumber“Are you there?” delay (seconds)10
silence_end_callnumberAuto-end call delay (seconds)20
utterance_detectionnumberUtterance end delay (ms, min 500)1000
transcribe_filler_wordsbooleanTranscribe “uhm”/”hmm”true
agent_typestringsales, support, or leadsales
backgroundstringAgent background"You are a sales agent."
goalstringAgent goal"Close deals."
tonestringProfessional, Conversational, etc.Professional
instructionsstringCustom instructions"Be polite."
script_optionbooleanEnable scripttrue
scripttextScript text"Hello, this is [Name]."
background_soundstringBackground noiseoffice-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

FieldTypeRequiredDescriptionExample
workspaceIdnumberWorkspace ID1

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

FieldTypeRequiredDescriptionExample
agentIdnumberAgent ID1

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

FieldTypeRequiredDescriptionExample
idnumberAgent ID14

Response (Success – 200)

{ "status": true, "data": "updated_agent" }

6. Delete an Agent

DELETE /agent/delete/{agentId}

Permanently deletes an agent.

Path Parameters

FieldTypeRequiredDescriptionExample
agentIdnumberAgent ID11

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

TypeKeyExample Use Case
Send EmailsendEmailFollow-up emails
Call ForwardingcallForwardingTransfer to human
SMSsmsText notifications
WebhookwebhookZapier integrations
Data CollectiondataCollectionCapture user info
Calendar Bookingghl_calendarSchedule 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! 🚀

Leave a reply

Your email address will not be published. Required fields are marked *

Automate your phone calls with AI

Create artificial inteligence powered, human-like voice agents ready to handle inbound and outbound calls 24/7

Discover Callfluent

Frequently 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