Create Agent
curl --request POST \
--url https://svalync.com/api/agents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"name": "<string>",
"welcomeMessage": "<string>",
"task": "<string>",
"voice": "<string>",
"language": "<string>",
"telephonyProvider": "<string>",
"callTermination": 123,
"hangupMessage": "<string>",
"apiTool": "<any>",
"knowledgeBase": "<string>",
"workflow": "<string>"
}
'import requests
url = "https://svalync.com/api/agents"
payload = {
"name": "<string>",
"welcomeMessage": "<string>",
"task": "<string>",
"voice": "<string>",
"language": "<string>",
"telephonyProvider": "<string>",
"callTermination": 123,
"hangupMessage": "<string>",
"apiTool": "<any>",
"knowledgeBase": "<string>",
"workflow": "<string>"
}
headers = {
"x-api-key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
welcomeMessage: '<string>',
task: '<string>',
voice: '<string>',
language: '<string>',
telephonyProvider: '<string>',
callTermination: 123,
hangupMessage: '<string>',
apiTool: '<any>',
knowledgeBase: '<string>',
workflow: '<string>'
})
};
fetch('https://svalync.com/api/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://svalync.com/api/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>',
'welcomeMessage' => '<string>',
'task' => '<string>',
'voice' => '<string>',
'language' => '<string>',
'telephonyProvider' => '<string>',
'callTermination' => 123,
'hangupMessage' => '<string>',
'apiTool' => '<any>',
'knowledgeBase' => '<string>',
'workflow' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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://svalync.com/api/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"task\": \"<string>\",\n \"voice\": \"<string>\",\n \"language\": \"<string>\",\n \"telephonyProvider\": \"<string>\",\n \"callTermination\": 123,\n \"hangupMessage\": \"<string>\",\n \"apiTool\": \"<any>\",\n \"knowledgeBase\": \"<string>\",\n \"workflow\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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://svalync.com/api/agents")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"task\": \"<string>\",\n \"voice\": \"<string>\",\n \"language\": \"<string>\",\n \"telephonyProvider\": \"<string>\",\n \"callTermination\": 123,\n \"hangupMessage\": \"<string>\",\n \"apiTool\": \"<any>\",\n \"knowledgeBase\": \"<string>\",\n \"workflow\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://svalync.com/api/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"task\": \"<string>\",\n \"voice\": \"<string>\",\n \"language\": \"<string>\",\n \"telephonyProvider\": \"<string>\",\n \"callTermination\": 123,\n \"hangupMessage\": \"<string>\",\n \"apiTool\": \"<any>\",\n \"knowledgeBase\": \"<string>\",\n \"workflow\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": [
{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"welcomeMessage": "<string>",
"task": "<string>",
"voice": "<string>",
"language": "<string>",
"telephonyProvider": "<string>",
"callTermination": 123,
"hangupMessage": "<string>",
"apiTool": "<any>",
"knowledgeBase": "<string>",
"workflow": "<string>"
}
}
]
}Agent
Create Agent
Create a new agent for handling specific tasks and interactions within the system for Voice AI.
POST
/
agents
Create Agent
curl --request POST \
--url https://svalync.com/api/agents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"name": "<string>",
"welcomeMessage": "<string>",
"task": "<string>",
"voice": "<string>",
"language": "<string>",
"telephonyProvider": "<string>",
"callTermination": 123,
"hangupMessage": "<string>",
"apiTool": "<any>",
"knowledgeBase": "<string>",
"workflow": "<string>"
}
'import requests
url = "https://svalync.com/api/agents"
payload = {
"name": "<string>",
"welcomeMessage": "<string>",
"task": "<string>",
"voice": "<string>",
"language": "<string>",
"telephonyProvider": "<string>",
"callTermination": 123,
"hangupMessage": "<string>",
"apiTool": "<any>",
"knowledgeBase": "<string>",
"workflow": "<string>"
}
headers = {
"x-api-key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
welcomeMessage: '<string>',
task: '<string>',
voice: '<string>',
language: '<string>',
telephonyProvider: '<string>',
callTermination: 123,
hangupMessage: '<string>',
apiTool: '<any>',
knowledgeBase: '<string>',
workflow: '<string>'
})
};
fetch('https://svalync.com/api/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://svalync.com/api/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>',
'welcomeMessage' => '<string>',
'task' => '<string>',
'voice' => '<string>',
'language' => '<string>',
'telephonyProvider' => '<string>',
'callTermination' => 123,
'hangupMessage' => '<string>',
'apiTool' => '<any>',
'knowledgeBase' => '<string>',
'workflow' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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://svalync.com/api/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"task\": \"<string>\",\n \"voice\": \"<string>\",\n \"language\": \"<string>\",\n \"telephonyProvider\": \"<string>\",\n \"callTermination\": 123,\n \"hangupMessage\": \"<string>\",\n \"apiTool\": \"<any>\",\n \"knowledgeBase\": \"<string>\",\n \"workflow\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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://svalync.com/api/agents")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"task\": \"<string>\",\n \"voice\": \"<string>\",\n \"language\": \"<string>\",\n \"telephonyProvider\": \"<string>\",\n \"callTermination\": 123,\n \"hangupMessage\": \"<string>\",\n \"apiTool\": \"<any>\",\n \"knowledgeBase\": \"<string>\",\n \"workflow\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://svalync.com/api/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"task\": \"<string>\",\n \"voice\": \"<string>\",\n \"language\": \"<string>\",\n \"telephonyProvider\": \"<string>\",\n \"callTermination\": 123,\n \"hangupMessage\": \"<string>\",\n \"apiTool\": \"<any>\",\n \"knowledgeBase\": \"<string>\",\n \"workflow\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": [
{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"welcomeMessage": "<string>",
"task": "<string>",
"voice": "<string>",
"language": "<string>",
"telephonyProvider": "<string>",
"callTermination": 123,
"hangupMessage": "<string>",
"apiTool": "<any>",
"knowledgeBase": "<string>",
"workflow": "<string>"
}
}
]
}Authorization
string
required
Your Api Key
Body
string
required
The name of the agent to be created.
string
The welcome message to be delivered by the agent.
string
required
The task or purpose of the agent, stored as long text.
string
required
The voice setting for the agent.
string
required
The language in which the agent communicates.
string
The telephony provider used for handling calls, defaulting to “twilio”.
integer
The duration or condition under which the call terminates, if applicable.
string
The message delivered when the agent hangs up.
json
The API tool configuration for the agent, if applicable.
string
The knowledge base reference for the agent, if applicable.
string
The workflow to run after call is ended. Here the value will be workflow id.
Response
array
Show properties
Show properties
boolean
Indicates if the request was successful.
object
The created agent object containing all the input fields.
Show properties
Show properties
string
Unique identifier for the created agent.
string
The name assigned to the agent.
string
The message the agent speaks when a call is connected.
string
The purpose or function of the agent.
string
The voice setting configured for the agent.
string
The language the agent uses for communication.
string
The provider used for handling incoming and outgoing calls.
integer
The condition or duration that triggers call termination.
string
The message played when the agent initiates a call hangup.
json
Configuration details for the API tool integrated with the agent.
string
Reference to the knowledge base associated with the agent.
string
The workflow process triggered after a call is completed.
⌘I