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": "19283",
"name": "John Doe",
"email": "[email protected]",
"value": 1928,
"phone": "+1 (129) 18283 8292",
"createdAt": "2022-09-28T10:11:18.156Z",
// You can also track custom user properties
}

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": "19283"
}, {
"date": "2022-09-28T10:11:18.156Z",
"name": "Subscription canceled",
"data": {
"name": "Sub 1259",
"value": 1200,
"reason": "Stopped working on the project.",
},
"userId": "19283"
}]
}

Rate limit

Please note that the identify and track APIs do enforce a rate limit of 1000 requests / 60 seconds for every project.