Update Campaign
curl --request PUT \
--url https://api.agents.timepay.ai/api/v1/campaigns/update/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"campaignType": "<string>",
"startDate": "<string>",
"startTime": "<string>",
"endDate": "<string>",
"endTime": "<string>",
"languages": [
{}
],
"region": "<string>",
"tags": [
{}
]
}
'import requests
url = "https://api.agents.timepay.ai/api/v1/campaigns/update/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"campaignType": "<string>",
"startDate": "<string>",
"startTime": "<string>",
"endDate": "<string>",
"endTime": "<string>",
"languages": [{}],
"region": "<string>",
"tags": [{}]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
campaignType: '<string>',
startDate: '<string>',
startTime: '<string>',
endDate: '<string>',
endTime: '<string>',
languages: [{}],
region: '<string>',
tags: [{}]
})
};
fetch('https://api.agents.timepay.ai/api/v1/campaigns/update/{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/update/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'campaignType' => '<string>',
'startDate' => '<string>',
'startTime' => '<string>',
'endDate' => '<string>',
'endTime' => '<string>',
'languages' => [
[
]
],
'region' => '<string>',
'tags' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.agents.timepay.ai/api/v1/campaigns/update/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"campaignType\": \"<string>\",\n \"startDate\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endDate\": \"<string>\",\n \"endTime\": \"<string>\",\n \"languages\": [\n {}\n ],\n \"region\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://api.agents.timepay.ai/api/v1/campaigns/update/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"campaignType\": \"<string>\",\n \"startDate\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endDate\": \"<string>\",\n \"endTime\": \"<string>\",\n \"languages\": [\n {}\n ],\n \"region\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/campaigns/update/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"campaignType\": \"<string>\",\n \"startDate\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endDate\": \"<string>\",\n \"endTime\": \"<string>\",\n \"languages\": [\n {}\n ],\n \"region\": \"<string>\",\n \"tags\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Campaign updated successfully",
"updatedFields": [
"name", ...
]
}
{
"success": false,
"error": "ValidationError",
"message": "Invalid date format provided"
}
{
"success": false,
"error": "Unauthorized",
"message": "Missing or invalid authorization header"
}
{
"success": false,
"error": "NotFound",
"message": "Campaign not found"
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}
Campaigns
Update Campaign
Update an existing campaign’s configuration and customer records.
Update Campaign
curl --request PUT \
--url https://api.agents.timepay.ai/api/v1/campaigns/update/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"campaignType": "<string>",
"startDate": "<string>",
"startTime": "<string>",
"endDate": "<string>",
"endTime": "<string>",
"languages": [
{}
],
"region": "<string>",
"tags": [
{}
]
}
'import requests
url = "https://api.agents.timepay.ai/api/v1/campaigns/update/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"campaignType": "<string>",
"startDate": "<string>",
"startTime": "<string>",
"endDate": "<string>",
"endTime": "<string>",
"languages": [{}],
"region": "<string>",
"tags": [{}]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
campaignType: '<string>',
startDate: '<string>',
startTime: '<string>',
endDate: '<string>',
endTime: '<string>',
languages: [{}],
region: '<string>',
tags: [{}]
})
};
fetch('https://api.agents.timepay.ai/api/v1/campaigns/update/{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/update/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'campaignType' => '<string>',
'startDate' => '<string>',
'startTime' => '<string>',
'endDate' => '<string>',
'endTime' => '<string>',
'languages' => [
[
]
],
'region' => '<string>',
'tags' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.agents.timepay.ai/api/v1/campaigns/update/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"campaignType\": \"<string>\",\n \"startDate\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endDate\": \"<string>\",\n \"endTime\": \"<string>\",\n \"languages\": [\n {}\n ],\n \"region\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://api.agents.timepay.ai/api/v1/campaigns/update/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"campaignType\": \"<string>\",\n \"startDate\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endDate\": \"<string>\",\n \"endTime\": \"<string>\",\n \"languages\": [\n {}\n ],\n \"region\": \"<string>\",\n \"tags\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/campaigns/update/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"campaignType\": \"<string>\",\n \"startDate\": \"<string>\",\n \"startTime\": \"<string>\",\n \"endDate\": \"<string>\",\n \"endTime\": \"<string>\",\n \"languages\": [\n {}\n ],\n \"region\": \"<string>\",\n \"tags\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Campaign updated successfully",
"updatedFields": [
"name", ...
]
}
{
"success": false,
"error": "ValidationError",
"message": "Invalid date format provided"
}
{
"success": false,
"error": "Unauthorized",
"message": "Missing or invalid authorization header"
}
{
"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>).Path Parameters
string
required
The Campaign Id to update details for (e.g.,
camp_abc123).Body Parameters
string
The name of the campaign.
string
A brief description of the campaign’s purpose.
string
The type of campaign (e.g.,
emi, edi, lead).Show options
Show options
emiedilead
string
Start date in
YYYY-MM-DD format.string
Start time in
HH:MM format (24-hour).string
End date in
YYYY-MM-DD format.string
End time in
HH:MM format (24-hour).array
List of languages supported in this campaign.
Show options
Show options
hindienglishbengalitelugumarathitamilgujaratikannadamalayalampunjabiodiaassamese
string
Target region for the campaign.
Show options
Show options
northsoutheastwestcentral
array
Tags for categorization (e.g.,
["priority", "revised"]).Response
boolean
Indicates if the update was successful.
string
A confirmation message.
string
The error type or code (Error responses only).
{
"success": true,
"message": "Campaign updated successfully",
"updatedFields": [
"name", ...
]
}
{
"success": false,
"error": "ValidationError",
"message": "Invalid date format provided"
}
{
"success": false,
"error": "Unauthorized",
"message": "Missing or invalid authorization header"
}
{
"success": false,
"error": "NotFound",
"message": "Campaign not found"
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}

