Check Customer Exists
curl --request POST \
--url https://api.agents.timepay.ai/api/v1/customers/exists \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>",
"loan_id": "<string>",
"lead_id": "<string>",
"phone_number": "<string>"
}
'import requests
url = "https://api.agents.timepay.ai/api/v1/customers/exists"
payload = {
"campaignId": "<string>",
"loan_id": "<string>",
"lead_id": "<string>",
"phone_number": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaignId: '<string>',
loan_id: '<string>',
lead_id: '<string>',
phone_number: '<string>'
})
};
fetch('https://api.agents.timepay.ai/api/v1/customers/exists', 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/exists",
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([
'campaignId' => '<string>',
'loan_id' => '<string>',
'lead_id' => '<string>',
'phone_number' => '<string>'
]),
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/exists"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\",\n \"loan_id\": \"<string>\",\n \"lead_id\": \"<string>\",\n \"phone_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.agents.timepay.ai/api/v1/customers/exists")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\",\n \"loan_id\": \"<string>\",\n \"lead_id\": \"<string>\",\n \"phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/customers/exists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaignId\": \"<string>\",\n \"loan_id\": \"<string>\",\n \"lead_id\": \"<string>\",\n \"phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"exists": true
}
{
"success": false,
"message": "Validation failed",
"errors": [
"Provide exactly one of loan_id, lead_id, or phone_number"
]
}
{
"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": "InternalServerError",
"message": "An unexpected error occurred"
}
Customers
Check Customer Exists
Check whether a customer exists in a campaign using a loan ID, lead ID, or phone number.
Check Customer Exists
curl --request POST \
--url https://api.agents.timepay.ai/api/v1/customers/exists \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>",
"loan_id": "<string>",
"lead_id": "<string>",
"phone_number": "<string>"
}
'import requests
url = "https://api.agents.timepay.ai/api/v1/customers/exists"
payload = {
"campaignId": "<string>",
"loan_id": "<string>",
"lead_id": "<string>",
"phone_number": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaignId: '<string>',
loan_id: '<string>',
lead_id: '<string>',
phone_number: '<string>'
})
};
fetch('https://api.agents.timepay.ai/api/v1/customers/exists', 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/exists",
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([
'campaignId' => '<string>',
'loan_id' => '<string>',
'lead_id' => '<string>',
'phone_number' => '<string>'
]),
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/exists"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\",\n \"loan_id\": \"<string>\",\n \"lead_id\": \"<string>\",\n \"phone_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.agents.timepay.ai/api/v1/customers/exists")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\",\n \"loan_id\": \"<string>\",\n \"lead_id\": \"<string>\",\n \"phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.timepay.ai/api/v1/customers/exists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaignId\": \"<string>\",\n \"loan_id\": \"<string>\",\n \"lead_id\": \"<string>\",\n \"phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"exists": true
}
{
"success": false,
"message": "Validation failed",
"errors": [
"Provide exactly one of loan_id, lead_id, or phone_number"
]
}
{
"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": "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.
Body Parameters
string
required
The unique identifier of the campaign to search.
Provide exactly one of
loan_id, lead_id, or phone_number.string
The loan ID to search for. Use for
debt_collection organizations.string
The lead ID to search for. Use for
lead_generation organizations.string
The customer’s phone number to search for.
Response
boolean
Indicates whether the request was successful.
boolean
Whether a matching customer exists in the campaign.
{
"success": true,
"exists": true
}
{
"success": false,
"message": "Validation failed",
"errors": [
"Provide exactly one of loan_id, lead_id, or phone_number"
]
}
{
"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": "InternalServerError",
"message": "An unexpected error occurred"
}
Error Codes
| Status | Description |
|---|---|
400 | Validation error - campaignId is required, or exactly one customer identifier must be provided |
401 | Unauthorized - missing or invalid authorization header |
403 | Forbidden - insufficient permission to access the campaign customers |
500 | Internal server error |

