Track custom events using API

Splitbee offers a simple API that can be used to track custom events for users.

API Endpoint: https://hive.splitbee.io

Request Data

Method: POST

Headers
userId: your-custom-id (which is also sent from the frontend to merge)
sbp: YOUR_TOKEN (Find it in the Splitbee Dashboard settings, called Project Token)

Track Events

Path: /t

Body

{
"event":"My custom event",
"data": {
"optional": "custom data"
},
"options": {
"updateLastSeen": false
}
}

Curl example

curl -X "POST" "https://hive.splitbee.io/t" \
-H 'sbp: 12345' \
-H 'userId: [email protected]' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"event": "My custom event",
"data": {
"optional": "custom data"
},
"options": {
"updateLastSeen": false
}
}'

Set custom user data

Path: /user

Body

Send any key/value object. This data will be appended to the user. If a key already exists in the user object, it will be merged/overwritten

{
"name":"Max",
"custom": "Your custom data"
}