How to Automate Report Schedules via the CAKE API

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
ParameterTypeRequiredDescription
schedule_idintegerNoFilter to a specific schedule by ID.
user_idintegerNoFilter schedules belonging to a specific user.
schedule_statusstringNoFilter by status: active or inactive.
start_at_rowintegerNoRow offset. Default: 0.
row_limitintegerNoMax 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=25

Sample 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
ParameterTypeRequiredDescription
user_idintegerYesID of the user who owns this schedule.
schedule_type_idintegerYesThe type of schedule task. Confirm valid IDs with your CAKE admin.
schedule_namestringYesA descriptive label for the schedule.
frequencystringYesDelivery cadence: daily, weekly, or monthly.
start_datedateYesDate the schedule becomes active. Format: YYYY-MM-DD.
email_addressesstringYesComma-separated list of recipient email addresses.
report_typestringYesThe 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
ParameterTypeRequiredDescription
schedule_idintegerYesID of the schedule to update.
schedule_namestringNoUpdated display name.
schedule_statusstringNoSet to active or inactive to enable or pause.
frequencystringNoUpdated cadence: daily, weekly, or monthly.
email_addressesstringNoUpdated 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
ParameterTypeRequiredDescription
schedule_idintegerYesID 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.


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.