TSGGLOBAL Support sign in
Skip to page content
Browse TNID API docs

TNID API documentation User User events List user events

List user events

On this page

GraphQL endpoint: /user

Lists the events a partner application recorded about the calling user, most recently recorded first, cursor-paginated. Called with the user's own session and an event_token minted by the partner's backend (POST /auth/user-event-token); only events under that company's prefix are returned.

Filter with typePrefix (which must start with the company's prefix, e.g. hoozit.order) and with occurredFrom (inclusive) and occurredTo (exclusive). Pass paginationInfo.nextCursor back as the cursor argument to fetch the next page.

Query

query (
  $eventToken: String!
  $typePrefix: String
  $occurredFrom: DateTime
  $occurredTo: DateTime
  $limit: Int
  $cursor: String
) {
  userEvents(
    eventToken: $eventToken
    typePrefix: $typePrefix
    occurredFrom: $occurredFrom
    occurredTo: $occurredTo
    limit: $limit
    cursor: $cursor
  ) {
    paginationInfo { limit nextCursor }
    records { id type payload externalRef occurredAt recordedAt subjectUserId actorUserId }
  }
}

Variables

{
  "eventToken": "eyJERAMPLE.PAYLOAD1.SIGNATURE",
  "limit": 2
}

Response

{
  "data": {
    "userEvents": {
      "paginationInfo": {
        "limit": 2,
        "nextCursor": "MjAyNi0xMS0wNVQwOToyNjozOS42MTI2MjR8fDY0MTU0MTAzLWM0M2YtNDgyZi1hNzMzLTczZWE5NzFlOGVmYQ=="
      },
      "records": [
        {
          "actorUserId": "00000000-0000-4000-8000-000000000001",
          "externalRef": "ref-2",
          "id": "00000000-0000-4000-8000-000000000002",
          "occurredAt": "2026-01-15T09:00:02.000000Z",
          "payload": {
            "n": 3
          },
          "recordedAt": "2026-01-15T09:00:03.000000",
          "subjectUserId": "00000000-0000-4000-8000-000000000001",
          "type": "hoozit.thing.happened"
        },
        {
          "actorUserId": "00000000-0000-4000-8000-000000000001",
          "externalRef": "ref-1",
          "id": "00000000-0000-4000-8000-000000000003",
          "occurredAt": "2026-01-15T09:00:00.000000Z",
          "payload": {
            "n": 2
          },
          "recordedAt": "2026-01-15T09:00:01.000000",
          "subjectUserId": "00000000-0000-4000-8000-000000000001",
          "type": "hoozit.thing.happened"
        }
      ]
    }
  }
}