Calls
Place one outbound call through the same gates as a campaign
POST
/
v1
/
calls
Place one outbound call through the same gates as a campaign
curl --request POST \
--url https://api-us.larynth.com/v1/calls \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--cookie lx_session= \
--data '
{
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_e164": "<string>",
"to_e164": "<string>",
"amd_mode": "off",
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ring_timeout_s": 30,
"variables": {}
}
'import requests
url = "https://api-us.larynth.com/v1/calls"
payload = {
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_e164": "<string>",
"to_e164": "<string>",
"amd_mode": "off",
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ring_timeout_s": 30,
"variables": {}
}
headers = {
"cookie": "lx_session=",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'lx_session=',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
assistant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
from_e164: '<string>',
to_e164: '<string>',
amd_mode: 'off',
amd_profile_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ring_timeout_s: 30,
variables: {}
})
};
fetch('https://api-us.larynth.com/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-us.larynth.com/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([
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'from_e164' => '<string>',
'to_e164' => '<string>',
'amd_mode' => 'off',
'amd_profile_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ring_timeout_s' => 30,
'variables' => [
]
]),
CURLOPT_COOKIE => "lx_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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-us.larynth.com/v1/calls"
payload := strings.NewReader("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from_e164\": \"<string>\",\n \"to_e164\": \"<string>\",\n \"amd_mode\": \"off\",\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ring_timeout_s\": 30,\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "lx_session=")
req.Header.Add("Idempotency-Key", "<idempotency-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-us.larynth.com/v1/calls")
.header("cookie", "lx_session=")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from_e164\": \"<string>\",\n \"to_e164\": \"<string>\",\n \"amd_mode\": \"off\",\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ring_timeout_s\": 30,\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-us.larynth.com/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'lx_session='
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from_e164\": \"<string>\",\n \"to_e164\": \"<string>\",\n \"amd_mode\": \"off\",\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ring_timeout_s\": 30,\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "inbound",
"mode": "cascade",
"opted_out": true,
"recording_allowed": true,
"status": "queued",
"updated_at": "2023-11-07T05:31:56Z",
"agent_billable_ms": 123,
"agent_price_micro": 123,
"amd_after_ms": 123,
"amd_answer_headers": {
"diversion": [
"<string>"
],
"history_info": [
"<string>"
],
"p_early_media": [
"<string>"
],
"reason": [
"<string>"
]
},
"amd_early_media_tone": "none",
"amd_reason": "<string>",
"amd_ringback_cycles": 123,
"amd_t200_ms": 123,
"amd_verdict": "unknown",
"answered_at": "2023-11-07T05:31:56Z",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_version": 123,
"attestation": "A",
"billable_ms": 123,
"bridged_ms": 123,
"bridged_price_micro": 123,
"campaign_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cause": "<string>",
"codec": "G722",
"disclosure_played_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"from_e164": "<string>",
"hangup_by": "local",
"number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"price_micro": 123,
"recording_notice_played_at": "2023-11-07T05:31:56Z",
"sip_code": 123,
"summary": "<string>",
"to_e164": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}Authorizations
sessionapiKey
Dashboard session cookie
Headers
Replays within 24 h return the stored response; the same key with a different body returns 409
Required string length:
8 - 255Body
application/json
The published version is used
Must be an active number of this tenant
Pattern:
^\+[1-9][0-9]{6,14}$Available options:
informational, telemarketing Pattern:
^\+[1-9][0-9]{6,14}$Available options:
off, hangup_on_machine, voicemail Required range:
15 <= x <= 60Show child attributes
Show child attributes
Response
Accepted
Pattern:
^[a-z0-9]{2,8}_[0-9A-HJKMNP-TV-Z]{26}$Available options:
inbound, outbound, web_test Available options:
cascade, s2s Available options:
queued, dialing, ringing, in_progress, completed, no_answer, busy, failed, canceled, rejected Part of billable_ms handled by the agent
Settled price of the agent part in micro-USD
Allow-listed 200 OK headers; values can carry phone numbers
Show child attributes
Show child attributes
Available options:
none, ringback, sit, other Ringback cycles heard before answer
Originate to 200 OK; absent when not answered
Available options:
unknown, human, voicemail, carrier_vm, ivr, screener, fax, sit Available options:
A, B, C Part of billable_ms bridged to a human after a transfer
Settled price of the bridged part in micro-USD, billed at the transfer_minute rate
Available options:
G722, PCMU, PCMA, opus Available options:
local, remote, system Settled price in micro-USD
Short post-call summary, present on list items once analysed
⌘I
Place one outbound call through the same gates as a campaign
curl --request POST \
--url https://api-us.larynth.com/v1/calls \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--cookie lx_session= \
--data '
{
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_e164": "<string>",
"to_e164": "<string>",
"amd_mode": "off",
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ring_timeout_s": 30,
"variables": {}
}
'import requests
url = "https://api-us.larynth.com/v1/calls"
payload = {
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_e164": "<string>",
"to_e164": "<string>",
"amd_mode": "off",
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ring_timeout_s": 30,
"variables": {}
}
headers = {
"cookie": "lx_session=",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'lx_session=',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
assistant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
from_e164: '<string>',
to_e164: '<string>',
amd_mode: 'off',
amd_profile_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ring_timeout_s: 30,
variables: {}
})
};
fetch('https://api-us.larynth.com/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-us.larynth.com/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([
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'from_e164' => '<string>',
'to_e164' => '<string>',
'amd_mode' => 'off',
'amd_profile_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ring_timeout_s' => 30,
'variables' => [
]
]),
CURLOPT_COOKIE => "lx_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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-us.larynth.com/v1/calls"
payload := strings.NewReader("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from_e164\": \"<string>\",\n \"to_e164\": \"<string>\",\n \"amd_mode\": \"off\",\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ring_timeout_s\": 30,\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "lx_session=")
req.Header.Add("Idempotency-Key", "<idempotency-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-us.larynth.com/v1/calls")
.header("cookie", "lx_session=")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from_e164\": \"<string>\",\n \"to_e164\": \"<string>\",\n \"amd_mode\": \"off\",\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ring_timeout_s\": 30,\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-us.larynth.com/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'lx_session='
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from_e164\": \"<string>\",\n \"to_e164\": \"<string>\",\n \"amd_mode\": \"off\",\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ring_timeout_s\": 30,\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "inbound",
"mode": "cascade",
"opted_out": true,
"recording_allowed": true,
"status": "queued",
"updated_at": "2023-11-07T05:31:56Z",
"agent_billable_ms": 123,
"agent_price_micro": 123,
"amd_after_ms": 123,
"amd_answer_headers": {
"diversion": [
"<string>"
],
"history_info": [
"<string>"
],
"p_early_media": [
"<string>"
],
"reason": [
"<string>"
]
},
"amd_early_media_tone": "none",
"amd_reason": "<string>",
"amd_ringback_cycles": 123,
"amd_t200_ms": 123,
"amd_verdict": "unknown",
"answered_at": "2023-11-07T05:31:56Z",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_version": 123,
"attestation": "A",
"billable_ms": 123,
"bridged_ms": 123,
"bridged_price_micro": 123,
"campaign_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cause": "<string>",
"codec": "G722",
"disclosure_played_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"from_e164": "<string>",
"hangup_by": "local",
"number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"price_micro": 123,
"recording_notice_played_at": "2023-11-07T05:31:56Z",
"sip_code": 123,
"summary": "<string>",
"to_e164": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}