Trigger several outbound calls
curl --request POST \
--url https://client-backend.oktivo.com/api/v1/crm/calls/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"calls": [
{
"agentId": "<string>",
"phoneNumber": "<string>",
"name": "<string>",
"dynamicVariables": {},
"did": "<string>",
"scheduledAt": "<string>",
"deferIfUnavailable": true
}
],
"scheduledAt": "<string>",
"deferIfUnavailable": true
}
'import requests
url = "https://client-backend.oktivo.com/api/v1/crm/calls/bulk"
payload = {
"calls": [
{
"agentId": "<string>",
"phoneNumber": "<string>",
"name": "<string>",
"dynamicVariables": {},
"did": "<string>",
"scheduledAt": "<string>",
"deferIfUnavailable": True
}
],
"scheduledAt": "<string>",
"deferIfUnavailable": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
calls: [
{
agentId: '<string>',
phoneNumber: '<string>',
name: '<string>',
dynamicVariables: {},
did: '<string>',
scheduledAt: '<string>',
deferIfUnavailable: true
}
],
scheduledAt: '<string>',
deferIfUnavailable: true
})
};
fetch('https://client-backend.oktivo.com/api/v1/crm/calls/bulk', 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://client-backend.oktivo.com/api/v1/crm/calls/bulk",
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([
'calls' => [
[
'agentId' => '<string>',
'phoneNumber' => '<string>',
'name' => '<string>',
'dynamicVariables' => [
],
'did' => '<string>',
'scheduledAt' => '<string>',
'deferIfUnavailable' => true
]
],
'scheduledAt' => '<string>',
'deferIfUnavailable' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://client-backend.oktivo.com/api/v1/crm/calls/bulk"
payload := strings.NewReader("{\n \"calls\": [\n {\n \"agentId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"dynamicVariables\": {},\n \"did\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n }\n ],\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://client-backend.oktivo.com/api/v1/crm/calls/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calls\": [\n {\n \"agentId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"dynamicVariables\": {},\n \"did\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n }\n ],\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-backend.oktivo.com/api/v1/crm/calls/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"calls\": [\n {\n \"agentId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"dynamicVariables\": {},\n \"did\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n }\n ],\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"summary": {
"total": 123,
"succeeded": 123,
"failed": 123
},
"results": [
{
"index": 123,
"success": true,
"contactUID": "<string>",
"campaignUID": "<string>",
"deferred": true,
"status": "scheduled",
"notBefore": "2023-11-07T05:31:56Z",
"scheduledFor": "2023-11-07T05:31:56Z",
"deferredCallId": "<string>",
"error": {
"code": 123,
"message": "<string>",
"available": 123,
"required": 123,
"reason": "<string>"
}
}
],
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"meta": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true,
"limit": 123,
"nextCursor": "<string>"
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}Calls
Trigger several outbound calls
POST
/
api
/
v1
/
crm
/
calls
/
bulk
Trigger several outbound calls
curl --request POST \
--url https://client-backend.oktivo.com/api/v1/crm/calls/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"calls": [
{
"agentId": "<string>",
"phoneNumber": "<string>",
"name": "<string>",
"dynamicVariables": {},
"did": "<string>",
"scheduledAt": "<string>",
"deferIfUnavailable": true
}
],
"scheduledAt": "<string>",
"deferIfUnavailable": true
}
'import requests
url = "https://client-backend.oktivo.com/api/v1/crm/calls/bulk"
payload = {
"calls": [
{
"agentId": "<string>",
"phoneNumber": "<string>",
"name": "<string>",
"dynamicVariables": {},
"did": "<string>",
"scheduledAt": "<string>",
"deferIfUnavailable": True
}
],
"scheduledAt": "<string>",
"deferIfUnavailable": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
calls: [
{
agentId: '<string>',
phoneNumber: '<string>',
name: '<string>',
dynamicVariables: {},
did: '<string>',
scheduledAt: '<string>',
deferIfUnavailable: true
}
],
scheduledAt: '<string>',
deferIfUnavailable: true
})
};
fetch('https://client-backend.oktivo.com/api/v1/crm/calls/bulk', 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://client-backend.oktivo.com/api/v1/crm/calls/bulk",
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([
'calls' => [
[
'agentId' => '<string>',
'phoneNumber' => '<string>',
'name' => '<string>',
'dynamicVariables' => [
],
'did' => '<string>',
'scheduledAt' => '<string>',
'deferIfUnavailable' => true
]
],
'scheduledAt' => '<string>',
'deferIfUnavailable' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://client-backend.oktivo.com/api/v1/crm/calls/bulk"
payload := strings.NewReader("{\n \"calls\": [\n {\n \"agentId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"dynamicVariables\": {},\n \"did\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n }\n ],\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://client-backend.oktivo.com/api/v1/crm/calls/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calls\": [\n {\n \"agentId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"dynamicVariables\": {},\n \"did\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n }\n ],\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-backend.oktivo.com/api/v1/crm/calls/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"calls\": [\n {\n \"agentId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"name\": \"<string>\",\n \"dynamicVariables\": {},\n \"did\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n }\n ],\n \"scheduledAt\": \"<string>\",\n \"deferIfUnavailable\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"summary": {
"total": 123,
"succeeded": 123,
"failed": 123
},
"results": [
{
"index": 123,
"success": true,
"contactUID": "<string>",
"campaignUID": "<string>",
"deferred": true,
"status": "scheduled",
"notBefore": "2023-11-07T05:31:56Z",
"scheduledFor": "2023-11-07T05:31:56Z",
"deferredCallId": "<string>",
"error": {
"code": 123,
"message": "<string>",
"available": 123,
"required": 123,
"reason": "<string>"
}
}
],
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"meta": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true,
"limit": 123,
"nextCursor": "<string>"
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}Headers
8-128 chars of [A-Za-z0-9_.:-]. Same key and body replays the stored response (header Idempotent-Replay: true); same key with another body returns 422; a request still in progress returns 409. If the idempotency store is unavailable the request is processed without protection (fail-open).
Pattern:
^[\w.:-]{8,128}$Body
application/json
Response
Success. The body has success: true, the route's legacy fields, and the additive requestId, timestamp and meta.
Additive envelope fields present on every migrated v1 success body. All fields the route returned before are still returned unchanged.