Get Batch Status
curl --request GET \
--url https://api.trillet.ai/v1/api/batch-calls/{batchId} \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://api.trillet.ai/v1/api/batch-calls/{batchId}"
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'x-workspace-id': '<x-workspace-id>'}
};
fetch('https://api.trillet.ai/v1/api/batch-calls/{batchId}', 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.trillet.ai/v1/api/batch-calls/{batchId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/batch-calls/{batchId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trillet.ai/v1/api/batch-calls/{batchId}")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/batch-calls/{batchId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"isComplete": true,
"totalCalls": 123,
"progress": {
"waiting": 123,
"active": 123,
"completed": 123,
"failed": 123,
"total": 123,
"startTime": 123,
"lastCompletedTime": 123,
"completedTime": 123,
"averageCallDuration": 123,
"recent_calls": [
{}
]
},
"timestamp": 123,
"error": "<string>",
"message": "<string>"
}Batch Calls
Get Batch Status
Get detailed status information for a batch call operation
GET
/
v1
/
api
/
batch-calls
/
{batchId}
Get Batch Status
curl --request GET \
--url https://api.trillet.ai/v1/api/batch-calls/{batchId} \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://api.trillet.ai/v1/api/batch-calls/{batchId}"
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'x-workspace-id': '<x-workspace-id>'}
};
fetch('https://api.trillet.ai/v1/api/batch-calls/{batchId}', 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.trillet.ai/v1/api/batch-calls/{batchId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/batch-calls/{batchId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trillet.ai/v1/api/batch-calls/{batchId}")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/batch-calls/{batchId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"isComplete": true,
"totalCalls": 123,
"progress": {
"waiting": 123,
"active": 123,
"completed": 123,
"failed": 123,
"total": 123,
"startTime": 123,
"lastCompletedTime": 123,
"completedTime": 123,
"averageCallDuration": 123,
"recent_calls": [
{}
]
},
"timestamp": 123,
"error": "<string>",
"message": "<string>"
}Headers
string
required
API key used for authenticating requests to the API.
string
required
Workspace identifier for the API.
Path Parameters
string
required
The unique identifier of the batch call operation
Response
string
The batch ID
string
Current status of the batch operation
queued- Batch is waiting to be processedprocessing- Calls are currently being madecompleted- All calls have been completedcancelled- Batch was cancelledfailed- Batch failed due to an error
boolean
Whether the batch operation has finished
number
Total number of calls in the batch
object
Detailed progress information
Show Progress Object
Show Progress Object
number
Number of calls waiting in queue
number
Number of calls currently being processed
number
Number of successfully completed calls
number
Number of failed calls
number
Total number of calls in the batch
number
Timestamp when the batch started processing
number
Timestamp of the last completed call
number
Timestamp when the batch was completed (if finished)
number
Average duration of completed calls in seconds
array
Array of recent call results for monitoring
number
Timestamp of when this status was retrieved
Example Usage
curl -X GET "https://api.trillet.ai/v1/api/batch-calls/batch_7891011121314" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
Example Response
{
"id": "batch_7891011121314",
"status": "processing",
"isComplete": false,
"totalCalls": 150,
"progress": {
"waiting": 45,
"active": 5,
"completed": 95,
"failed": 5,
"total": 150,
"startTime": 1703097600000,
"lastCompletedTime": 1703101200000,
"completedTime": null,
"averageCallDuration": 45.2,
"recent_calls": [
{
"jobId": "call_123",
"status": "completed",
"phone_number": "+1234567890",
"completedAt": 1703101200000
}
]
},
"timestamp": 1703101300000
}
Error Responses
string
Error message describing what went wrong
string
Additional context about the error
404- Batch not found with the specified ID500- Server error retrieving batch information
