This article will cover the following:
Overview
The Schedules API allows you to programmatically create, retrieve, update, and delete automated report schedules. Use it to provision scheduled reports for new advertisers automatically or to sync schedule configurations from an external system.
List Schedules
GET /api/2/schedules.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| schedule_id | integer | No | Filter to a specific schedule by ID. |
| user_id | integer | No | Filter schedules belonging to a specific user. |
| schedule_status | string | No | Filter by status: active or inactive. |
| start_at_row | integer | No | Row offset. Default: 0. |
| row_limit | integer | No | Max records. Default: 25. |
Sample request
GET https://your-domain.cake.com/api/2/schedules.json
?api_key=YOUR_API_KEY
&schedule_status=active
&row_limit=25Sample response
{
"request_status": "Success",
"schedules": [{
"schedule_id": 301,
"user_id": 14,
"schedule_name": "Weekly Affiliate Summary",
"frequency": "weekly",
"schedule_status": "active",
"report_type": "affiliate_summary",
"last_run": "2024-06-10T08:00:00Z"
}],
"total_rows": 1
}Create Schedule
POST /api/2/schedule.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | integer | Yes | ID of the user who owns this schedule. |
| schedule_type_id | integer | Yes | The type of schedule task. Confirm valid IDs with your CAKE admin. |
| schedule_name | string | Yes | A descriptive label for the schedule. |
| frequency | string | Yes | Delivery cadence: daily, weekly, or monthly. |
| start_date | date | Yes | Date the schedule becomes active. Format: YYYY-MM-DD. |
| email_addresses | string | Yes | Comma-separated list of recipient email addresses. |
| report_type | string | Yes | The CAKE report this schedule will generate and deliver. |
Sample request
POST https://your-domain.cake.com/api/2/schedule.json
{
"api_key": "YOUR_API_KEY",
"user_id": 14,
"schedule_type_id": 2,
"schedule_name": "Weekly Affiliate Summary",
"frequency": "weekly",
"start_date": "2024-01-01",
"email_addresses": "reports@example.com,manager@example.com",
"report_type": "affiliate_summary"
}Sample response
{
"request_status": "Success",
"schedule": {
"schedule_id": 301,
"schedule_name": "Weekly Affiliate Summary",
"frequency": "weekly",
"schedule_status": "active"
}
}Update Schedule
POST /api/2/update_schedule.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| schedule_id | integer | Yes | ID of the schedule to update. |
| schedule_name | string | No | Updated display name. |
| schedule_status | string | No | Set to active or inactive to enable or pause. |
| frequency | string | No | Updated cadence: daily, weekly, or monthly. |
| email_addresses | string | No | Updated comma-separated recipient list. |
Sample request
POST https://your-domain.cake.com/api/2/update_schedule.json
{
"api_key": "YOUR_API_KEY",
"schedule_id": 301,
"schedule_status": "inactive"
}Sample response
{
"request_status": "Success",
"schedule": {
"schedule_id": 301,
"schedule_status": "inactive"
}
}Delete Schedule
Permanently removes a schedule. Deleted schedules cannot be recovered — use Update Schedule to set status to inactive if you may want to resume it later.
POST /api/2/delete_schedule.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| schedule_id | integer | Yes | ID of the schedule to delete. |
Sample request
POST https://your-domain.cake.com/api/2/delete_schedule.json
{
"api_key": "YOUR_API_KEY",
"schedule_id": 301
}Sample response
{
"request_status": "Success",
"schedule_id": 301,
"deleted": true
}If you have any questions, please reach out to your dedicated CAKE Client Success Manager/Account Manager or contact the CAKE Support Team at support@getCAKE.com.