Skip to main content
Retrieve the current schedule configuration for a campaign.

Path Parameters

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

Response

Response (Immediate)
{
  "schedule_type": "immediate",
  "scheduled_at": null,
  "recurring_config": null
}
Response (Scheduled)
{
  "schedule_type": "scheduled",
  "scheduled_at": "2024-02-15T09:00:00Z",
  "recurring_config": null
}
Response (Recurring)
{
  "schedule_type": "recurring",
  "scheduled_at": "2024-02-15T09:00:00Z",
  "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"
  }
}

Response Fields

FieldDescription
schedule_typeSchedule type: immediate, scheduled, or recurring
scheduled_atScheduled execution time (ISO 8601 UTC)
recurring_configRecurring schedule configuration (if applicable)

Recurring Config Fields

FieldDescription
frequencydaily, weekly, or monthly
intervalEvery N days/weeks/months
days_of_weekDays for weekly schedules (1=Monday, 7=Sunday)
timeExecution time (24-hour format)
time_zoneTimezone for scheduling
end_dateWhen to stop recurring

Example Code

cURL
curl -X GET "https://api.burki.dev/api/v1/campaigns/42/schedule" \
  -H "Authorization: Bearer YOUR_API_KEY"
Python
import requests
from datetime import datetime

response = requests.get(
    "https://api.burki.dev/api/v1/campaigns/42/schedule",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

schedule = response.json()

if schedule["schedule_type"] == "immediate":
    print("Campaign set for immediate execution")
elif schedule["schedule_type"] == "scheduled":
    scheduled_at = datetime.fromisoformat(schedule["scheduled_at"].replace("Z", "+00:00"))
    print(f"Campaign scheduled for: {scheduled_at}")
elif schedule["schedule_type"] == "recurring":
    config = schedule["recurring_config"]
    print(f"Recurring {config['frequency']} at {config['time']} {config['time_zone']}")
JavaScript
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42/schedule", {
  headers: {
    "Authorization": "Bearer YOUR_API_KEY"
  }
});

const schedule = await response.json();

switch (schedule.schedule_type) {
  case "immediate":
    console.log("Campaign set for immediate execution");
    break;
  case "scheduled":
    console.log(`Campaign scheduled for: ${schedule.scheduled_at}`);
    break;
  case "recurring":
    const config = schedule.recurring_config;
    console.log(`Recurring ${config.frequency} at ${config.time} ${config.time_zone}`);
    break;
}

Error Responses

Status CodeDescription
404Campaign not found
401Unauthorized