Create Call
curl --request POST \
--url https://api.kejue.co/api/v1/calls \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"contact_id": "<string>",
"contact": {
"phone": "<string>",
"whatsapp_number": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"job_title": "<string>",
"country": "<string>",
"timezone": "<string>",
"language": "<string>",
"tags": [
"<string>"
],
"metadata": {}
},
"persona_id": "<string>",
"agent_id": "<string>",
"phone_number_id": "<string>",
"schedule_at": "2023-11-07T05:31:56Z",
"priority": 50,
"config": {
"prompt": "<string>",
"first_message": "<string>",
"first_message_uninterruptible": true,
"voice_id": "<string>",
"temperature": 1,
"max_duration": 3615,
"silence_timeout": 62,
"recording_enabled": true,
"language_locale": "<string>",
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"call_start_hour": 11,
"call_start_minute": 29,
"call_end_hour": 11,
"call_end_minute": 29,
"allowed_days": [
123
],
"auto_retry": true,
"retry_schedule": [
123
],
"scoring_criteria": "<string>",
"tools": [
{
"id": "<string>",
"config": {}
}
],
"tags": [
{
"name": "<string>",
"description": "<string>"
}
],
"structured_data_schema": [
{
"key": "<string>",
"description": "<string>"
}
],
"server_url": "<string>",
"server_secret": "<string>",
"webhooks": [
{
"url": "<string>",
"events": [],
"signing_method": "hmac_sha256",
"secret": "<string>"
}
],
"webhook_ids": [
"<string>"
]
},
"external_reference": "<string>",
"context": {}
}
'import requests
url = "https://api.kejue.co/api/v1/calls"
payload = {
"contact_id": "<string>",
"contact": {
"phone": "<string>",
"whatsapp_number": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"job_title": "<string>",
"country": "<string>",
"timezone": "<string>",
"language": "<string>",
"tags": ["<string>"],
"metadata": {}
},
"persona_id": "<string>",
"agent_id": "<string>",
"phone_number_id": "<string>",
"schedule_at": "2023-11-07T05:31:56Z",
"priority": 50,
"config": {
"prompt": "<string>",
"first_message": "<string>",
"first_message_uninterruptible": True,
"voice_id": "<string>",
"temperature": 1,
"max_duration": 3615,
"silence_timeout": 62,
"recording_enabled": True,
"language_locale": "<string>",
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"call_start_hour": 11,
"call_start_minute": 29,
"call_end_hour": 11,
"call_end_minute": 29,
"allowed_days": [123],
"auto_retry": True,
"retry_schedule": [123],
"scoring_criteria": "<string>",
"tools": [
{
"id": "<string>",
"config": {}
}
],
"tags": [
{
"name": "<string>",
"description": "<string>"
}
],
"structured_data_schema": [
{
"key": "<string>",
"description": "<string>"
}
],
"server_url": "<string>",
"server_secret": "<string>",
"webhooks": [
{
"url": "<string>",
"events": [],
"signing_method": "hmac_sha256",
"secret": "<string>"
}
],
"webhook_ids": ["<string>"]
},
"external_reference": "<string>",
"context": {}
}
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({
contact_id: '<string>',
contact: {
phone: '<string>',
whatsapp_number: '<string>',
email: '<string>',
first_name: '<string>',
last_name: '<string>',
company: '<string>',
job_title: '<string>',
country: '<string>',
timezone: '<string>',
language: '<string>',
tags: ['<string>'],
metadata: {}
},
persona_id: '<string>',
agent_id: '<string>',
phone_number_id: '<string>',
schedule_at: '2023-11-07T05:31:56Z',
priority: 50,
config: {
prompt: '<string>',
first_message: '<string>',
first_message_uninterruptible: true,
voice_id: '<string>',
temperature: 1,
max_duration: 3615,
silence_timeout: 62,
recording_enabled: true,
language_locale: '<string>',
inactivity_messages: [
{
delay_seconds: 15,
end_behavior: 'END_BEHAVIOR_UNSPECIFIED',
message: 'Are you still there?'
}
],
call_start_hour: 11,
call_start_minute: 29,
call_end_hour: 11,
call_end_minute: 29,
allowed_days: [123],
auto_retry: true,
retry_schedule: [123],
scoring_criteria: '<string>',
tools: [{id: '<string>', config: {}}],
tags: [{name: '<string>', description: '<string>'}],
structured_data_schema: [{key: '<string>', description: '<string>'}],
server_url: '<string>',
server_secret: '<string>',
webhooks: [
{url: '<string>', events: [], signing_method: 'hmac_sha256', secret: '<string>'}
],
webhook_ids: ['<string>']
},
external_reference: '<string>',
context: {}
})
};
fetch('https://api.kejue.co/api/v1/calls', 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/calls",
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([
'contact_id' => '<string>',
'contact' => [
'phone' => '<string>',
'whatsapp_number' => '<string>',
'email' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'job_title' => '<string>',
'country' => '<string>',
'timezone' => '<string>',
'language' => '<string>',
'tags' => [
'<string>'
],
'metadata' => [
]
],
'persona_id' => '<string>',
'agent_id' => '<string>',
'phone_number_id' => '<string>',
'schedule_at' => '2023-11-07T05:31:56Z',
'priority' => 50,
'config' => [
'prompt' => '<string>',
'first_message' => '<string>',
'first_message_uninterruptible' => true,
'voice_id' => '<string>',
'temperature' => 1,
'max_duration' => 3615,
'silence_timeout' => 62,
'recording_enabled' => true,
'language_locale' => '<string>',
'inactivity_messages' => [
[
'delay_seconds' => 15,
'end_behavior' => 'END_BEHAVIOR_UNSPECIFIED',
'message' => 'Are you still there?'
]
],
'call_start_hour' => 11,
'call_start_minute' => 29,
'call_end_hour' => 11,
'call_end_minute' => 29,
'allowed_days' => [
123
],
'auto_retry' => true,
'retry_schedule' => [
123
],
'scoring_criteria' => '<string>',
'tools' => [
[
'id' => '<string>',
'config' => [
]
]
],
'tags' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'structured_data_schema' => [
[
'key' => '<string>',
'description' => '<string>'
]
],
'server_url' => '<string>',
'server_secret' => '<string>',
'webhooks' => [
[
'url' => '<string>',
'events' => [
],
'signing_method' => 'hmac_sha256',
'secret' => '<string>'
]
],
'webhook_ids' => [
'<string>'
]
],
'external_reference' => '<string>',
'context' => [
]
]),
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/calls"
payload := strings.NewReader("{\n \"contact_id\": \"<string>\",\n \"contact\": {\n \"phone\": \"<string>\",\n \"whatsapp_number\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"job_title\": \"<string>\",\n \"country\": \"<string>\",\n \"timezone\": \"<string>\",\n \"language\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n },\n \"persona_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"schedule_at\": \"2023-11-07T05:31:56Z\",\n \"priority\": 50,\n \"config\": {\n \"prompt\": \"<string>\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": true,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"max_duration\": 3615,\n \"silence_timeout\": 62,\n \"recording_enabled\": true,\n \"language_locale\": \"<string>\",\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"call_start_hour\": 11,\n \"call_start_minute\": 29,\n \"call_end_hour\": 11,\n \"call_end_minute\": 29,\n \"allowed_days\": [\n 123\n ],\n \"auto_retry\": true,\n \"retry_schedule\": [\n 123\n ],\n \"scoring_criteria\": \"<string>\",\n \"tools\": [\n {\n \"id\": \"<string>\",\n \"config\": {}\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"structured_data_schema\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"server_url\": \"<string>\",\n \"server_secret\": \"<string>\",\n \"webhooks\": [\n {\n \"url\": \"<string>\",\n \"events\": [],\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\"\n }\n ],\n \"webhook_ids\": [\n \"<string>\"\n ]\n },\n \"external_reference\": \"<string>\",\n \"context\": {}\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/calls")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"<string>\",\n \"contact\": {\n \"phone\": \"<string>\",\n \"whatsapp_number\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"job_title\": \"<string>\",\n \"country\": \"<string>\",\n \"timezone\": \"<string>\",\n \"language\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n },\n \"persona_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"schedule_at\": \"2023-11-07T05:31:56Z\",\n \"priority\": 50,\n \"config\": {\n \"prompt\": \"<string>\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": true,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"max_duration\": 3615,\n \"silence_timeout\": 62,\n \"recording_enabled\": true,\n \"language_locale\": \"<string>\",\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"call_start_hour\": 11,\n \"call_start_minute\": 29,\n \"call_end_hour\": 11,\n \"call_end_minute\": 29,\n \"allowed_days\": [\n 123\n ],\n \"auto_retry\": true,\n \"retry_schedule\": [\n 123\n ],\n \"scoring_criteria\": \"<string>\",\n \"tools\": [\n {\n \"id\": \"<string>\",\n \"config\": {}\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"structured_data_schema\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"server_url\": \"<string>\",\n \"server_secret\": \"<string>\",\n \"webhooks\": [\n {\n \"url\": \"<string>\",\n \"events\": [],\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\"\n }\n ],\n \"webhook_ids\": [\n \"<string>\"\n ]\n },\n \"external_reference\": \"<string>\",\n \"context\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/calls")
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 \"contact_id\": \"<string>\",\n \"contact\": {\n \"phone\": \"<string>\",\n \"whatsapp_number\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"job_title\": \"<string>\",\n \"country\": \"<string>\",\n \"timezone\": \"<string>\",\n \"language\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n },\n \"persona_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"schedule_at\": \"2023-11-07T05:31:56Z\",\n \"priority\": 50,\n \"config\": {\n \"prompt\": \"<string>\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": true,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"max_duration\": 3615,\n \"silence_timeout\": 62,\n \"recording_enabled\": true,\n \"language_locale\": \"<string>\",\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"call_start_hour\": 11,\n \"call_start_minute\": 29,\n \"call_end_hour\": 11,\n \"call_end_minute\": 29,\n \"allowed_days\": [\n 123\n ],\n \"auto_retry\": true,\n \"retry_schedule\": [\n 123\n ],\n \"scoring_criteria\": \"<string>\",\n \"tools\": [\n {\n \"id\": \"<string>\",\n \"config\": {}\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"structured_data_schema\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"server_url\": \"<string>\",\n \"server_secret\": \"<string>\",\n \"webhooks\": [\n {\n \"url\": \"<string>\",\n \"events\": [],\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\"\n }\n ],\n \"webhook_ids\": [\n \"<string>\"\n ]\n },\n \"external_reference\": \"<string>\",\n \"context\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"contact_id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"scheduled_at": "2023-11-07T05:31:56Z"
}{
"error": "Invalid phone number: not a valid E.164 number",
"code": "BAD_REQUEST",
"details": {}
}{
"error": "Invalid or missing API key",
"code": "UNAUTHORIZED",
"details": {}
}{
"error": "Contact not found",
"code": "NOT_FOUND",
"details": {
"contact_id": "non_existent_id"
}
}{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Calls
Create Call
Create a single outbound call.
Pass either contact_id for an existing contact, or contact to
create a new contact inline. Country, timezone, and language are
auto-deduced from the phone number when not provided.
Dynamic variables can be passed via context — they are rendered into
the agent’s prompt using {{variable_name}} syntax.
POST
/
calls
Create Call
curl --request POST \
--url https://api.kejue.co/api/v1/calls \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"contact_id": "<string>",
"contact": {
"phone": "<string>",
"whatsapp_number": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"job_title": "<string>",
"country": "<string>",
"timezone": "<string>",
"language": "<string>",
"tags": [
"<string>"
],
"metadata": {}
},
"persona_id": "<string>",
"agent_id": "<string>",
"phone_number_id": "<string>",
"schedule_at": "2023-11-07T05:31:56Z",
"priority": 50,
"config": {
"prompt": "<string>",
"first_message": "<string>",
"first_message_uninterruptible": true,
"voice_id": "<string>",
"temperature": 1,
"max_duration": 3615,
"silence_timeout": 62,
"recording_enabled": true,
"language_locale": "<string>",
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"call_start_hour": 11,
"call_start_minute": 29,
"call_end_hour": 11,
"call_end_minute": 29,
"allowed_days": [
123
],
"auto_retry": true,
"retry_schedule": [
123
],
"scoring_criteria": "<string>",
"tools": [
{
"id": "<string>",
"config": {}
}
],
"tags": [
{
"name": "<string>",
"description": "<string>"
}
],
"structured_data_schema": [
{
"key": "<string>",
"description": "<string>"
}
],
"server_url": "<string>",
"server_secret": "<string>",
"webhooks": [
{
"url": "<string>",
"events": [],
"signing_method": "hmac_sha256",
"secret": "<string>"
}
],
"webhook_ids": [
"<string>"
]
},
"external_reference": "<string>",
"context": {}
}
'import requests
url = "https://api.kejue.co/api/v1/calls"
payload = {
"contact_id": "<string>",
"contact": {
"phone": "<string>",
"whatsapp_number": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"job_title": "<string>",
"country": "<string>",
"timezone": "<string>",
"language": "<string>",
"tags": ["<string>"],
"metadata": {}
},
"persona_id": "<string>",
"agent_id": "<string>",
"phone_number_id": "<string>",
"schedule_at": "2023-11-07T05:31:56Z",
"priority": 50,
"config": {
"prompt": "<string>",
"first_message": "<string>",
"first_message_uninterruptible": True,
"voice_id": "<string>",
"temperature": 1,
"max_duration": 3615,
"silence_timeout": 62,
"recording_enabled": True,
"language_locale": "<string>",
"inactivity_messages": [
{
"delay_seconds": 15,
"end_behavior": "END_BEHAVIOR_UNSPECIFIED",
"message": "Are you still there?"
}
],
"call_start_hour": 11,
"call_start_minute": 29,
"call_end_hour": 11,
"call_end_minute": 29,
"allowed_days": [123],
"auto_retry": True,
"retry_schedule": [123],
"scoring_criteria": "<string>",
"tools": [
{
"id": "<string>",
"config": {}
}
],
"tags": [
{
"name": "<string>",
"description": "<string>"
}
],
"structured_data_schema": [
{
"key": "<string>",
"description": "<string>"
}
],
"server_url": "<string>",
"server_secret": "<string>",
"webhooks": [
{
"url": "<string>",
"events": [],
"signing_method": "hmac_sha256",
"secret": "<string>"
}
],
"webhook_ids": ["<string>"]
},
"external_reference": "<string>",
"context": {}
}
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({
contact_id: '<string>',
contact: {
phone: '<string>',
whatsapp_number: '<string>',
email: '<string>',
first_name: '<string>',
last_name: '<string>',
company: '<string>',
job_title: '<string>',
country: '<string>',
timezone: '<string>',
language: '<string>',
tags: ['<string>'],
metadata: {}
},
persona_id: '<string>',
agent_id: '<string>',
phone_number_id: '<string>',
schedule_at: '2023-11-07T05:31:56Z',
priority: 50,
config: {
prompt: '<string>',
first_message: '<string>',
first_message_uninterruptible: true,
voice_id: '<string>',
temperature: 1,
max_duration: 3615,
silence_timeout: 62,
recording_enabled: true,
language_locale: '<string>',
inactivity_messages: [
{
delay_seconds: 15,
end_behavior: 'END_BEHAVIOR_UNSPECIFIED',
message: 'Are you still there?'
}
],
call_start_hour: 11,
call_start_minute: 29,
call_end_hour: 11,
call_end_minute: 29,
allowed_days: [123],
auto_retry: true,
retry_schedule: [123],
scoring_criteria: '<string>',
tools: [{id: '<string>', config: {}}],
tags: [{name: '<string>', description: '<string>'}],
structured_data_schema: [{key: '<string>', description: '<string>'}],
server_url: '<string>',
server_secret: '<string>',
webhooks: [
{url: '<string>', events: [], signing_method: 'hmac_sha256', secret: '<string>'}
],
webhook_ids: ['<string>']
},
external_reference: '<string>',
context: {}
})
};
fetch('https://api.kejue.co/api/v1/calls', 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/calls",
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([
'contact_id' => '<string>',
'contact' => [
'phone' => '<string>',
'whatsapp_number' => '<string>',
'email' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'job_title' => '<string>',
'country' => '<string>',
'timezone' => '<string>',
'language' => '<string>',
'tags' => [
'<string>'
],
'metadata' => [
]
],
'persona_id' => '<string>',
'agent_id' => '<string>',
'phone_number_id' => '<string>',
'schedule_at' => '2023-11-07T05:31:56Z',
'priority' => 50,
'config' => [
'prompt' => '<string>',
'first_message' => '<string>',
'first_message_uninterruptible' => true,
'voice_id' => '<string>',
'temperature' => 1,
'max_duration' => 3615,
'silence_timeout' => 62,
'recording_enabled' => true,
'language_locale' => '<string>',
'inactivity_messages' => [
[
'delay_seconds' => 15,
'end_behavior' => 'END_BEHAVIOR_UNSPECIFIED',
'message' => 'Are you still there?'
]
],
'call_start_hour' => 11,
'call_start_minute' => 29,
'call_end_hour' => 11,
'call_end_minute' => 29,
'allowed_days' => [
123
],
'auto_retry' => true,
'retry_schedule' => [
123
],
'scoring_criteria' => '<string>',
'tools' => [
[
'id' => '<string>',
'config' => [
]
]
],
'tags' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'structured_data_schema' => [
[
'key' => '<string>',
'description' => '<string>'
]
],
'server_url' => '<string>',
'server_secret' => '<string>',
'webhooks' => [
[
'url' => '<string>',
'events' => [
],
'signing_method' => 'hmac_sha256',
'secret' => '<string>'
]
],
'webhook_ids' => [
'<string>'
]
],
'external_reference' => '<string>',
'context' => [
]
]),
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/calls"
payload := strings.NewReader("{\n \"contact_id\": \"<string>\",\n \"contact\": {\n \"phone\": \"<string>\",\n \"whatsapp_number\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"job_title\": \"<string>\",\n \"country\": \"<string>\",\n \"timezone\": \"<string>\",\n \"language\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n },\n \"persona_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"schedule_at\": \"2023-11-07T05:31:56Z\",\n \"priority\": 50,\n \"config\": {\n \"prompt\": \"<string>\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": true,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"max_duration\": 3615,\n \"silence_timeout\": 62,\n \"recording_enabled\": true,\n \"language_locale\": \"<string>\",\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"call_start_hour\": 11,\n \"call_start_minute\": 29,\n \"call_end_hour\": 11,\n \"call_end_minute\": 29,\n \"allowed_days\": [\n 123\n ],\n \"auto_retry\": true,\n \"retry_schedule\": [\n 123\n ],\n \"scoring_criteria\": \"<string>\",\n \"tools\": [\n {\n \"id\": \"<string>\",\n \"config\": {}\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"structured_data_schema\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"server_url\": \"<string>\",\n \"server_secret\": \"<string>\",\n \"webhooks\": [\n {\n \"url\": \"<string>\",\n \"events\": [],\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\"\n }\n ],\n \"webhook_ids\": [\n \"<string>\"\n ]\n },\n \"external_reference\": \"<string>\",\n \"context\": {}\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/calls")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"<string>\",\n \"contact\": {\n \"phone\": \"<string>\",\n \"whatsapp_number\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"job_title\": \"<string>\",\n \"country\": \"<string>\",\n \"timezone\": \"<string>\",\n \"language\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n },\n \"persona_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"schedule_at\": \"2023-11-07T05:31:56Z\",\n \"priority\": 50,\n \"config\": {\n \"prompt\": \"<string>\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": true,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"max_duration\": 3615,\n \"silence_timeout\": 62,\n \"recording_enabled\": true,\n \"language_locale\": \"<string>\",\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"call_start_hour\": 11,\n \"call_start_minute\": 29,\n \"call_end_hour\": 11,\n \"call_end_minute\": 29,\n \"allowed_days\": [\n 123\n ],\n \"auto_retry\": true,\n \"retry_schedule\": [\n 123\n ],\n \"scoring_criteria\": \"<string>\",\n \"tools\": [\n {\n \"id\": \"<string>\",\n \"config\": {}\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"structured_data_schema\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"server_url\": \"<string>\",\n \"server_secret\": \"<string>\",\n \"webhooks\": [\n {\n \"url\": \"<string>\",\n \"events\": [],\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\"\n }\n ],\n \"webhook_ids\": [\n \"<string>\"\n ]\n },\n \"external_reference\": \"<string>\",\n \"context\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/calls")
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 \"contact_id\": \"<string>\",\n \"contact\": {\n \"phone\": \"<string>\",\n \"whatsapp_number\": \"<string>\",\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"job_title\": \"<string>\",\n \"country\": \"<string>\",\n \"timezone\": \"<string>\",\n \"language\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n },\n \"persona_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"schedule_at\": \"2023-11-07T05:31:56Z\",\n \"priority\": 50,\n \"config\": {\n \"prompt\": \"<string>\",\n \"first_message\": \"<string>\",\n \"first_message_uninterruptible\": true,\n \"voice_id\": \"<string>\",\n \"temperature\": 1,\n \"max_duration\": 3615,\n \"silence_timeout\": 62,\n \"recording_enabled\": true,\n \"language_locale\": \"<string>\",\n \"inactivity_messages\": [\n {\n \"delay_seconds\": 15,\n \"end_behavior\": \"END_BEHAVIOR_UNSPECIFIED\",\n \"message\": \"Are you still there?\"\n }\n ],\n \"call_start_hour\": 11,\n \"call_start_minute\": 29,\n \"call_end_hour\": 11,\n \"call_end_minute\": 29,\n \"allowed_days\": [\n 123\n ],\n \"auto_retry\": true,\n \"retry_schedule\": [\n 123\n ],\n \"scoring_criteria\": \"<string>\",\n \"tools\": [\n {\n \"id\": \"<string>\",\n \"config\": {}\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"structured_data_schema\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"server_url\": \"<string>\",\n \"server_secret\": \"<string>\",\n \"webhooks\": [\n {\n \"url\": \"<string>\",\n \"events\": [],\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\"\n }\n ],\n \"webhook_ids\": [\n \"<string>\"\n ]\n },\n \"external_reference\": \"<string>\",\n \"context\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"contact_id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"scheduled_at": "2023-11-07T05:31:56Z"
}{
"error": "Invalid phone number: not a valid E.164 number",
"code": "BAD_REQUEST",
"details": {}
}{
"error": "Invalid or missing API key",
"code": "UNAUTHORIZED",
"details": {}
}{
"error": "Contact not found",
"code": "NOT_FOUND",
"details": {
"contact_id": "non_existent_id"
}
}{
"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
application/json
Public API call creation request.
Existing contact ID
New contact to create inline
Show child attributes
Show child attributes
Agent (persona) to use
Voice config ID
Pin a specific origin phone number
Schedule for later (ISO 8601)
Queue priority (higher = sooner)
Required range:
0 <= x <= 100Call configuration
Show child attributes
Show child attributes
External tracking ID
Maximum string length:
255Template variables for prompt
⌘I

