GET/ webpush-campaign/ :id/
Get webpush campaign
You can return a specific webpush campaign.
Attributes
Optional unless marked required
- id
- A unique identifier for the webpush campaign which is given by User automatically.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/webpush-campaign/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/webpush-campaign/:id/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/webpush-campaign/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/webpush-campaign/:id/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"id": 1,"description": "string","type": 1,"eta": "2026-01-01T12:00:00Z","name": "string","status": 1,"messages": [{"id": 1,"name": "string","message_id": 1,"message_title": "string","message_body": "string","message_badge": null,"message_icon": null,"message_url": "https://example.com","message_require_interaction": true,"message_doughnut_title": "string","message_doughnut_url": "string","message_actions": true,"message_coffee_title": "string","message_coffee_url": "string"}],"recipients": {"glue": "string","mode": "string","queries": [2 fields],"real_and": true,"real_and_models": {"deal": true,"company": true},"real_and_for_all_models": {"deal": true}},"recipients_count": 1,"created_at": "2026-01-01T12:00:00Z","updated_at": "2026-01-01T12:00:00Z","category": null,"ttl": 1,"user_activity_schedule": true,"advance_filtering": null,"multiple_domains_warning": true,"statistics": {"sent": 1,"scheduled": 1,"delivered": 1,"clicked": 1},"folder": null}{
"detail": "No WebpushCampaign matches the given query."
}
Response fields
Fields returned in the 200 OK response body.
- id
- A unique identifier for the campaign.
- description
- Campaign description.
- type
- Campaign type.
1= manual,2= automated. - eta
- A DateTime when the campaign is scheduled to be sent.
nullif sent immediately. - name
- A Webpush campaign name.
- status
- Campaign status.
1= draft,2= sent/active. - messages
- A list of message objects (see Webpush Message model for field details).
- messages[].
id - A unique identifier for the campaign.
- messages[].
name - A Webpush campaign name.
- messages[].
message_id - ID of the webpush message.
- messages[].
message_title - Title of the notification, up to 64 characters.
- messages[].
message_body - Text of the notification. Template tags are allowed; HTML is removed.
- messages[].
message_badge - URL of the large image shown at the top of the notification (Windows only).
- messages[].
message_icon - URL of the small icon shown in the notification.
- messages[].
message_url - URL opened when the notification is clicked.
- messages[].
message_require_interaction - Whether the notification stays on screen until the contact interacts with it.
- messages[].
message_doughnut_title - Label of the left action button.
- messages[].
message_doughnut_url - URL opened by the left action button.
- messages[].
message_actions - Whether the two action buttons are shown.
- messages[].
message_coffee_title - Label of the right action button.
- messages[].
message_coffee_url - URL opened by the right action button.
- messages[].
- recipients
- Segment query definition used to target recipients.
- recipients.
glue - How the filter groups combine:
ANDorOR. - recipients.
mode REGULAR, orINVERTEDto take the contacts that don't match.- recipients.
queries - Filter groups, one per field.
- recipients.
queries[]. field - Field the group filters on.
- recipients.
queries[]. queries - Conditions in the group.
- recipients.
queries[]. queries[]. glue - How the condition combines with the others in the group:
ANDorOR. - recipients.
queries[]. queries[]. field - Field the condition checks.
- recipients.
queries[]. queries[]. value - Value the condition compares with.
- recipients.
queries[]. queries[]. operator - Comparison, for example
equalorgreater.
- recipients.
- recipients.
- recipients.
real_and - Whether event conditions must be met by the same event occurrence.
- recipients.
real_and_models - Per record type, whether conditions must be met by the same record.
- recipients.
real_and_models. deal - Whether deal conditions must be met by the same deal. Used with
glueAND. - recipients.
real_and_models. company - Whether company conditions must be met by the same company. Used with
glueAND.
- recipients.
- recipients.
real_and_for_all_models - Per record type, whether conditions may be met by different records.
- recipients.
real_and_for_all_models. deal - Whether deal conditions may be met by different deals of the contact. Used with
glueAND.
- recipients.
- recipients.
- recipients_count
- Number of recipients matching the segment at the time of query.
- created_at
- ISO 8601 DateTime when the campaign was created.
- updated_at
- ISO 8601 DateTime when the campaign was last updated.
- 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. - ttl
- Time-to-live in seconds.
- user_activity_schedule
- Whether user activity schedule is enabled.
- advance_filtering
- Advanced filtering configuration, or
null. - multiple_domains_warning
- Whether a multiple domains warning is present.
- statistics
- Campaign delivery statistics (see below).
- statistics.
sent - Number of notifications sent.
- statistics.
scheduled - Number of notifications scheduled.
- statistics.
delivered - Number of notifications delivered.
- statistics.
clicked - Number of notifications clicked.
- statistics.
- folder
- ID of the folder the campaign is in, or
null.
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.