Skip to main content

POST /sdk/identify

Identify a user in the system.

Request

POST /sdk/identify
Content-Type: application/json
X-API-Key: us_your_api_key

Body

{
"userId": "user-123",
"traits": {
"email": "user@example.com",
"plan": "free",
"company": "Acme Inc"
}
}

Parameters

FieldTypeRequiredDescription
userIdstringYesUnique user identifier
traitsobjectNoUser properties
traits.emailstringNoEmail address (synced to HubSpot)
traits.planstringNoCurrent subscription plan
traits.*anyNoAny custom properties

Response

Success (200)

{
"success": true,
"userId": "user-123"
}

Error (401)

{
"error": "Invalid API key"
}

Example

curl -X POST https://api.upsellsdk.com/sdk/identify \
-H "X-API-Key: us_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"userId": "user-123",
"traits": {
"email": "user@example.com",
"plan": "free"
}
}'