Skip to content

Area: Developers

POST

Send a page view from the storefront (tracking snippet)

Path
/push/{accessToken}
Auth
Access token · in the URL path
POST
/push/{accessToken}
curl --request POST \
--url https://releva.ai/api/v0/push/YOUR_ACCESS_TOKEN \
--header 'Content-Type: application/json' \
--data '{ "context": { "cart": { "products": [] } } }'

The call the JavaScript SDK makes on every page (Releva.push). Authenticated with the shop’s access token, in the path (as the SDK does, to avoid a CORS pre-flight) or as authorization: Bearer <accessToken> on /push. Returns the personalized elements for the page. This fragment covers only the minimal request used to check an installation; the full context object is defined in the events-tracking fragment.

accessToken
required
string format: uuid

The shop’s access token (Settings › Shop & Integration › General › Access Token).

Example

YOUR_ACCESS_TOKEN
Media typeapplication/json
object
options
object
key
additional properties
any
context

Strict object (unknown keys are rejected). Full definition in the events-tracking fragment.

object
key
additional properties
any

Example

{
"context": {
"cart": {
"products": []
}
}
}

Personalized elements for the page.

Media typeapplication/json
object
recommenders
Array<object>
object
banners
Array<object>
object
stories
Array<object>
object
push
object
vapidPublicKey
string
gtmId
string | null
clientIp
string
userAgent
string

Example

{
"recommenders": [],
"banners": [],
"stories": [],
"push": {
"vapidPublicKey": "<vapid-public-key>"
},
"gtmId": null,
"clientIp": "203.0.113.10",
"userAgent": "curl/8.7.1"
}

Missing or unknown access token, or invalid context.

Media typeapplication/json
object
message
required

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

string

Examples

{
"message": "Authorization header is missing, and accessToken url parameters is also missing. At least one of them is required."
}

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