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
- name
- A Webpush campaign name.
- segment
- A unique identifier for the user segment which is given by User.com automatically.
- messages
- A list of objects. Each object is a valid web push message (check out the Webpush Message model).
- eta
- A DateTime when the campaign should be sent. Delivery will start instantly if not provided.
- ttl
- 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
categoryfield 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
- id
- A unique identifier for the campaign.
- name
- A Webpush campaign name.
- description
- Campaign description.
- type
- Campaign type.
1= manual,2= automated. - status
- Campaign status.
1= draft,2= sent/active. - eta
- A DateTime when the campaign is scheduled to be sent.
nullif sent immediately. - messages
- A list of message objects (see Webpush Message model for field details).
- recipients
- Segment query definition used to target recipients.
- recipients_count
- Number of recipients matching the segment at the time of query.
- created_at
- ISO 8601 DateTime when the campaign was created.
- updated_at
- ISO 8601 DateTime when the campaign was last updated.
- category
- 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. - ttl
- Time-to-live in seconds.
- user_activity_schedule
- Whether user activity schedule is enabled.
- advance_filtering
- Advanced filtering configuration, or
null. - multiple_domains_warning
- Whether a multiple domains warning is present.
- statistics
- Campaign delivery statistics (see below).
- folder
- ID of the folder the campaign is in, or
null.
Statistics object
- sent
- Number of notifications sent.
- scheduled
- Number of notifications scheduled.
- delivered
- Number of notifications delivered.
- clicked
- Number of notifications clicked.