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
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | Unique user identifier |
traits | object | No | User properties |
traits.email | string | No | Email address (synced to HubSpot) |
traits.plan | string | No | Current subscription plan |
traits.* | any | No | Any 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"
}
}'