Skip to main content

REST api

This package allows you to track server-side customer events.

Identify users

POST https://api.gleap.io/admin/identify

Request headers:

Content-Type: application/json
Api-Token: YOUR_SECRET_API_TOKEN

Please replace YOUR_SECRET_API_TOKEN with your secret API token, which can be found in your project settings -> API token.

Request content:

{
"userId": "1938",
"name": "John Doe",
"email": "[email protected]",
"value": 1928,
"phone": "+1 (129) 18283 8292"
}

Track events

POST https://api.gleap.io/admin/track

Request headers:

Content-Type: application/json
Api-Token: YOUR_SECRET_API_TOKEN

Request content:

{
"events": [{
"date": "2022-09-28T10:11:18.156Z",
"name": "Subscription started",
"data": {
"name": "Sub 1232",
"value": 1200
},
"userId": "user_11319"
}, {
"date": "2022-09-28T10:11:18.156Z",
"name": "Subscription canceled",
"data": {
"name": "Sub 1259",
"value": 1200,
"reason": "Stopped working on the project.",
},
"userId": "user_18374"
}]
}