Skip to main content
Create Campaign
curl --request POST \
  --url https://api.agents.timepay.ai/api/v1/campaigns/create \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "campaignType": "<string>",
  "workflowId": "<string>",
  "startDate": "<string>",
  "startTime": "<string>",
  "endDate": "<string>",
  "endTime": "<string>",
  "languages": [
    "<string>"
  ],
  "region": "<string>",
  "tags": [
    "<string>"
  ],
  "jsonData": [
    {
      "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>"
    }
  ]
}
'
{
  "success": true,
  "message": "Campaign created successfully",
  "data": {
    "id": "camp_abc123",
    "name": "Debt Collection Q1"
  }
}

Headers

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

Body Parameters

name
string
required
The name of the campaign.
description
string
required
A brief description of the campaign’s purpose.
campaignType
string
required
The type of campaign (e.g., emi, edi, lead).
workflowId
string
The ID of the workflow to associate with this campaign.
startDate
string
required
Start date in YYYY-MM-DD format.
startTime
string
required
Start time in HH:MM format (24-hour).
endDate
string
required
End date in YYYY-MM-DD format.
endTime
string
required
End time in HH:MM format (24-hour).
languages
string[]
required
List of languages supported in this campaign (e.g., ["english", "hindi"]).
region
string
required
Target region for the campaign (e.g., north).
tags
string[]
Tags for categorization (e.g., ["priority", "q1"]).
Identifier RequirementDepending on your campaign type, you must provide either a loan_id (for Debt Collection) or a lead_id (for Lead Generation). Requests missing both will return a 400 Bad Request.
jsonData
array
required
Array of customer objects. The required fields within these objects change based on your campaign focus.
Use this structure if you are managing existing loans.

Response

success
boolean
Indicates if the creation was successful.
message
string
A confirmation message.
data
object
error
string
The error type or code (Error responses only).
{
  "success": true,
  "message": "Campaign created successfully",
  "data": {
    "id": "camp_abc123",
    "name": "Debt Collection Q1"
  }
}