Contact activity
const url = 'https://api.getsitecontrol.com/v1/sites/1/contacts/1/activity?limit=50&order=oldest';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.getsitecontrol.com/v1/sites/1/contacts/1/activity?limit=50&order=oldest' \ --header 'Authorization: Bearer <token>'Events of one contact, oldest first (order=newest for the latest
first): widget events, e-mails received,
bounced and unsubscribed, clicks, automation runs, the e-mail confirmation
and the creation of the contact. Call it to see what a contact did and
received. E-mail opens are not listed.
For e-mail events source_id is the broadcast or the automation that sent
the message and source_name is its subject. The URL of a click is given
without its query string. response_id is the form submission for
get_response.
A page holds up to limit events; while next_cursor is set, pass it as
cursor for the next page. occurred_since includes events at that moment. Merge
repeated reads by id: occurred_at is given to the second, so it does not
order events within one second; the cursor keeps the exact order.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Contact id from list_contacts
Contact id from list_contacts
Query Parameters
Section titled “Query Parameters”next_cursor of the previous page, sent with the same order; omit for the first
next_cursor of the previous page, sent with the same order; omit for the first
Events per page
Events per page
Order of the events: oldest first (default) or newest first
Order of the events: oldest first (default) or newest first
Only events at or after this moment; without an offset, taken as UTC; a plain date means its start
Only events at or after this moment; without an offset, taken as UTC; a plain date means its start
Only events of these types; repeat for several. contactCreate and emailConfirmed are the contact’s own, widget* widget events, email* e-mails and their clicks, automationStart and automationEnd the start and the end of automation runs
Only events of these types; repeat for several. contactCreate and emailConfirmed are the contact’s own, widget* widget events, email* e-mails and their clicks, automationStart and automationEnd the start and the end of automation runs
Responses
Section titled “Responses”One page of a list; next_cursor is null on the last page.
object
object
Stable across pages: the same event keeps its id
One of: contactCreate, emailConfirmed, widgetAddToCart, widgetApplyCoupon, widgetCopyToClipboard, widgetOpenUrl, widgetShow, widgetShowWidget, widgetSubmit, emailReceive, emailBounce, emailUnsubscribe, emailClick, emailViewProduct, emailContinueCheckout, emailViewOrder, emailBuyNow, emailAddToCart, emailApplyDiscount, automationStart, automationEnd
When it happened, UTC
What the event came from: contact the contact itself (its creation, the e-mail confirmation), widget a widget, broadcast a broadcast, automation an automation
The widget, the broadcast or the automation; for e-mails the broadcast or the automation that sent it
The widget or automation name; for e-mails the subject of the message
The button or link of a click, without the query string of its URL; the link, coupon or copied text of a widget event
The form submission for get_response, when it is listed there
For automationStart and automationEnd: the trigger of the automation as it is now, as in get_automation
{ "items": [ { "source_type": "contact", "trigger_type": "widget_submit" } ]}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Authentication scheme: Bearer
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
contact_not_found: no contact with this id on the site, or it is deleted
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
invalid_cursor: cursor was not issued here or was issued for another order. validation_failed: a parameter is invalid
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
rate_limited: a request limit is spent; this request also spends the heavy request limit
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Seconds until the bucket refills
temporarily_unavailable: the request took too long, or limits or idempotency keys cannot be enforced; narrow the filters or retry later
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds