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.

Attributes

Optional unless marked required

idintegerrequired
A unique identifier for the campaign which is given by User automatically. Passed in the URL path.
namestring
A Webpush campaign name.
etastring
A DateTime when the campaign should be sent. Delivery will start instantly if not provided.
ttlinteger
The number of seconds that a message may be stored if the user is not immediately available (Time To Live).
segmentinteger
A unique identifier for the user segment which is given by User automatically.
messageslist
A list of objects. Each object is a valid web push message (check out the Webpush Message attributes). Replaces the existing messages when provided.

Message attributes

Optional unless marked required

titlestringrequired
A title of a web push message.
bodystringrequired
A content of a web push message.
urlstring
A URL of a web push message.
require_interactionboolean
A flag defining if a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
doughnut_titlestring
Action button 1 label.
doughnut_urlstring
Action button 1 URL.
coffee_titlestring
Action button 2 label.
coffee_urlstring
Action button 2 URL.
iconstring
A URL of image inside a web push message.
badgestring
A 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/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring sale push, last day",
"messages": [
{
"title": "The spring sale ends today",
"body": "Save up to 30% on outdoor gear.",
"url": "https://example.com/sale",
"require_interaction": false
}
]
}'

Response examples​

{
"id": 1,
"name": "string",
"category": null,
"eta": "2026-01-01T12:00:00Z",
"ttl": 1,
"folder": null
}

Response fields​

Fields returned in the 200 OK response body.

idinteger
A unique identifier for the campaign.
namestring
A Webpush campaign name.
categoryinteger or nullnullable
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.
etastring (date-time)
A DateTime when the campaign is scheduled to be sent. null if sent immediately.
ttlinteger
Time-to-live in seconds.
folderintegernullable
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.