Get Campaign
curl --request GET \
--url https://api.agents.timepay.ai/api/v1/campaigns/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.agents.timepay.ai/api/v1/campaigns/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.agents.timepay.ai/api/v1/campaigns/{id}', 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.agents.timepay.ai/api/v1/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.agents.timepay.ai/api/v1/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.agents.timepay.ai/api/v1/campaigns/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "QSoSyUUwwhwEiFhXJIUlhYxOh",
"createdAt": "2026-01-05T14:44:15",
"updatedAt": "2026-01-05T14:44:51",
"name": "Campaign 1",
"description": "Q1 debt collection campaign for overdue accounts",
"startDate": "2025-12-31",
"startTime": "09:00",
"endDate": "2025-12-31",
"endTime": "19:00",
"collectionType": "emi",
"region": "north",
"tags": [
"priority",
"q1"
],
"languages": [
"hindi",
"english"
]
}
}
{
"success": false,
"error": "Unauthorized",
"message": "Missing or invalid authorization header"
}
{
"success": false,
"error": "Forbidden",
"message": "You don't have the required permission to perform this action"
}
{
"success": false,
"error": "NotFound",
"message": "Campaign not found"
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}
Campaigns
Get Campaign
Retrieve detailed information about a specific campaign by its ID.
Get Campaign
curl --request GET \
--url https://api.agents.timepay.ai/api/v1/campaigns/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.agents.timepay.ai/api/v1/campaigns/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.agents.timepay.ai/api/v1/campaigns/{id}', 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.agents.timepay.ai/api/v1/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.agents.timepay.ai/api/v1/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.agents.timepay.ai/api/v1/campaigns/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "QSoSyUUwwhwEiFhXJIUlhYxOh",
"createdAt": "2026-01-05T14:44:15",
"updatedAt": "2026-01-05T14:44:51",
"name": "Campaign 1",
"description": "Q1 debt collection campaign for overdue accounts",
"startDate": "2025-12-31",
"startTime": "09:00",
"endDate": "2025-12-31",
"endTime": "19:00",
"collectionType": "emi",
"region": "north",
"tags": [
"priority",
"q1"
],
"languages": [
"hindi",
"english"
]
}
}
{
"success": false,
"error": "Unauthorized",
"message": "Missing or invalid authorization header"
}
{
"success": false,
"error": "Forbidden",
"message": "You don't have the required permission to perform this action"
}
{
"success": false,
"error": "NotFound",
"message": "Campaign not found"
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}
Headers
string
required
Bearer token for authentication (e.g.,
Bearer <your_token>).string
Optional. Use this header only when the authenticated user belongs to multiple organizations. It identifies the organization to target for this action.
Path Parameters
string
required
The unique identifier of the campaign (e.g.,
camp_abc123).Response
boolean
Indicates if the request was successful.
object
string
The error type or code (Error responses only).
string
A descriptive message explaining the error (Error responses only).
{
"success": true,
"data": {
"id": "QSoSyUUwwhwEiFhXJIUlhYxOh",
"createdAt": "2026-01-05T14:44:15",
"updatedAt": "2026-01-05T14:44:51",
"name": "Campaign 1",
"description": "Q1 debt collection campaign for overdue accounts",
"startDate": "2025-12-31",
"startTime": "09:00",
"endDate": "2025-12-31",
"endTime": "19:00",
"collectionType": "emi",
"region": "north",
"tags": [
"priority",
"q1"
],
"languages": [
"hindi",
"english"
]
}
}
{
"success": false,
"error": "Unauthorized",
"message": "Missing or invalid authorization header"
}
{
"success": false,
"error": "Forbidden",
"message": "You don't have the required permission to perform this action"
}
{
"success": false,
"error": "NotFound",
"message": "Campaign not found"
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}
Error Codes
| Status | Description |
|---|---|
401 | Unauthorized - missing or invalid authorization header |
403 | Forbidden - insufficient permission to access the campaign |
404 | Campaign not found |
500 | Internal server error |

