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

CallFluent API: Agent Services

Share this guide
David Perrin
3 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 the Twilio number list.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
idnumbertrueWorkspace ID1
agentTypestringtrueoutbound or inboundoutbound

Example Request

curl -X GET https://api.callfluent.ai/api/agent/number-list/1/outbound \
  -H "Authorization: Bearer {api_key}"

Response

  • Example Success

status code: 200: workspace list

{ status: true, data: number_list, agentNumMap: {used_number: used_avatar_url, …}}

number_list: [
{number: twlio_number, sid: twilio_sid, type: “twilio/verified”}
]

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

2. Create a New Agent

POST /agent/create

Creates a new voice agent with customizable settings.

Header

Authorization: Bearer {api_key}  

Request Body (agentPayload)

FieldTypeRequiredDescriptionExample
workspaceIdnumbertrueWorkspace ID1
formatstringtrueoutbound/inboundoutbound
timezonestringtrueAgent timezoneUTC+00:00
namestringtrueAgent nameSales assistant
avatarstringXXPublic image URL/image’s base64https://...
langstringtrueValue of language listen
voicestringtrueValue of workspace voicealloy
phone_numberstringtrue (outbound)
false (inbound)
Agent phone number+123456789
welcome_msg_flagbooleanfalseTurn on/off welcome messagetrue
welcome_msgstringfalseTurn on/off the welcome messageHow are you today?
welcome_msg_delaynumberfalseWait time (in seconds) before playing the welcome message3
call_recordingbooleanfalseEnable call recordingtrue
blocked_phone_typesstringfalseBlock phone type list1,2,3
enable_voice_mailbooleanfalseEnable machine detectiontrue
voice_mail_modenumberfalse1. Leave a voice message. 2. hang up the call1
voice_mail_textstringfalse1. Leave a voice message. 2. Hang up the callPlease try again.
machine_detection_timeoutnumberfalseTwilio machine detection timeout10
openai_modelstringfalseOpenAI model name (only available when openAI key is valid)gpt-4o
answer_creativitynumberfalseOpenAI temperature (0–10)3
context_max_tokensnumberfalseOpenAI prompt max token count350
speech_stop_sensitivitynumberfalseWord count that stops the agent’s speech (0-10)5
answer_lengthnumberfalseLimit the maximum no. of words (approximatively) per answer25
silence_message_delaynumberfalseTrigger the “are you there?” message after X seconds10
silence_end_callnumberfalseEnd the call if there is no sound for XX seconds20
utterance_detectionnumberfalseHow long to wait before an utterance ends (min 500ms)1000
transcribe_filler_wordsbooleanfalseTranscribe words like “hmm” or “uhm”true
agent_typestringtrueAgent typesales
backgroundstringtrueAgent’s backgroundYou are a support agent.
goalstringtrueAgent’s goalSupport clients
tonestringtrueAgent’s toneProfessional
instructionsstringtrueAgent’s instructions
script_optionbooleanfalseEnable agent’s scripttrue
scripttextfalseAgent’s scriptEnable the agent’s script
background_soundstringfalseBackground noise (only for browser call)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

  • Example Success

status code: 200: workspace list

{status: true, data: new_agent }

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 400 (Bad Request) – Agent limit reached.
{ 
        status: false,
        msg: "You have reached limit.",
}

3. Get All Agents in Workspace

GET /agent/get-all/{workspaceId}

Retrieves the agents’ list in a workspace.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
workspaceIdnumbertrueWorkspace ID1

Response

  • Example Success

status code: 200: workspace list

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

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

4. Get Agent Details

GET /agent/get-one/{agentId}

Retrieves details for a specific agent.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
agentIdnumbertrueAgent ID1

Response

  • Example Success

status code: 200: workspace list

{
    status: true,
    data: {
        agent,
        files,
        totalCalls,
        averageDuration
    }
}

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

5. Delete an Agent

DELETE /agent/delete/{agentId}

Deletes a specific agent.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
agentIdnumbertrueAgent ID11

Response

  • Example Success

status code: 200: workspace list

{
    status: true,
    data: {
        agent,
        files,
        totalCalls,
        averageDuration
    }
}

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

4. Get Agent Details

GET /agent/get-one/{agentId}

Retrieves details for a specific agent.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
agentIdnumbertrueAgent ID1

Response

  • Example Success

status code: 200: workspace list

{
    status: true,
    data: {
        agent,
        files,
        totalCalls,
        averageDuration
    }
}

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

4. Get Agent Details

GET /agent/get-one/{agentId}

Retrieves details for a specific agent.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
agentIdnumbertrueAgent ID1

Response

  • Example Success

status code: 200: workspace list

{
    status: true,
    data: {
        agent,
        files,
        totalCalls,
        averageDuration
    }
}

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

4. Get Agent Details

GET /agent/get-one/{agentId}

Retrieves details for a specific agent.

Header

Authorization: Bearer {api_key}  

Path Parameters

FieldTypeRequiredDescriptionExample
agentIdnumbertrueAgent ID1

Response

  • Example Success

status code: 200: workspace list

{
    status: true,
    data: {
        agent,
        files,
        totalCalls,
        averageDuration
    }
}

Errors

  • 500 (Server Error) – Server error.
{status: false, error: error_message}
  • 403 (Permission Error) – Permission error.
{ 
        status: false,
        msg: "Your account doesn't have the permission to access that page."
}

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