Skip to Content

Identify

POST https://api.snowanalytics.app/api/identify

Attach an identity (user ID, email, name) to a Snow visitor from your server, and optionally link a Stripe customer so payments attribute back to the visit. This is the server-side counterpart to the browser’s sa.identify().

Authentication

Authorization: Bearer snw_live_your_key

Use your site’s API key, the same snw_live_… key that authenticates the Events API (it carries the identify:write scope). Legacy single-purpose ski_… identify keys are also accepted.

Request body

FieldTypeNotes
visitor_id / visitorIdstringRequired. The Snow visitor to identify (≤ 64 chars).
user_id / userIdstringRequired. Your stable user ID (≤ 255 chars).
emailstringOptional (≤ 255 chars).
namestringOptional (≤ 255 chars).
imagestringOptional avatar URL, must be http/https (≤ 500 chars).
stripe_customer_id / stripeCustomerIdstringOptional. Link this visitor to a Stripe customer.
site_id / siteIdstringOptional. If present, it must match the key’s site.
(custom fields)string | number | boolean | nullUp to 25 extra traits (any beyond the first 25 are dropped); keys use lowercase letters, numbers, _, -.

Read the visitor’s ID in the browser with sa.getVisitorId() and pass it to your server. See Attribute revenue to visitors for the Stripe-linking flow.

Example

curl -X POST https://api.snowanalytics.app/api/identify \ -H "Authorization: Bearer snw_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "visitor_id": "v_abc123", "user_id": "user_12345", "email": "[email protected]", "name": "Ada Lovelace", "stripe_customer_id": "cus_123" }'

Responses

StatusBodyMeaning
200 OK{ "status": "success", "data": { "message": "User identified", "profileId": "…" } }Identity saved. When custom traits past the 25-field limit are dropped, data.warning describes how many.
400 Bad Request{ "error": … }Missing visitor_id, invalid identity, or invalid customer ID.
401 Unauthorized{ "error": "…" }Missing or invalid API key.
403 Forbidden{ "error": "Identify key site mismatch" }site_id didn’t match the key’s site.
429 Too Many Requests(no body)Rate limit exceeded.