Skip to main content
POST
/
agency
/
agents
Create a new agent
curl --request POST \
  --url https://api.cleartalk.ai/agency/agents \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "agentName": "<string>",
  "task": "<string>",
  "model": "<string>",
  "temperature": 123,
  "wait_for_greeting": "<string>",
  "max_duration": 123,
  "selectedVoice": "<string>",
  "voiceId": "<string>",
  "selectedLanguage": "<string>",
  "voiceSpeed": 123,
  "interruptionThreshold": 123,
  "startTime": "2023-11-07T05:31:56Z",
  "isGHL": 123,
  "appointmentAgent": 123,
  "from_admin": 123,
  "knowledgeBases": [
    {
      "id": 123,
      "user_id": 123,
      "knowledge_name": "<string>",
      "question": "<string>",
      "answer": "<string>"
    }
  ],
  "questionsData": [
    "<unknown>"
  ],
  "pronunciationGuide": [
    {
      "word": "<string>",
      "pronunciation": "<string>",
      "caseSensitive": true,
      "spaced": true
    }
  ],
  "noise_cancellation": false,
  "keywords": [
    "keyword1",
    "keyword2"
  ],
  "timezone": "America/Los_Angeles",
  "request_data": {
    "name": "John Doe",
    "age": 30
  },
  "start_time": "2024-03-20 12:00:00 -05:00",
  "voicemail_message": "Please leave a message after the beep",
  "voicemail_action": "hangup",
  "retry": {
    "wait": 10,
    "voicemail_action": "leave_message",
    "voicemail_message": "Hello, this is a test message."
  },
  "record": true,
  "webhook_events": [
    "queue",
    "call",
    "latency"
  ],
  "citation_schema_id": "dcad76eb-57b6-4be6-922f-8a5a95e2ffrt",
  "analysis_preset": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
  "answered_by_enabled": true,
  "available_tags": [
    "got_full_name_and_number",
    "no_information_provided"
  ],
  "geospatial_dialing": "bd039087-decb-435a-a6e3-ca1ffbf89974",
  "precall_dtmf_sequence": "1234567890*#w",
  "pool_id": "#1234-5678-9012-3456",
  "for_user_id": 123,
  "agency_id": 123,
  "calendarID": "<string>",
  "firstSentence": "<string>",
  "calendarName": "<string>",
  "customTool": "<string>",
  "fromAdmin": true,
  "fromAgency": 123,
  "background_track": "<string>",
  "block_interruptions": 123,
  "transferPhoneNumber": [
    {
      "transfer_number": "<string>",
      "transfer_type": "<string>"
    }
  ],
  "voiceMail_action": "<string>",
  "agentPhones": [
    "<string>"
  ],
  "pathwayID": "<string>",
  "voicemailDetection": "<string>",
  "memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "webhook": {
    "name": "WEBHOOK JSON TEMPLATES",
    "description": "TEMPLATES",
    "speech": "speech",
    "url": "https://templates.com",
    "method": "POST",
    "headers": {
      "Authorization": "########",
      "Content-Type": "application/json"
    },
    "body": {
      "BODY1": "LOREM",
      "BODY2": "LOREM"
    },
    "timeout": 10000
  },
  "get_data": {
    "fields": {
      "url": "<string>",
      "name": "<string>",
      "description": "<string>",
      "speech": "<string>",
      "method": "<string>",
      "timeout": 123
    },
    "headers": [
      {
        "id": 123,
        "authorization": "<string>",
        "apiKey": "<string>"
      }
    ],
    "response": [
      {
        "id": 123,
        "number": "<string>",
        "type": "<string>"
      }
    ]
  },
  "sms": {
    "name": "<string>",
    "description": "<string>",
    "speech": "<string>",
    "body": "<string>"
  },
  "retry_wait": 10,
  "retry_voicemail_action": "leave_message",
  "retry_voicemail_message": "Hello, this is a test message."
}
'

Authorizations

x-api-key
string
header
required

API Key for authentication

Body

application/json
agentName
string
required
task
string
required
model
string
required
temperature
number
required
wait_for_greeting
string
required
max_duration
number
required
selectedVoice
string
required
voiceId
string
required
selectedLanguage
string
required
voiceSpeed
number
required
interruptionThreshold
number
required
startTime
string<date-time>
required
isGHL
number
required
appointmentAgent
number
required
from_admin
number
required
knowledgeBases
object[]
required
questionsData
any[]
required
pronunciationGuide
object[]
required
noise_cancellation
boolean
required

Whether to enable noise cancellation

Example:

false

keywords
string[]
required

Keywords to boost in transcription

Example:
["keyword1", "keyword2"]
timezone
string
required

Timezone for the call

Example:

"America/Los_Angeles"

request_data
object
required

Request data available to the AI agent during the call

Example:
{ "name": "John Doe", "age": 30 }
start_time
string
required

Scheduled start time for the call

Example:

"2024-03-20 12:00:00 -05:00"

voicemail_message
string
required

Message to leave on voicemail

Example:

"Please leave a message after the beep"

voicemail_action
enum<string>
required

Action to take when voicemail is detected

Available options:
hangup,
leave_message,
ignore
Example:

"hangup"

retry
object
required

Retry configuration for voicemail calls

Example:
{
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
}
record
boolean
required

Whether to record the call

Example:

true

webhook_events
string[]
required

Events to stream to webhook

Example:
["queue", "call", "latency"]
citation_schema_id
string
required

Citation schema ID for post-call analysis

Example:

"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt"

analysis_preset
string
required

Analysis preset UUID

Example:

"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7"

answered_by_enabled
boolean
required

Whether to enable answered-by detection

Example:

true

available_tags
string[]
required

Available disposition tags

Example:
[
"got_full_name_and_number",
"no_information_provided"
]
geospatial_dialing
string
required

Geospatial dialing pool UUID

Example:

"bd039087-decb-435a-a6e3-ca1ffbf89974"

precall_dtmf_sequence
string
required

DTMF sequence to play before call starts

Example:

"1234567890*#w"

pool_id
string
required

Pool ID

Example:

"#1234-5678-9012-3456"

for_user_id
number
agency_id
number
calendarID
string
firstSentence
string
calendarName
string
customTool
string
fromAdmin
boolean
fromAgency
number
background_track
string
block_interruptions
number
transferPhoneNumber
object[]
voiceMail_action
string
agentPhones
string[]
pathwayID
string
voicemailDetection
string
memory_id
string

UUID of the memory to associate with this agent

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

webhook
object

Webhook configuration

get_data
object

Get data configuration

sms
object

SMS configuration

retry_wait
number

Retry wait time in seconds (alternative to retry object)

Example:

10

retry_voicemail_action
string

Retry voicemail action (alternative to retry object)

Example:

"leave_message"

retry_voicemail_message
string

Retry voicemail message (alternative to retry object)

Example:

"Hello, this is a test message."

Response

Agent created successfully