Skip to main content
POST/webpush-campaign/

Create webpush campaigns

You can create a webpush campaign.

AttributesTypeRequiredDescription
namestringyesA Webpush campaign name.
segmentintegeryesA unique identifier for the user segment which is given by User.com automatically.
messageslistyesA list of objects. Each object is a valid web push message (check out the Webpush Message attributes).
etastringnoA DateTime when the campaign should be sent. Delivery will start instantly if not provided.
ttlintegernoThe number of seconds that a message may be stored if the user is not immediately available (Time To Live). Default: 259200 (3 days).
Message attributesTypeRequiredDescription
titlestringyesA title of a web push message.
bodystringyesA content of a web push message.
urlstringnoA URL of a web push message.
require_interactionbooleannoA flag defining if a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
doughnut_titlestringnoAction button 1 label.
doughnut_urlstringnoAction button 1 URL.
coffee_titlestringnoAction button 2 label.
coffee_urlstringnoAction button 2 URL.
iconstringnoA URL of image inside a web push message.
badgestringnoA URL of image inside a web push message (known as a Big photo). Only works on Windows.

Request​

curl -X POST \
"https://<your_app_subdomain>.user.com/api/public/webpush-campaign/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring Sale Push",
"eta": "2026-04-01T12:00:00Z",
"ttl": 86400,
"messages": [
{
"title": "Spring Sale is Live!",
"body": "Up to 50% off selected items. Shop now!",
"url": "https://yoursite.com/sale",
"require_interaction": true,
"doughnut_title": "Shop Now",
"doughnut_url": "https://yoursite.com/sale",
"coffee_title": "Learn More",
"coffee_url": "https://yoursite.com/about-sale",
"icon": "https://yoursite.com/icon-192.png",
"badge": "https://yoursite.com/badge-512.png"
}
],
"segment": 1
}'

Response​

{
"id": 3,
"name": "Spring Sale Push",
"category": null,
"eta": "2026-04-01T12:00:00Z",
"ttl": 86400
}