Skip to main content
Bulk Add Customers
curl --request POST \
  --url https://api.agents.timepay.ai/api/v1/customers/add/bulk \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "campaignId": "<string>",
  "records": [
    {
      "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>"
  },
  "useWorkflow": true
}
'
{
  "success": true,
  "message": "Added 3 of 3 records",
  "results": {
    "total": 3,
    "valid": 3,
    "invalid": 0,
    "successful": 3,
    "failed": 0,
    "batchesProcessed": 1,
    "errors": []
  }
}

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.
records
array
required
Array of customer objects. Maximum 10,000 records per request. 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 calls for all successfully added customers. Requires callConfig. Calls are triggered in batches of 500 after all records are added. Cannot be true if useWorkflow is true.
callConfig
object
Required when initiateCall is true.
useWorkflow
boolean
default:false
If true, triggers workflow execution asynchronously for all successfully added customers. Cannot be true if initiateCall is true.

Response

success
boolean
true if all records were added successfully, false if any failed.
message
string
Summary of the operation result.
results
object
Detailed breakdown of the operation.
callResults
object
Call initiation results. Only present when initiateCall was true.
workflowTriggered
boolean
Whether workflow execution was triggered for successfully added customers. Only present when useWorkflow was true.
Response Status Codes:
  • 201 — All records added successfully
  • 207 — Partial success (some added, some failed)
  • 400 — All records failed or validation error
{
  "success": true,
  "message": "Added 3 of 3 records",
  "results": {
    "total": 3,
    "valid": 3,
    "invalid": 0,
    "successful": 3,
    "failed": 0,
    "batchesProcessed": 1,
    "errors": []
  }
}