GET/ webpush-campaign/
Get webpush campaigns
You can return a list of all webpush campaigns.
Results are paginated: follow next to get the next page (see Response pagination).
- cURL
- JavaScript
- PHP
- Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
"https://<your_app_subdomain>.user.com/api/public/webpush-campaign/"
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/public/webpush-campaign/");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("accept", "*/*; version=2");
xhr.send(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/webpush-campaign/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Accept: */*; version=2",
"authorization: Token <your_64_char_api_key>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://<your_app_subdomain>.user.com/api/public/webpush-campaign/"
headers = {'authorization': 'Token <your_64_char_api_key>'}
response = requests.get(url, headers=headers)
print(response.text)
Response examples
- 200 OK
{"count": 2,"next": null,"previous": null,"results": [{"id": 18,"description": "","type": 1,"eta": "2026-11-24T14:03:57Z","name": "Spring sale push","status": 1,"messages": ,1 item"recipients": ,6 fields"recipients_count": 0,"created_at": "2026-11-17T15:03:58.451279Z","updated_at": "2026-11-17T15:03:58.451303Z","category": null,"ttl": 86400,"user_activity_schedule": false,"advance_filtering": null,"multiple_domains_warning": false,"statistics": ,4 fields"folder": null},{"id": 17,"description": "","type": 1,"eta": "2026-11-24T13:55:18Z","name": "20261117-1551-Spring sale push, last day","status": 2,"messages": ,1 item"recipients": ,6 fields"recipients_count": 0,"created_at": "2026-11-17T14:55:19.229725Z","updated_at": "2026-11-17T14:55:19.229741Z","category": null,"ttl": 86400,"user_activity_schedule": false,"advance_filtering": null,"multiple_domains_warning": false,"statistics": ,4 fields"folder": null}]}Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
id - A unique identifier for the campaign.
- results[].
description - Campaign description.
- results[].
type - Campaign type.
1= manual,2= automated. - results[].
eta - A DateTime when the campaign is scheduled to be sent.
nullif sent immediately. - results[].
name - A Webpush campaign name.
- results[].
status - Campaign status.
1= draft,2= sent/active. - results[].
messages - A list of message objects (see Webpush Message model for field details).
- results[].
messages[]. id - A unique identifier for the campaign.
- results[].
messages[]. name - A Webpush campaign name.
- results[].
messages[]. message_id - ID of the webpush message.
- results[].
messages[]. message_title - Title of the notification, up to 64 characters.
- results[].
messages[]. message_body - Text of the notification. Template tags are allowed; HTML is removed.
- results[].
messages[]. message_badge - URL of the large image shown at the top of the notification (Windows only).
- results[].
messages[]. message_icon - URL of the small icon shown in the notification.
- results[].
messages[]. message_url - URL opened when the notification is clicked.
- results[].
messages[]. message_require_interaction - Whether the notification stays on screen until the contact interacts with it.
- results[].
messages[]. message_doughnut_title - Label of the left action button.
- results[].
messages[]. message_doughnut_url - URL opened by the left action button.
- results[].
messages[]. message_actions - Whether the two action buttons are shown.
- results[].
messages[]. message_coffee_title - Label of the right action button.
- results[].
messages[]. message_coffee_url - URL opened by the right action button.
- results[].
- results[].
recipients - Segment query definition used to target recipients.
- results[].
recipients_count - Number of recipients matching the segment at the time of query.
- results[].
created_at - ISO 8601 DateTime when the campaign was created.
- results[].
updated_at - ISO 8601 DateTime when the campaign was last updated.
- results[].
category - Deprecated (replaced by folders). Read-only. Existing campaigns may return a legacy category value; new campaigns always return
null. Folder assignment will be available in the next API version. - results[].
ttl - Time-to-live in seconds.
- results[].
user_activity_schedule - Whether user activity schedule is enabled.
- results[].
advance_filtering - Advanced filtering configuration, or
null. - results[].
multiple_domains_warning - Whether a multiple domains warning is present.
- results[].
statistics - Campaign delivery statistics (see below).
- results[].
statistics. sent - Number of notifications sent.
- results[].
statistics. scheduled - Number of notifications scheduled.
- results[].
statistics. delivered - Number of notifications delivered.
- results[].
statistics. clicked - Number of notifications clicked.
- results[].
- results[].
folder - ID of the folder the campaign is in, or
null.
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.