Skip to main content
Create or update the schedule for a campaign. Setting a schedule automatically updates the campaign status.

Path Parameters

  • campaign_id (integer, required): The unique identifier of the campaign

Request Body

FieldTypeRequiredDescription
schedule_typestringYesimmediate, scheduled, or recurring
scheduled_atstringConditionalISO 8601 datetime (required for scheduled)
timezonestringNoTimezone for scheduling (default: UTC)
recurring_configobjectConditionalRequired for recurring type

Schedule Types

Campaign starts when you call the start endpoint.
Request
{
  "schedule_type": "immediate"
}
Effect: Campaign status remains draft until started manually.
Campaign runs at a specific date and time.
Request
{
  "schedule_type": "scheduled",
  "scheduled_at": "2024-02-15T09:00:00",
  "timezone": "America/New_York"
}
Effect: Campaign status changes to scheduled automatically.
Campaign runs on a repeating schedule.
Request
{
  "schedule_type": "recurring",
  "scheduled_at": "2024-02-15T09:00:00",
  "timezone": "America/New_York",
  "recurring_config": {
    "frequency": "weekly",
    "interval": 1,
    "days_of_week": [1, 2, 3, 4, 5],
    "time": "09:00",
    "time_zone": "America/New_York",
    "end_date": "2024-12-31"
  }
}
Effect: Campaign status changes to scheduled automatically.

Recurring Config Options

FieldTypeDescription
frequencystringdaily, weekly, or monthly
intervalintegerEvery N periods (e.g., every 2 weeks)
days_of_weekarrayDays for weekly (1-7, Monday=1)
day_of_monthintegerDay for monthly (1-31)
timestringTime in 24-hour format (HH:MM)
time_zonestringTimezone (e.g., America/New_York)
end_datestringStop date (ISO 8601)

Response

Response
{
  "success": true,
  "message": "Schedule saved"
}

Example Code

cURL
# Immediate schedule
curl -X POST "https://api.burki.dev/api/v1/campaigns/42/schedule" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schedule_type": "immediate"}'

# Scheduled for specific time
curl -X POST "https://api.burki.dev/api/v1/campaigns/42/schedule" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule_type": "scheduled",
    "scheduled_at": "2024-02-15T09:00:00",
    "timezone": "America/New_York"
  }'
Python
import requests

# Schedule for a specific time
response = requests.post(
    "https://api.burki.dev/api/v1/campaigns/42/schedule",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "schedule_type": "scheduled",
        "scheduled_at": "2024-02-15T09:00:00",
        "timezone": "America/New_York"
    }
)

print(response.json()["message"])

# Set up weekly recurring schedule
response = requests.post(
    "https://api.burki.dev/api/v1/campaigns/42/schedule",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "schedule_type": "recurring",
        "scheduled_at": "2024-02-15T09:00:00",
        "timezone": "America/New_York",
        "recurring_config": {
            "frequency": "weekly",
            "interval": 1,
            "days_of_week": [1, 2, 3, 4, 5],  # Monday-Friday
            "time": "09:00",
            "time_zone": "America/New_York",
            "end_date": "2024-12-31"
        }
    }
)
JavaScript
// Schedule for a specific time
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42/schedule", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    schedule_type: "scheduled",
    scheduled_at: "2024-02-15T09:00:00",
    timezone: "America/New_York"
  })
});

const result = await response.json();
console.log(result.message);

Behavior

  • Immediate: Clears any existing schedule, reverts to draft if scheduled
  • Scheduled/Recurring: Creates schedule record, sets campaign to scheduled
  • Past times: Returns 400 error - time must be in the future

Error Responses

Status CodeDescription
400Scheduled time is in the past
400Invalid schedule configuration
404Campaign not found
500Failed to save schedule

Timezone Support

Common timezone values:
RegionTimezone
US EasternAmerica/New_York
US CentralAmerica/Chicago
US MountainAmerica/Denver
US PacificAmerica/Los_Angeles
UKEurope/London
Central EuropeEurope/Paris
UTCUTC
Always specify timezone when scheduling. If omitted, the system uses UTC which may not match your intended local time.