Skip to main content
Add Customer
curl --request POST \
  --url https://api.agents.timepay.ai/api/v1/customers/add \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "campaignId": "<string>",
  "data": {
    "loan_id": "<string>",
    "first_name": "<string>",
    "last_name": "<string>",
    "phone_number": "<string>",
    "loan_amount": 123,
    "emi_amount": 123,
    "loan_period": 123,
    "current_emi": 123,
    "emi_due_date": "<string>",
    "payment_status": "<string>",
    "language": "<string>",
    "lead_id": "<string>",
    "lead_date": "<string>"
  },
  "initiateCall": true,
  "callConfig": {
    "agentId": "<string>",
    "dispositionId": "<string>"
  }
}
'
{
  "success": true,
  "message": "Customer added to campaign successfully",
  "data": {
    "id": "LOAN-2025-00123",
    "campaignId": "camp_abc123"
  }
}

Headers

Authorization
string
required
Bearer token for authentication (e.g., Bearer <your_token>).

Body Parameters

campaignId
string
required
Target campaign ID. The campaign must already exist.
data
object
required
Customer data object. The required fields depend on your campaign’s service type.
Use this structure if you are managing existing loans.
initiateCall
boolean
default:false
If true, initiates a call to the customer immediately after adding. Requires callConfig.
callConfig
object
Required when initiateCall is true.

Response

success
boolean
Indicates whether the request was successful.
message
string
A descriptive message about the result.
data
object
Details of the added customer.
callInitiated
boolean
Whether the call was successfully initiated. Only present when initiateCall was true.
callError
string
Reason the call could not be initiated. Only present when callInitiated is false.
{
  "success": true,
  "message": "Customer added to campaign successfully",
  "data": {
    "id": "LOAN-2025-00123",
    "campaignId": "camp_abc123"
  }
}