{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Campaigns
Start Campaign
Start campaign execution immediately using Celery background tasks.
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
start
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Start campaign execution. The campaign will begin contacting contacts based on the configured schedule.
Path Parameters
campaign_id(integer, required): The unique identifier of the campaign
Prerequisites
Before starting a campaign, ensure:- Campaign has at least one contact imported
- Campaign status is
draft,scheduled, orpaused - Associated assistant is properly configured
Behavior
- Immediate schedule: Execution begins immediately
- Scheduled: Execution is queued for the scheduled time
- Paused campaigns: Resume execution from where it stopped
Response
Response (Immediate Start)
{
"success": true,
"message": "Campaign execution started immediately",
"task_id": "abc123-def456",
"campaign_id": 42,
"status": "scheduled"
}
Response (Scheduled)
{
"success": true,
"message": "Campaign scheduled for 2024-02-15 09:00:00 UTC",
"task_id": "abc123-def456",
"campaign_id": 42,
"status": "scheduled",
"scheduled_time": "2024-02-15T09:00:00Z"
}
Response Fields
| Field | Description |
|---|---|
success | Whether the operation succeeded |
message | Human-readable status message |
task_id | Background task identifier for tracking |
campaign_id | The campaign ID |
status | New campaign status |
scheduled_time | When execution will begin (for scheduled campaigns) |
Example Code
cURL
curl -X POST "https://api.burki.dev/api/v1/campaigns/42/start" \
-H "Authorization: Bearer YOUR_API_KEY"
Python
import requests
response = requests.post(
"https://api.burki.dev/api/v1/campaigns/42/start",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
result = response.json()
if result["success"]:
print(f"Campaign started! Task ID: {result['task_id']}")
else:
print(f"Error: {result}")
JavaScript
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42/start", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
const result = await response.json();
if (result.success) {
console.log(`Campaign started! Task ID: ${result.task_id}`);
} else {
console.error("Error:", result);
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Cannot start campaign - invalid status or no contacts |
| 400 | Scheduled time is in the past |
| 404 | Campaign not found |
| 500 | Background task system unavailable |
Common Error Messages
| Error | Solution |
|---|---|
| ”No contacts found” | Import contacts before starting |
| ”All contacts have already been processed” | Use re-execute endpoint to retry |
| ”Campaign is not running” | Campaign is already in wrong status |
| ”Scheduled time is in the past” | Update schedule to future time |
⌘I