Send Call
curl --request POST \
--url https://svalync.com/api/voiceai/sendcall \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"phone_number": 123,
"agentId": 123,
"from_phone_number": "<string>"
}
'import requests
url = "https://svalync.com/api/voiceai/sendcall"
payload = {
"phone_number": 123,
"agentId": 123,
"from_phone_number": "<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({phone_number: 123, agentId: 123, from_phone_number: '<string>'})
};
fetch('https://svalync.com/api/voiceai/sendcall', 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/voiceai/sendcall",
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([
'phone_number' => 123,
'agentId' => 123,
'from_phone_number' => '<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/voiceai/sendcall"
payload := strings.NewReader("{\n \"phone_number\": 123,\n \"agentId\": 123,\n \"from_phone_number\": \"<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/voiceai/sendcall")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": 123,\n \"agentId\": 123,\n \"from_phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://svalync.com/api/voiceai/sendcall")
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 \"phone_number\": 123,\n \"agentId\": 123,\n \"from_phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": [
{
"agent": "<string>",
"userId": "<string>",
"phoneNumber": "<string>",
"fromPhoneNumber": "<string>",
"currentDateTime": "<string>",
"callDirection": "<string>",
"userData": {}
}
]
}Calls
Send Call
Learn how to initiate outbound phone calls using Svalync Voice AI agents. Start making phone calls using the agent ID and svalync internal phone number.
POST
/
voiceai
/
sendcall
Send Call
curl --request POST \
--url https://svalync.com/api/voiceai/sendcall \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"phone_number": 123,
"agentId": 123,
"from_phone_number": "<string>"
}
'import requests
url = "https://svalync.com/api/voiceai/sendcall"
payload = {
"phone_number": 123,
"agentId": 123,
"from_phone_number": "<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({phone_number: 123, agentId: 123, from_phone_number: '<string>'})
};
fetch('https://svalync.com/api/voiceai/sendcall', 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/voiceai/sendcall",
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([
'phone_number' => 123,
'agentId' => 123,
'from_phone_number' => '<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/voiceai/sendcall"
payload := strings.NewReader("{\n \"phone_number\": 123,\n \"agentId\": 123,\n \"from_phone_number\": \"<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/voiceai/sendcall")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": 123,\n \"agentId\": 123,\n \"from_phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://svalync.com/api/voiceai/sendcall")
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 \"phone_number\": 123,\n \"agentId\": 123,\n \"from_phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": [
{
"agent": "<string>",
"userId": "<string>",
"phoneNumber": "<string>",
"fromPhoneNumber": "<string>",
"currentDateTime": "<string>",
"callDirection": "<string>",
"userData": {}
}
]
}Authorization
string
required
Your Api Key
Body
Make a phone call from agentnumber
required
The phone number to be called.
number
required
Agent id which will initiate the outbound call
string
required
Phone number of the sender default value is internal
Response
array
Show properties
Show properties
string
ID of the agent handling the call.
string
The user identifier associated with the call.
string
The phone number associated with the call.
string
The originating phone number of the call.
string
The timestamp representing the current date and time.
string
The direction of the call (e.g., INBOUND or OUTBOUND).
object
Additional user data associated with the call.
⌘I