Skip to main content
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, or paused
  • 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

FieldDescription
successWhether the operation succeeded
messageHuman-readable status message
task_idBackground task identifier for tracking
campaign_idThe campaign ID
statusNew campaign status
scheduled_timeWhen 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 CodeDescription
400Cannot start campaign - invalid status or no contacts
400Scheduled time is in the past
404Campaign not found
500Background task system unavailable

Common Error Messages

ErrorSolution
”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