This article will cover the following:
Overview
The Notifications API lets you programmatically retrieve, create, and delete notification rules. Combine it with the Offers API to automatically set up cap alerts whenever a new offer is created.
List Notifications
GET /api/2/notifications.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| notification_id | integer | No | Filter by a specific notification record ID. |
| user_id | integer | No | Filter notifications assigned to a specific user. |
| notification_type_id | integer | No | Filter by notification type category. |
Sample request
GET https://yourdomain.cake.com/api/2/notifications.json
?api_key=YOUR_API_KEY
&user_id=42Sample response
{
"request_status": "Success",
"notifications": [
{"notification_id": 8, "user_id": 42, "notification_type_id": 3, "offer_id": 12345, "threshold_value": 500, "email_address": "manager@example.com", "is_active": true},
{"notification_id": 11, "user_id": 42, "notification_type_id": 3, "offer_id": 12345, "threshold_value": 1000, "email_address": "director@example.com", "is_active": true}
]
}Create Notification
POST /api/2/notification.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | integer | Yes | ID of the user who owns this notification. |
| notification_type_id | integer | Yes | Integer identifying the event type that triggers the alert. |
| offer_id | integer | No | Scope the alert to a specific offer. Omit to apply globally. |
| threshold_value | decimal | No | Numeric threshold that triggers the alert (e.g., 500 conversions). |
| email_address | string | No | Email address to receive automated alert messages. |
Sample request
POST https://yourdomain.cake.com/api/2/notification.json
{
"api_key": "YOUR_API_KEY",
"user_id": 42,
"notification_type_id": 3,
"offer_id": 12345,
"threshold_value": 500,
"email_address": "manager@example.com"
}Sample response
{
"request_status": "Success",
"notification": {
"notification_id": 8,
"threshold_value": 500,
"is_active": true
}
}Delete Notification
Permanently removes a notification rule. This action cannot be undone — recreate the notification via the create endpoint if needed.
POST /api/2/delete_notification.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| notification_id | integer | Yes | ID of the notification record to delete. |
Sample request
POST https://yourdomain.cake.com/api/2/delete_notification.json
{
"api_key": "YOUR_API_KEY",
"notification_id": 8
}Sample response
{
"request_status": "Success",
"notification_id": 8,
"deleted": true
}Tip:
Before deleting a notification, call GET /api/2/notifications.json filtered by user_id to confirm which notification IDs are active — this avoids accidentally removing the wrong rule.
Before deleting a notification, call GET /api/2/notifications.json filtered by user_id to confirm which notification IDs are active — this avoids accidentally removing the wrong rule.
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.