curl --request POST \
--url https://api.kejue.co/api/v1/agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"avatar": "<string>",
"memory_enabled": true,
"call_settings": {
"allowed_days": [
0,
1,
2,
3,
4
],
"auto_retry": true,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [
60,
240
],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
},
"voice_config": {
"language_locale": "<string>",
"name": "<string>",
"prompt": "<string>",
"first_speaker": "agent",
"first_message": "<string>",
"first_message_uninterruptible": false,
"first_message_delay_ms": 1,
"voice_id": "<string>",
"temperature": 1,
"recording_enabled": true,
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"silence_timeout": 62,
"max_duration": 3615,
"is_default": false,
"config": {}
},
"tools": [
{
"tool_name": "<string>",
"tool_id": "<string>",
"channels": [
"voice:in-call"
],
"config": {}
}
]
}
'import requests
url = "https://api.kejue.co/api/v1/agents"
payload = {
"name": "<string>",
"description": "<string>",
"avatar": "<string>",
"memory_enabled": True,
"call_settings": {
"allowed_days": [0, 1, 2, 3, 4],
"auto_retry": True,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [60, 240],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
},
"voice_config": {
"language_locale": "<string>",
"name": "<string>",
"prompt": "<string>",
"first_speaker": "agent",
"first_message": "<string>",
"first_message_uninterruptible": False,
"first_message_delay_ms": 1,
"voice_id": "<string>",
"temperature": 1,
"recording_enabled": True,
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"silence_timeout": 62,
"max_duration": 3615,
"is_default": False,
"config": {}
},
"tools": [
{
"tool_name": "<string>",
"tool_id": "<string>",
"channels": ["voice:in-call"],
"config": {}
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
avatar: '<string>',
memory_enabled: true,
call_settings: {
allowed_days: [0, 1, 2, 3, 4],
auto_retry: true,
call_end_hour: 17,
call_start_hour: 9,
phone_assignment_mode: 'local',
retry_schedule: [60, 240],
scoring_criteria: 'Score 0-100 based on buying intent',
structured_data_schema: [
{description: 'Stated budget range', key: 'budget'},
{description: 'Decision timeline', key: 'timeline'}
],
tags: [
{description: 'Contact expressed buying interest', name: 'Interested'},
{description: 'Contact requested a follow-up call', name: 'Follow-up'}
]
},
voice_config: {
language_locale: '<string>',
name: '<string>',
prompt: '<string>',
first_speaker: 'agent',
first_message: '<string>',
first_message_uninterruptible: false,
first_message_delay_ms: 1,
voice_id: '<string>',
temperature: 1,
recording_enabled: true,
inactivity_messages: [
{
delay_seconds: 15,
end_behavior: 'END_BEHAVIOR_UNSPECIFIED',
message: 'Are you still there?'
}
],
silence_timeout: 62,
max_duration: 3615,
is_default: false,
config: {}
},
tools: [
{
tool_name: '<string>',
tool_id: '<string>',
channels: ['voice:in-call'],
config: {}
}
]
})
};
fetch('https://api.kejue.co/api/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kejue.co/api/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'avatar' => '<string>',
'memory_enabled' => true,
'call_settings' => [
'allowed_days' => [
0,
1,
2,
3,
4
],
'auto_retry' => true,
'call_end_hour' => 17,
'call_start_hour' => 9,
'phone_assignment_mode' => 'local',
'retry_schedule' => [
60,
240
],
'scoring_criteria' => 'Score 0-100 based on buying intent',
'structured_data_schema' => [
[
'description' => 'Stated budget range',
'key' => 'budget'
],
[
'description' => 'Decision timeline',
'key' => 'timeline'
]
],
'tags' => [
[
'description' => 'Contact expressed buying interest',
'name' => 'Interested'
],
[
'description' => 'Contact requested a follow-up call',
'name' => 'Follow-up'
]
]
],
'voice_config' => [
'language_locale' => '<string>',
'name' => '<string>',
'prompt' => '<string>',
'first_speaker' => 'agent',
'first_message' => '<string>',
'first_message_uninterruptible' => false,
'first_message_delay_ms' => 1,
'voice_id' => '<string>',
'temperature' => 1,
'recording_enabled' => true,
'inactivity_messages' => [
[
'delay_seconds' => 15,
'end_behavior' => 'END_BEHAVIOR_UNSPECIFIED',
'message' => 'Are you still there?'
]
],
'silence_timeout' => 62,
'max_duration' => 3615,
'is_default' => false,
'config' => [
]
],
'tools' => [
[
'tool_name' => '<string>',
'tool_id' => '<string>',
'channels' => [
'voice:in-call'
],
'config' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kejue.co/api/v1/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"avatar\": \"<string>\",\n \"memory_enabled\": true,\n \"call_settings\": {\n \"allowed_days\": [\n 0,\n 1,\n 2,\n 3,\n 4\n ],\n \"auto_retry\": true,\n \"call_end_hour\": 17,\n \"call_start_hour\": 9,\n \"phone_assignment_mode\": \"local\",\n \"retry_schedule\": [\n 60,\n 240\n ],\n \"scoring_criteria\": \"Score 0-100 based on buying intent\",\n \"structured_data_schema\": [\n {\n \"description\": \"Stated budget range\",\n \"key\": \"budget\"\n },\n {\n \"description\": \"Decision timeline\",\n \"key\": \"timeline\"\n }\n ],\n \"tags\": [\n {\n \"description\": \"Contact expressed buying interest\",\n \"name\": \"Interested\"\n },\n {\n \"description\": \"Contact requested a follow-up call\",\n \"name\": \"Follow-up\"\n }\n ]\n },\n \"voice_config\": {\n \"language_locale\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"first_speaker\": \"agent\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": false,\n \"first_message_delay_ms\": 1,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"recording_enabled\": true,\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"silence_timeout\": 62,\n \"max_duration\": 3615,\n \"is_default\": false,\n \"config\": {}\n },\n \"tools\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_id\": \"<string>\",\n \"channels\": [\n \"voice:in-call\"\n ],\n \"config\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kejue.co/api/v1/agents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"avatar\": \"<string>\",\n \"memory_enabled\": true,\n \"call_settings\": {\n \"allowed_days\": [\n 0,\n 1,\n 2,\n 3,\n 4\n ],\n \"auto_retry\": true,\n \"call_end_hour\": 17,\n \"call_start_hour\": 9,\n \"phone_assignment_mode\": \"local\",\n \"retry_schedule\": [\n 60,\n 240\n ],\n \"scoring_criteria\": \"Score 0-100 based on buying intent\",\n \"structured_data_schema\": [\n {\n \"description\": \"Stated budget range\",\n \"key\": \"budget\"\n },\n {\n \"description\": \"Decision timeline\",\n \"key\": \"timeline\"\n }\n ],\n \"tags\": [\n {\n \"description\": \"Contact expressed buying interest\",\n \"name\": \"Interested\"\n },\n {\n \"description\": \"Contact requested a follow-up call\",\n \"name\": \"Follow-up\"\n }\n ]\n },\n \"voice_config\": {\n \"language_locale\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"first_speaker\": \"agent\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": false,\n \"first_message_delay_ms\": 1,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"recording_enabled\": true,\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"silence_timeout\": 62,\n \"max_duration\": 3615,\n \"is_default\": false,\n \"config\": {}\n },\n \"tools\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_id\": \"<string>\",\n \"channels\": [\n \"voice:in-call\"\n ],\n \"config\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"avatar\": \"<string>\",\n \"memory_enabled\": true,\n \"call_settings\": {\n \"allowed_days\": [\n 0,\n 1,\n 2,\n 3,\n 4\n ],\n \"auto_retry\": true,\n \"call_end_hour\": 17,\n \"call_start_hour\": 9,\n \"phone_assignment_mode\": \"local\",\n \"retry_schedule\": [\n 60,\n 240\n ],\n \"scoring_criteria\": \"Score 0-100 based on buying intent\",\n \"structured_data_schema\": [\n {\n \"description\": \"Stated budget range\",\n \"key\": \"budget\"\n },\n {\n \"description\": \"Decision timeline\",\n \"key\": \"timeline\"\n }\n ],\n \"tags\": [\n {\n \"description\": \"Contact expressed buying interest\",\n \"name\": \"Interested\"\n },\n {\n \"description\": \"Contact requested a follow-up call\",\n \"name\": \"Follow-up\"\n }\n ]\n },\n \"voice_config\": {\n \"language_locale\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"first_speaker\": \"agent\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": false,\n \"first_message_delay_ms\": 1,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"recording_enabled\": true,\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"silence_timeout\": 62,\n \"max_duration\": 3615,\n \"is_default\": false,\n \"config\": {}\n },\n \"tools\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_id\": \"<string>\",\n \"channels\": [\n \"voice:in-call\"\n ],\n \"config\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"is_active": true,
"memory_enabled": true,
"description": "<string>",
"call_settings": {
"allowed_days": [
0,
1,
2,
3,
4
],
"auto_retry": true,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [
60,
240
],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
},
"voice_configs": [
{
"id": "<string>",
"name": "<string>",
"language_locale": "<string>",
"prompt": "<string>",
"first_speaker": "<string>",
"recording_enabled": true,
"silence_timeout": 123,
"max_duration": 123,
"is_default": true,
"is_active": true,
"first_message": "<string>",
"first_message_uninterruptible": false,
"first_message_delay_ms": 123,
"voice_id": "<string>",
"voice_name": "<string>",
"model": "<string>",
"temperature": 123,
"inactivity_messages": [
{}
],
"corpus_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
],
"tools": [
{
"tool_name": "<string>",
"channels": [
"<string>"
],
"config": {},
"tool_id": "<string>"
}
],
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": "Invalid or missing API key",
"code": "UNAUTHORIZED",
"details": {}
}{
"error": "Agent limit reached for your plan",
"code": "FORBIDDEN",
"details": {}
}{
"error": "An agent with this name already exists",
"code": "CONFLICT",
"details": {}
}{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Create Agent
Create a new agent.
Optionally include an initial voice configuration and tool attachments in the same request.
curl --request POST \
--url https://api.kejue.co/api/v1/agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"avatar": "<string>",
"memory_enabled": true,
"call_settings": {
"allowed_days": [
0,
1,
2,
3,
4
],
"auto_retry": true,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [
60,
240
],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
},
"voice_config": {
"language_locale": "<string>",
"name": "<string>",
"prompt": "<string>",
"first_speaker": "agent",
"first_message": "<string>",
"first_message_uninterruptible": false,
"first_message_delay_ms": 1,
"voice_id": "<string>",
"temperature": 1,
"recording_enabled": true,
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"silence_timeout": 62,
"max_duration": 3615,
"is_default": false,
"config": {}
},
"tools": [
{
"tool_name": "<string>",
"tool_id": "<string>",
"channels": [
"voice:in-call"
],
"config": {}
}
]
}
'import requests
url = "https://api.kejue.co/api/v1/agents"
payload = {
"name": "<string>",
"description": "<string>",
"avatar": "<string>",
"memory_enabled": True,
"call_settings": {
"allowed_days": [0, 1, 2, 3, 4],
"auto_retry": True,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [60, 240],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
},
"voice_config": {
"language_locale": "<string>",
"name": "<string>",
"prompt": "<string>",
"first_speaker": "agent",
"first_message": "<string>",
"first_message_uninterruptible": False,
"first_message_delay_ms": 1,
"voice_id": "<string>",
"temperature": 1,
"recording_enabled": True,
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"silence_timeout": 62,
"max_duration": 3615,
"is_default": False,
"config": {}
},
"tools": [
{
"tool_name": "<string>",
"tool_id": "<string>",
"channels": ["voice:in-call"],
"config": {}
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
avatar: '<string>',
memory_enabled: true,
call_settings: {
allowed_days: [0, 1, 2, 3, 4],
auto_retry: true,
call_end_hour: 17,
call_start_hour: 9,
phone_assignment_mode: 'local',
retry_schedule: [60, 240],
scoring_criteria: 'Score 0-100 based on buying intent',
structured_data_schema: [
{description: 'Stated budget range', key: 'budget'},
{description: 'Decision timeline', key: 'timeline'}
],
tags: [
{description: 'Contact expressed buying interest', name: 'Interested'},
{description: 'Contact requested a follow-up call', name: 'Follow-up'}
]
},
voice_config: {
language_locale: '<string>',
name: '<string>',
prompt: '<string>',
first_speaker: 'agent',
first_message: '<string>',
first_message_uninterruptible: false,
first_message_delay_ms: 1,
voice_id: '<string>',
temperature: 1,
recording_enabled: true,
inactivity_messages: [
{
delay_seconds: 15,
end_behavior: 'END_BEHAVIOR_UNSPECIFIED',
message: 'Are you still there?'
}
],
silence_timeout: 62,
max_duration: 3615,
is_default: false,
config: {}
},
tools: [
{
tool_name: '<string>',
tool_id: '<string>',
channels: ['voice:in-call'],
config: {}
}
]
})
};
fetch('https://api.kejue.co/api/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kejue.co/api/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'avatar' => '<string>',
'memory_enabled' => true,
'call_settings' => [
'allowed_days' => [
0,
1,
2,
3,
4
],
'auto_retry' => true,
'call_end_hour' => 17,
'call_start_hour' => 9,
'phone_assignment_mode' => 'local',
'retry_schedule' => [
60,
240
],
'scoring_criteria' => 'Score 0-100 based on buying intent',
'structured_data_schema' => [
[
'description' => 'Stated budget range',
'key' => 'budget'
],
[
'description' => 'Decision timeline',
'key' => 'timeline'
]
],
'tags' => [
[
'description' => 'Contact expressed buying interest',
'name' => 'Interested'
],
[
'description' => 'Contact requested a follow-up call',
'name' => 'Follow-up'
]
]
],
'voice_config' => [
'language_locale' => '<string>',
'name' => '<string>',
'prompt' => '<string>',
'first_speaker' => 'agent',
'first_message' => '<string>',
'first_message_uninterruptible' => false,
'first_message_delay_ms' => 1,
'voice_id' => '<string>',
'temperature' => 1,
'recording_enabled' => true,
'inactivity_messages' => [
[
'delay_seconds' => 15,
'end_behavior' => 'END_BEHAVIOR_UNSPECIFIED',
'message' => 'Are you still there?'
]
],
'silence_timeout' => 62,
'max_duration' => 3615,
'is_default' => false,
'config' => [
]
],
'tools' => [
[
'tool_name' => '<string>',
'tool_id' => '<string>',
'channels' => [
'voice:in-call'
],
'config' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kejue.co/api/v1/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"avatar\": \"<string>\",\n \"memory_enabled\": true,\n \"call_settings\": {\n \"allowed_days\": [\n 0,\n 1,\n 2,\n 3,\n 4\n ],\n \"auto_retry\": true,\n \"call_end_hour\": 17,\n \"call_start_hour\": 9,\n \"phone_assignment_mode\": \"local\",\n \"retry_schedule\": [\n 60,\n 240\n ],\n \"scoring_criteria\": \"Score 0-100 based on buying intent\",\n \"structured_data_schema\": [\n {\n \"description\": \"Stated budget range\",\n \"key\": \"budget\"\n },\n {\n \"description\": \"Decision timeline\",\n \"key\": \"timeline\"\n }\n ],\n \"tags\": [\n {\n \"description\": \"Contact expressed buying interest\",\n \"name\": \"Interested\"\n },\n {\n \"description\": \"Contact requested a follow-up call\",\n \"name\": \"Follow-up\"\n }\n ]\n },\n \"voice_config\": {\n \"language_locale\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"first_speaker\": \"agent\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": false,\n \"first_message_delay_ms\": 1,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"recording_enabled\": true,\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"silence_timeout\": 62,\n \"max_duration\": 3615,\n \"is_default\": false,\n \"config\": {}\n },\n \"tools\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_id\": \"<string>\",\n \"channels\": [\n \"voice:in-call\"\n ],\n \"config\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kejue.co/api/v1/agents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"avatar\": \"<string>\",\n \"memory_enabled\": true,\n \"call_settings\": {\n \"allowed_days\": [\n 0,\n 1,\n 2,\n 3,\n 4\n ],\n \"auto_retry\": true,\n \"call_end_hour\": 17,\n \"call_start_hour\": 9,\n \"phone_assignment_mode\": \"local\",\n \"retry_schedule\": [\n 60,\n 240\n ],\n \"scoring_criteria\": \"Score 0-100 based on buying intent\",\n \"structured_data_schema\": [\n {\n \"description\": \"Stated budget range\",\n \"key\": \"budget\"\n },\n {\n \"description\": \"Decision timeline\",\n \"key\": \"timeline\"\n }\n ],\n \"tags\": [\n {\n \"description\": \"Contact expressed buying interest\",\n \"name\": \"Interested\"\n },\n {\n \"description\": \"Contact requested a follow-up call\",\n \"name\": \"Follow-up\"\n }\n ]\n },\n \"voice_config\": {\n \"language_locale\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"first_speaker\": \"agent\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": false,\n \"first_message_delay_ms\": 1,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"recording_enabled\": true,\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"silence_timeout\": 62,\n \"max_duration\": 3615,\n \"is_default\": false,\n \"config\": {}\n },\n \"tools\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_id\": \"<string>\",\n \"channels\": [\n \"voice:in-call\"\n ],\n \"config\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"avatar\": \"<string>\",\n \"memory_enabled\": true,\n \"call_settings\": {\n \"allowed_days\": [\n 0,\n 1,\n 2,\n 3,\n 4\n ],\n \"auto_retry\": true,\n \"call_end_hour\": 17,\n \"call_start_hour\": 9,\n \"phone_assignment_mode\": \"local\",\n \"retry_schedule\": [\n 60,\n 240\n ],\n \"scoring_criteria\": \"Score 0-100 based on buying intent\",\n \"structured_data_schema\": [\n {\n \"description\": \"Stated budget range\",\n \"key\": \"budget\"\n },\n {\n \"description\": \"Decision timeline\",\n \"key\": \"timeline\"\n }\n ],\n \"tags\": [\n {\n \"description\": \"Contact expressed buying interest\",\n \"name\": \"Interested\"\n },\n {\n \"description\": \"Contact requested a follow-up call\",\n \"name\": \"Follow-up\"\n }\n ]\n },\n \"voice_config\": {\n \"language_locale\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"first_speaker\": \"agent\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": false,\n \"first_message_delay_ms\": 1,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"recording_enabled\": true,\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"silence_timeout\": 62,\n \"max_duration\": 3615,\n \"is_default\": false,\n \"config\": {}\n },\n \"tools\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_id\": \"<string>\",\n \"channels\": [\n \"voice:in-call\"\n ],\n \"config\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"is_active": true,
"memory_enabled": true,
"description": "<string>",
"call_settings": {
"allowed_days": [
0,
1,
2,
3,
4
],
"auto_retry": true,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [
60,
240
],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
},
"voice_configs": [
{
"id": "<string>",
"name": "<string>",
"language_locale": "<string>",
"prompt": "<string>",
"first_speaker": "<string>",
"recording_enabled": true,
"silence_timeout": 123,
"max_duration": 123,
"is_default": true,
"is_active": true,
"first_message": "<string>",
"first_message_uninterruptible": false,
"first_message_delay_ms": 123,
"voice_id": "<string>",
"voice_name": "<string>",
"model": "<string>",
"temperature": 123,
"inactivity_messages": [
{}
],
"corpus_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
],
"tools": [
{
"tool_name": "<string>",
"channels": [
"<string>"
],
"config": {},
"tool_id": "<string>"
}
],
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": "Invalid or missing API key",
"code": "UNAUTHORIZED",
"details": {}
}{
"error": "Agent limit reached for your plan",
"code": "FORBIDDEN",
"details": {}
}{
"error": "An agent with this name already exists",
"code": "CONFLICT",
"details": {}
}{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Authorizations
Workspace API key (e.g. kej_live_...)
Body
Create an agent (persona).
Agent name
1 - 255Agent description
Avatar URL
Enable contact memory across conversations
Call settings — call window, retry, scoring, tags, post-call
Show child attributes
Show child attributes
{
"allowed_days": [0, 1, 2, 3, 4],
"auto_retry": true,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [60, 240],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
}
Initial voice configuration
Show child attributes
Show child attributes
Tools to attach to this agent
Show child attributes
Show child attributes
Response
Successful Response
Full agent (persona) response (public-safe).
Unified call settings -- controls call window, retry, scoring, tags, and post-call behavior.
Can be set at agent level or campaign level. Null fields inherit from the parent level. Hierarchy (lowest -> highest priority): System Defaults -> Workspace -> Agent -> Campaign -> API Override.
Show child attributes
Show child attributes
{
"allowed_days": [0, 1, 2, 3, 4],
"auto_retry": true,
"call_end_hour": 17,
"call_start_hour": 9,
"phone_assignment_mode": "local",
"retry_schedule": [60, 240],
"scoring_criteria": "Score 0-100 based on buying intent",
"structured_data_schema": [
{
"description": "Stated budget range",
"key": "budget"
},
{
"description": "Decision timeline",
"key": "timeline"
}
],
"tags": [
{
"description": "Contact expressed buying interest",
"name": "Interested"
},
{
"description": "Contact requested a follow-up call",
"name": "Follow-up"
}
]
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes

