Skip to content

Create a campaign

POSThttps://api.voice-agent.gowajee.ai/api/campaign/create

Creates a campaign in DRAFT status together with its recipients. No calls are made yet. Next, start the campaign.

Field Type Required Description
agentId string ✅ The agent that makes the calls. Get it from List agents.
name string ✅ The campaign name. Must be unique in your organization.
recipients object[] ✅ The people to call. See below.

Any other field (for example maxAttempts) is rejected with 400. Scheduling and retry settings go in /schedule.

Field Type Required Description
tel string ✅ The phone number, as a string, for example "0812345678". It must not repeat within the request.
customerName string The customer’s name. Shown in the dashboard and in results.
agentParams object Depends on the agent The data the agent uses in the conversation. It must satisfy the agent’s paramsSchema: every required key present, with the right type. Extra keys are allowed and kept.
curl -X POST "https://api.voice-agent.gowajee.ai/api/campaign/create" \
-H "X-API-Key: $GOWAJEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentId": "33ea7a25-03b2-4614-a004-fa3bf9984bd1",
"name": "October payment reminder",
"recipients": [
{
"tel": "0812345678",
"customerName": "Somchai",
"agentParams": { "customer_name": "Somchai", "amount_due": 1500, "is_vip": true }
},
{
"tel": "0898765432",
"customerName": "Suda",
"agentParams": { "customer_name": "Suda", "amount_due": 3200 }
}
]
}'
{
"success": true,
"message": "Campaign created successfully",
"data": [
{
"tel": "0812345678",
"customerName": "Somchai",
"agentParams": { "customer_name": "Somchai", "amount_due": 1500, "is_vip": true },
"campaignId": "eac2489c-672c-455e-ab8c-4e0ecd18d7dc",
"organizationId": "8ee40f50-58de-4ae7-a55b-6bc83291b4be"
},
{
"tel": "0898765432",
"customerName": "Suda",
"agentParams": { "customer_name": "Suda", "amount_due": 3200 },
"campaignId": "eac2489c-672c-455e-ab8c-4e0ecd18d7dc",
"organizationId": "8ee40f50-58de-4ae7-a55b-6bc83291b4be"
}
]
}
Field Description
data[] One item per recipient created, in the order you sent them.
data[].campaignId The new campaign’s ID. It is the same on every item. Save it.

The body is the usual error envelope. The checks run in this order: the body shape, then the name, then the agent, then the recipients.

Status code message Fix
400 VALIDATION_FAILED property <x> should not exist Remove fields that aren’t listed above.
400 VALIDATION_FAILED For example name should not be empty, recipients must be an array Send every required field with the right type. With more than one problem, message is Validation failed and errors lists each one.
400 INVALID_ID An ID in the request is not a valid UUID agentId isn’t a UUID. Copy it from List agents.
409 CAMPAIGN_NAME_TAKEN Campaign name already exists Use a different name.
404 AGENT_NOT_FOUND Agent not found Check agentId. An agent of another organization is also “not found”.
400 RECIPIENT_VALIDATION_FAILED Recipient validation failed Fix the rows listed in errors. errorIndexes is an array of row numbers.
401 API_KEY_REQUIRED / INVALID_API_KEY See Authentication.