Documentation menuAPI: Users

API

Users endpoints

These endpoints return the people behind the sessions. Reading needs users:read, and changing needs users:write. None of them is available through Public Analytics or a private link.

Last updated . This guide belongs to Sessions and user profiles.

GET /sites/:siteId/users

ParameterMeaningDefault
page, page_sizePaging. Maximum 1,000 rows1, 100
sort_byfirst_seen, last_seen, pageviews, sessions or eventslast_seen
sort_orderasc or descdesc
identified_onlytrue returns only identified users
searchText to look for in profile traits. Returns identified users only
search_fieldusername, name, email or user_idusername

It also takes the shared time parameters, filters and segment_id.

{ "data": [ { "effective_user_id": "user_42", "user_id": "9f8e7d6c", "identified_user_id": "user_42", "country": "NO", "sessions": 9, "pageviews": 58, "events": 12, "first_seen": "2026-10-02 08:41:55", "last_seen": "2026-11-18 10:14:02", "traits": { "name": "Mari" } } ], "totalCount": 1342, "page": 1, "pageSize": 100 }

effective_user_id is your own user ID when there is one, and the anonymous ID otherwise.

GET /sites/:siteId/users/:userId

Returns one profile. :userId can be your own user ID or an anonymous ID. Without time parameters you get the whole history.

The profile holds totals, location and device, the first and last source, traits, the devices linked to the user and Web Vitals at the 75th percentile.

POST /sites/:siteId/users/identify

Links an anonymous visitor to your user ID from your server.

FieldRequiredLimits
anonymous_idYes1 to 255 characters
user_idYes1 to 255 characters. Must differ from anonymous_id
traitsNoUp to 2,048 bytes. Merged into the stored traits

The link reaches the visitor's earlier events within a few minutes.

PUT /sites/:siteId/users/:userId/traits

Replaces all stored traits for the user with the traits object you send. Use identify when you want to merge.

DELETE /sites/:siteId/users/:userId

Deletes the user's events, replays, profile and device links. Use it for an erasure request. It needs an admin or an owner, or an organization key.

The response is { "success": true }, also when no data matched.

Which trait endpoints are there?

EndpointReturns
GET /sites/:siteId/user-traits/keysEvery trait key with the number of users that have it
GET /sites/:siteId/user-traits/valuesThe values of one key. key is required. limit defaults to 1,000