Home
Quick start
Identifying users
Tracking events
Tracking groups

Technical Guides

Browser
Node.js
Ruby
Python
HTTP API
License
Sign in

HTTP API

Instant insights with HTTP requests from any app

Configuring

Now, you must send the June SDK with a valid API key as part of the Authorization header, which you can get from your June workspace.

1
curl https://api.june.so/api/identify -H "Accept: application/json" -H "Authorization: Basic {YOUR_WRITE_KEY}" -d '{
2
"userId": "user-id",
3
"traits": {
4
"name": "John Doe",
5
"email": "hello@joe.com"
6
},
7
"timestamp": "2012-12-02T00:30:08.276Z"
8
}'

Identifying users

You can use the identify endpoint to identify your users.

1
POST https://api.june.so/api/identify
1
// Send an identify call
2
{
3
"userId": "019mr8mf4r",
4
"traits": {
5
"email": "pgibbons@example.com",
6
"name": "Peter Gibbons",
7
"industry": "Technology"
8
},
9
"timestamp": "2012-12-02T00:30:08.276Z"
10
}

Identifying companies (optional)

You can use the group endpoint to identify your companies.

1
POST https://api.june.so/api/group
1
{
2
"userId": "019mr8mf4r",
3
"groupId": "8e9df332ac",
4
"traits": {
5
"name": "Initech",
6
"industry": "Technology",
7
"employees": 420
8
},
9
"timestamp": "2012-12-02T00:31:38.208Z"
10
}

Send track events

In order to track user behaviour, you can use the track endpoint.

Note: If you're identifying companies, you should pass the groupId in the track context, as shown in the example below.

1
POST https://api.june.so/api/track
1
// Send a track event
2
{
3
"userId": "019mr8mf4r",
4
"event": "Item Purchased",
5
"properties": {
6
"name": "Leap to Conclusions Mat",
7
"revenue": 14.99
8
},
9
"context": {
10
"groupId": "h123671s"
11
},
12
"timestamp": "2012-12-02T00:30:12.984Z"
13
}

Our SDK is based on Segment's SDK. You can find more documentation here: https://segment.com/docs/connections/sources/catalog/libraries/server/http-api