Skip to content

Area: Developers

POST

Report a banner, story or page engagement event (access token in the header)

Path
/push/events
Auth
Access token · browser or app
POST
/push/events
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.

Media typeapplication/json
object
deviceId
required

The visitor’s device id, the same value as context.deviceId on the push. One of deviceId or profileId must be non-empty.

string
sessionId
required

The visitor’s session id.

string
action
required

bannerClick, bannerClose, storyImpression, storySlideView, storySlideClick, storyComplete, storyClose or pageEngagement. Any other string is stored as an event of that name.

string
profileId

The known profile id

string | null
attributions
object
bannerBlockId

The banner block token from the push response.

string
bannerId

The bannerId from the push response

string
storyId

The story token from the push response.

string
page
object
url
string
token
string
maxScrollPercent

For pageEngagement.

integer
<= 100
activeTimeMs

For pageEngagement. Under 1000 is not stored.

integer
<= 4294967295
group

The browser’s A/B test bucket (the SDK’s rlv_g cookie). An empty string or null counts as absent.

integer
<= 9999

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/"
}
}

Accepted. The event is stored asynchronously.

Media typeapplication/json
object

Example

{}

Authentication or validation error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Examples

{
"message": "Authorization header is malformed. It should look like `Bearer <string>`."
}

The domain is disabled.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Domain is disabled. Please reach out to support@releva.ai to enable it."
}

Unexpected server error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "An internal error occurred."
}