Bulk Update Customer
curl --request PUT \
--url https://api.agents.timepay.ai/api/v1/customers/update/bulk \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>",
"records": [
{
"id": "<string>",
"data": {}
}
]
}
'import requests
url = "https://api.agents.timepay.ai/api/v1/customers/update/bulk"
payload = {
"campaignId": "<string>",
"records": [
{
"id": "<string>",
"data": {}
}
]
}
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({campaignId: '<string>', records: [{id: '<string>', data: {}}]})
};
fetch('https://api.agents.timepay.ai/api/v1/customers/update/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://api.agents.timepay.ai/api/v1/customers/update/bulk",
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([
'campaignId' => '<string>',
'records' => [
[
'id' => '<string>',
'data' => [
]
]
]
]),
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/customers/update/bulk"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\",\n \"records\": [\n {\n \"id\": \"<string>\",\n \"data\": {}\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/customers/update/bulk")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\",\n \"records\": [\n {\n \"id\": \"<string>\",\n \"data\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/customers/update/bulk")
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 \"campaignId\": \"<string>\",\n \"records\": [\n {\n \"id\": \"<string>\",\n \"data\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Updated 2 of 2 records",
"results": {
"total": 2,
"valid": 2,
"invalid": 0,
"successful": 2,
"failed": 0,
"retried": 0,
"batchesProcessed": 1,
"errors": []
}
}
{
"success": false,
"message": "Updated 1 of 2 records",
"results": {
"total": 2,
"valid": 2,
"invalid": 0,
"successful": 1,
"failed": 1,
"retried": 1,
"errors": [
{
"id": "loan_67890",
"error": "document_missing_exception",
"reason": "Document not found"
}
]
}
}
{
"success": false,
"message": "Validation failed",
"errors": [
"records cannot exceed 10000 items per request"
]
}
{
"success": false,
"message": "Campaign ID invalid or mismatch for your organization."
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}
Customers
Bulk Update Customer
Update multiple customer records in a single request.
Bulk Update Customer
curl --request PUT \
--url https://api.agents.timepay.ai/api/v1/customers/update/bulk \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>",
"records": [
{
"id": "<string>",
"data": {}
}
]
}
'import requests
url = "https://api.agents.timepay.ai/api/v1/customers/update/bulk"
payload = {
"campaignId": "<string>",
"records": [
{
"id": "<string>",
"data": {}
}
]
}
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({campaignId: '<string>', records: [{id: '<string>', data: {}}]})
};
fetch('https://api.agents.timepay.ai/api/v1/customers/update/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://api.agents.timepay.ai/api/v1/customers/update/bulk",
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([
'campaignId' => '<string>',
'records' => [
[
'id' => '<string>',
'data' => [
]
]
]
]),
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/customers/update/bulk"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\",\n \"records\": [\n {\n \"id\": \"<string>\",\n \"data\": {}\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/customers/update/bulk")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\",\n \"records\": [\n {\n \"id\": \"<string>\",\n \"data\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/customers/update/bulk")
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 \"campaignId\": \"<string>\",\n \"records\": [\n {\n \"id\": \"<string>\",\n \"data\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Updated 2 of 2 records",
"results": {
"total": 2,
"valid": 2,
"invalid": 0,
"successful": 2,
"failed": 0,
"retried": 0,
"batchesProcessed": 1,
"errors": []
}
}
{
"success": false,
"message": "Updated 1 of 2 records",
"results": {
"total": 2,
"valid": 2,
"invalid": 0,
"successful": 1,
"failed": 1,
"retried": 1,
"errors": [
{
"id": "loan_67890",
"error": "document_missing_exception",
"reason": "Document not found"
}
]
}
}
{
"success": false,
"message": "Validation failed",
"errors": [
"records cannot exceed 10000 items per request"
]
}
{
"success": false,
"message": "Campaign ID invalid or mismatch for your organization."
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}
Headers
string
required
Bearer token for authentication (e.g.,
Bearer <your_token>).Body Parameters
string
required
The unique identifier of the campaign (e.g.,
camp_abc123).array
required
Response
boolean
Indicates if the overall operation was successful.
string
A summary message (e.g., “Updated 500 of 500 records”).
object
Detailed execution statistics.
Show properties
Show properties
integer
Total records received.
integer
Records passing initial validation.
integer
Records failing initial validation.
integer
Successfully updated records.
integer
Records that failed to update.
integer
Records retried due to version conflicts.
array
List of specific error details for failed records.
array
List of records that failed validation.
{
"success": true,
"message": "Updated 2 of 2 records",
"results": {
"total": 2,
"valid": 2,
"invalid": 0,
"successful": 2,
"failed": 0,
"retried": 0,
"batchesProcessed": 1,
"errors": []
}
}
{
"success": false,
"message": "Updated 1 of 2 records",
"results": {
"total": 2,
"valid": 2,
"invalid": 0,
"successful": 1,
"failed": 1,
"retried": 1,
"errors": [
{
"id": "loan_67890",
"error": "document_missing_exception",
"reason": "Document not found"
}
]
}
}
{
"success": false,
"message": "Validation failed",
"errors": [
"records cannot exceed 10000 items per request"
]
}
{
"success": false,
"message": "Campaign ID invalid or mismatch for your organization."
}
{
"success": false,
"error": "InternalServerError",
"message": "An unexpected error occurred"
}

