Skip to main content
PATCH/webpush-campaign/:id/

Update webpush campaign

You can update a specific webpush campaign. This endpoint supports partial updates — only the fields you include in the request body will be modified.

AttributesTypeRequiredDescription
idintegeryesA unique identifier for the campaign which is given by User.com automatically. Passed in the URL path.
namestringnoA Webpush campaign name.
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).
segmentintegernoA unique identifier for the user segment which is given by User.com automatically.
messageslistnoA list of objects. Each object is a valid web push message (check out the Webpush Message attributes). Replaces the existing messages when provided.
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 PATCH \
"https://<your_app_subdomain>.user.com/api/public/webpush-campaign/3/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Campaign Name",
"messages": [
{
"title": "New Push Title",
"body": "Updated notification text.",
"url": "https://yoursite.com/new-page"
}
]
}'

Response​

{
"id": 3,
"name": "Updated Campaign Name",
"category": null,
"eta": null,
"ttl": 259200
}