Skip to main content

Webpush campaign model

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

Input fields (Create / Update)​

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 model).
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).

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:

AttributesTypeDescription
idintegerA unique identifier for the campaign.
namestringA Webpush campaign name.
descriptionstringCampaign description.
typeintegerCampaign type. 1 = manual, 2 = automated.
statusintegerCampaign status. 1 = draft, 2 = sent/active.
etastringA DateTime when the campaign is scheduled to be sent. null if sent immediately.
messageslistA list of message objects (see Webpush Message model for field details).
recipientsobjectSegment query definition used to target recipients.
recipients_countintegerNumber of recipients matching the segment at the time of query.
created_atstringISO 8601 DateTime when the campaign was created.
updated_atstringISO 8601 DateTime when the campaign was last updated.
categoryinteger or nullDeprecated (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.
ttlintegerTime-to-live in seconds.
user_activity_schedulebooleanWhether user activity schedule is enabled.
advance_filteringobjectAdvanced filtering configuration, or null.
multiple_domains_warningbooleanWhether a multiple domains warning is present.
statisticsobjectCampaign delivery statistics (see below).

Statistics object​

FieldTypeDescription
sentintegerNumber of notifications sent.
scheduledintegerNumber of notifications scheduled.
deliveredintegerNumber of notifications delivered.
clickedintegerNumber of notifications clicked.