Report a banner, story or page engagement event (access token in the header)
- Path
/push/events- Auth
- Access token · browser or app
const url = 'https://releva.ai/api/v0/push/events';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"deviceId":"demo-device-pb-1","sessionId":"demo-session-pb-1","action":"storySlideClick","attributions":{"storyId":"5a9d2c1e-3b4f-4e6a-8c7d-1e2f3a4b5c6d"},"page":{"url":"https://demo-store.example.com/"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://releva.ai/api/v0/push/events \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "action": "storySlideClick", "attributions": { "storyId": "5a9d2c1e-3b4f-4e6a-8c7d-1e2f3a4b5c6d" }, "page": { "url": "https://demo-store.example.com/" } }'The same call as POST /push/events/{accessToken}, with the access token sent as
authorization: Bearer <accessToken> instead of in the path. When both are sent, the header wins.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The visitor’s device id, the same value as context.deviceId on the push. One of deviceId or profileId
must be non-empty.
The visitor’s session id.
bannerClick, bannerClose, storyImpression, storySlideView, storySlideClick, storyComplete,
storyClose or pageEngagement. Any other string is stored as an event of that name.
The known profile id
object
The banner block token from the push response.
The bannerId from the push response
The story token from the push response.
object
For pageEngagement.
For pageEngagement. Under 1000 is not stored.
The browser’s A/B test bucket (the SDK’s rlv_g cookie). An empty string or null counts as absent.
Example
{ "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "action": "storySlideClick", "attributions": { "storyId": "5a9d2c1e-3b4f-4e6a-8c7d-1e2f3a4b5c6d" }, "page": { "url": "https://demo-store.example.com/" }}Responses
Section titled “Responses”Accepted. The event is stored asynchronously.
object
Example
{}Authentication or validation error.
object
Human-readable error. Several validation errors are joined with a space.
Examples
{ "message": "Authorization header is malformed. It should look like `Bearer <string>`."}{ "message": "Authorization header is missing, and accessToken url parameters is also missing. At least one of them is required."}{ "message": "The 'deviceId' field is required. The 'sessionId' field is required."}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}Unexpected server error.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "An internal error occurred."}