https://<subdomain>.sendsmaily.net/api/v2/subscriptions/events


Query parameters


Parameter
Type
Required

start_at
Date and time
Yes
Events date range filter start date. Accepts UNIX epoch time and ISO 8601 formatted datetime string value.
end_at
Date and time
Yes
Events date range filter end date. Accepts same value types as start_at.
date_field
String

Events date range filter target field. Accepts either created_at (event creation date and time) or logged_at (event process date and time) value. When omitted created_at will be used.
type
List (comma separated)

Event types filter. Accepts comma separated list of values from available event types - unsubscribed. When omitted all event types are returned.
offset
Integer

Page number, which begins at zero. Offset value is multiplied by value of limit to determine the number of events to return. When omitted zero (0) will be used.
limit
Integer

Number of events per page. When omitted 100 will be used. Can have maximum value of 10000.



Common payload

Each event contains at least these fields.


Field
Type

event_id
UUID
Event's unique identifier.
version
Integer
Event's specification version.
type
String
Event type identifier.
created_at
Date and time
ISO 8601 formatted date and time of event's creation.
logged_at
Date and time
ISO 8601 formatted date and time of event's process.



Events


unsubscribed

Emitted when recipient unsubscribes through the {{subscription}} link in the message.


Along side common payload fields event's payload contains following field(s):

Field
Type

message_id
UUID
Unique message identifier.
campaign_pk
UUID
Reference to campaign entity.
post_pk
UUID
Reference to campaign's post entity.
contact_pk
UUID
Reference to contact entity.
ip_address
IP-address
Public IP-address of the unsubscriber.


Example document:

{
    'event_id': 'f9e7f5df-3eb1-44e1-9fd7-d0914a0830ea',
    'type': 'unsubscribed',
    'version': 1,
    'created_at': '2017-09-11T17:20:51+00:00',
    'logged_at': '2017-09-11T17:21:51+00:00',
    'message_id': '7b65c566-6352-4440-b51c-c69f1e1fb888',
    'campaign_pk': '3ce70fde-c0de-402d-bd7c-985b459c3b13',
    'post_pk': 'e42d6cdc-4721-4f37-9386-08812dc98441',
    'contact_pk': 'f51e734a-e27d-4696-8340-5426308aba11',
    'ip_address': '1.2.3.4',
}