{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Campaigns
Save Campaign Schedule
Create or update a campaign schedule.
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
schedule
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}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
| Field | Type | Required | Description |
|---|---|---|---|
schedule_type | string | Yes | immediate, scheduled, or recurring |
scheduled_at | string | Conditional | ISO 8601 datetime (required for scheduled) |
timezone | string | No | Timezone for scheduling (default: UTC) |
recurring_config | object | Conditional | Required for recurring type |
Schedule Types
Immediate
Immediate
Campaign starts when you call the start endpoint.Effect: Campaign status remains
Request
{
"schedule_type": "immediate"
}
draft until started manually.Scheduled (Once)
Scheduled (Once)
Campaign runs at a specific date and time.Effect: Campaign status changes to
Request
{
"schedule_type": "scheduled",
"scheduled_at": "2024-02-15T09:00:00",
"timezone": "America/New_York"
}
scheduled automatically.Recurring
Recurring
Campaign runs on a repeating schedule.Effect: Campaign status changes to
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"
}
}
scheduled automatically.Recurring Config Options
| Field | Type | Description |
|---|---|---|
frequency | string | daily, weekly, or monthly |
interval | integer | Every N periods (e.g., every 2 weeks) |
days_of_week | array | Days for weekly (1-7, Monday=1) |
day_of_month | integer | Day for monthly (1-31) |
time | string | Time in 24-hour format (HH:MM) |
time_zone | string | Timezone (e.g., America/New_York) |
end_date | string | Stop 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
draftifscheduled - Scheduled/Recurring: Creates schedule record, sets campaign to
scheduled - Past times: Returns 400 error - time must be in the future
Error Responses
| Status Code | Description |
|---|---|
| 400 | Scheduled time is in the past |
| 400 | Invalid schedule configuration |
| 404 | Campaign not found |
| 500 | Failed to save schedule |
Timezone Support
Common timezone values:| Region | Timezone |
|---|---|
| US Eastern | America/New_York |
| US Central | America/Chicago |
| US Mountain | America/Denver |
| US Pacific | America/Los_Angeles |
| UK | Europe/London |
| Central Europe | Europe/Paris |
| UTC | UTC |
Always specify timezone when scheduling. If omitted, the system uses UTC which may not match your intended local time.
⌘I