# User Events

GET /api/v2/projects/{projectId}/analytics/user-events

Returns one user's event history, newest first: the activity timeline for a single person. Events fired before they were identified are stitched in by anonymous ID, so the timeline reaches back past the `identify()` call. Social-proof popup events are excluded. Page through it with `cursor`, which is a row offset: pass the number of rows already received to get the next batch.

## Request

- projectId: string, path, required — ID of the project to read analytics from.
- browser: string, query — Only count activity from this browser, e.g. `Chrome`.
- dateFrom: string, query — Start of the window as a `YYYY-MM-DD` date, inclusive.
- dateTo: string, query — End of the window as a `YYYY-MM-DD` date, inclusive.
- device: string, query — Only count activity from this device type, e.g. `mobile`.
- limit: number, query — Maximum number of rows to return.
- location: string, query — Only count activity from this country name.
- referrer: string, query — Only count activity with this exact referrer URL.
- referringDomain: string, query — Only count activity from this referring domain, e.g. `google.com`.
- skip: number, query — Number of rows to skip before collecting results.
- utmMedium: string, query — Only count activity tagged with this `utm_medium`.
- cursor: number, query — Row offset to start from. Defaults to 0; pass the number of rows already received to fetch the next page.
- daysAgo: number, query — Only return events from the last this-many days. Defaults to 30.
- distinctId: string, query, required — Distinct ID of the user whose events to return.

## Response

- 200: Successful response
  - data: object[], required
    - action: string, required
    - anonymousId: string, required
    - id: string, required
    - payload: string, required
    - projectId: string, required
    - sessionId: string, required
    - source: client | server | unknown, required
    - timestamp: string, required
    - version: string, required
    - context: string
    - distinctId: string
  - meta: object[], required
    - name: string, required
    - type: string, required
  - rows: number, required
  - statistics: object, required
    - bytes_read: number, required
    - elapsed: number, required
    - rows_read: number, required
  - usage: object, required
    - cost: number, required
    - duration: number
    - metricCount: number
- 400: Invalid input data
- 401: Authorization not provided
- 403: Insufficient access
- 404: Not found
- 500: Internal server error
