Skip to main content

Webpush campaign model

You can send web pushes and get statistics of your campaigns through API.

Input fields (Create / Update)​

Attributes

Optional unless marked required

namestringrequired
A Webpush campaign name.
segmentintegerrequired
A unique identifier for the user segment which is given by User.com automatically.
messageslistrequired
A list of objects. Each object is a valid web push message (check out the Webpush Message model).
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). Default: 259200 (3 days).

Note: The category field is deprecated for webpush campaigns — categories have been replaced by folders in User.com. New campaigns cannot be assigned a category via the API (the value is accepted but not saved). Existing campaigns created before the deprecation may still return a non-null category value in GET responses. Folder assignment will be available in the next version of the API.

Create / Update response​

The response from POST (create) and PATCH (update) endpoints returns a minimal object:

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

GET response (full model)​

The GET endpoints return the full campaign object with all fields:

Attributes

idinteger
A unique identifier for the campaign.
namestring
A Webpush campaign name.
descriptionstring
Campaign description.
typeinteger
Campaign type. 1 = manual, 2 = automated.
statusinteger
Campaign status. 1 = draft, 2 = sent/active.
etastring
A DateTime when the campaign is scheduled to be sent. null if sent immediately.
messageslist
A list of message objects (see Webpush Message model for field details).
recipientsobject
Segment query definition used to target recipients.
recipients_countinteger
Number of recipients matching the segment at the time of query.
created_atstring
ISO 8601 DateTime when the campaign was created.
updated_atstring
ISO 8601 DateTime when the campaign was last updated.
categoryinteger or null
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.
ttlinteger
Time-to-live in seconds.
user_activity_scheduleboolean
Whether user activity schedule is enabled.
advance_filteringobject
Advanced filtering configuration, or null.
multiple_domains_warningboolean
Whether a multiple domains warning is present.
statisticsobject
Campaign delivery statistics (see below).
folderinteger
ID of the folder the campaign is in, or null.

Statistics object​

sentinteger
Number of notifications sent.
scheduledinteger
Number of notifications scheduled.
deliveredinteger
Number of notifications delivered.
clickedinteger
Number of notifications clicked.