Skip to content

Guest API: Events

Product events from the app or website, in batches.

What it doesRoute
Send product eventsPOST /guest/v1/events

POST /guest/v1/events

A batch of up to 50 events. Each is kept or refused on its own; an event’s id makes a retry safe. Send the standard events and the ones your app defines on the Data page.

Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.

Body (application/json): EventsBody

FieldTypeDescription
app_version (always)string
events (always)array of EventBody
platform (always)DevicePlatform (one of ios, android, web)
sent_atstring (date-time)The phone’s clock as it sent the batch, drawn again for each attempt: PurrCRM measures the phone’s clock by it (ClockSkew) and moves every event’s OccurredAt by as much, so that a phone whose clock is wrong neither makes everything late nor puts it in the future. Left out by apps older than it, whose events are taken as their clocks say.
time_zonestringThe phone’s IANA zone name (“Europe/London”), which PurrCRM uses for a guest’s quiet hours. Left out when the phone does not say.

Answers

StatusBodyMeaning
202EventsAcceptedAccepted
400problemThe request could not be read: the problem names the field.
401problemNo credential, or one that is not right.
403problemRefused: the app is switched off, or this is not allowed.
429problemToo many requests: wait for Retry-After.