Log in

Identify user

Endpoint

1
POST https://api.june.so/sdk/identify

Purpose

This action is used to track the identification of a user or an anonymous user.

Response

Returns a JSON response with a status of 200 and a success key set to true.

1
{
2
"status": 200,
3
"success": true
4
}

Parameters

Parameter
Type
Description
Required
userId
String
The ID for this user in your database. Note: At least one of `userId` or `anonymousId` must be included in any identify call.
Optional
anonymousId
String
An ID associated with the user when you don’t know who they are (for example, the `anonymousId` generated by analytics.js). Note: You must include at least one of `userId` or `anonymousId` in all identify calls.
Optional
traits
Object
A dictionary of traits you know about the user. Things like: email, name, or friends.
Optional
timestamp
Date
A JavaScript date object representing when the identify took place. If the identify just happened, leave it out as Segment uses the server’s time. If you’re importing data from the past, make sure to send a timestamp.
Optional
context
Object
A dictionary of extra context to attach to the call. Note: `context` differs from `traits` because it is not attributes of the user itself.
Optional

Example

1
POST https://api.june.so/sdk/identify
2
3
{
4
"userId": "u123456",
5
"traits": {
6
"email": "user@example.com",
7
"username": "user123",
8
"firstName": "John",
9
"lastName": "Doe"
10
}
11
}

Note

It's important to note that this API will first check for an email key in the main payload object, and if not found, it will check for an email key within the traits object.