> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuronsearchlab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List events

> List ingested events with cursor pagination.

## Request

```http theme={null}
GET /v1/events?user_id=user-abc123&type=click&limit=50
```

| Parameter        | Type    | Required | Description                                                  |
| ---------------- | ------- | -------- | ------------------------------------------------------------ |
| `limit`          | integer | no       | Number of events to return. Defaults to `20`, maximum `100`. |
| `starting_after` | string  | no       | Event ID cursor such as `12345`.                             |
| `user_id`        | string  | no       | Filters to events for one user.                              |
| `type`           | string  | no       | Filters to one event type.                                   |

## Response

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "12345",
      "object": "event",
      "user_id": "user-abc123",
      "item_id": "7f3a2c9e",
      "type": "click",
      "click": {},
      "session_id": null,
      "request_id": null,
      "context_id": "101",
      "placement": null,
      "metadata": {
        "context_id": "101",
        "click": {}
      },
      "occurred_at": 1777478400,
      "created": 1777478405
    }
  ],
  "has_more": true,
  "next_cursor": "12345",
  "url": "/v1/events"
}
```


## OpenAPI

````yaml GET /v1/events
openapi: 3.0.3
info:
  title: NeuronSearchLab Core API
  version: 1.0.0
  description: >-
    Versioned data-plane API for OAuth token exchange, catalog item ingestion,
    user event ingestion, and recommendation serving.
  license:
    name: Proprietary
    url: https://neuronsearchlab.com
servers:
  - url: https://api.neuronsearchlab.com
    description: Core API Gateway custom domain
security:
  - oauth2: []
tags:
  - name: Authentication
    description: OAuth 2.0 client credentials token exchange.
  - name: Items
    description: Catalog item ingestion, lookup, update, deletion, and pagination.
  - name: Events
    description: User interaction event ingestion, lookup, and pagination.
  - name: Recommendations
    description: >-
      Personalized recommendation serving, request-scoped filtering, and
      auto-section generation.
  - name: Search
    description: Query-driven search serving through the Core API data plane.
  - name: CORS
    description: Browser preflight routes generated by API Gateway.
paths:
  /v1/events:
    get:
      tags:
        - Events
      summary: List events
      description: >-
        List ingested user events for the authenticated tenant using
        cursor-style pagination. Events are ordered by internal event ID
        ascending.
      operationId: listEvents
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/EventStartingAfter'
        - name: user_id
          in: query
          description: Filter to events recorded for one end-user ID.
          schema:
            type: string
          example: user-abc123
        - name: type
          in: query
          description: Filter to one event type, such as `click` or `purchase`.
          schema:
            type: string
          example: purchase
      responses:
        '200':
          description: Paginated event list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventList'
              examples:
                events:
                  $ref: '#/components/examples/EventList'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '500':
          $ref: '#/components/responses/Error500'
      security:
        - oauth2:
            - neuronsearchlab-api/read
components:
  parameters:
    Limit:
      name: limit
      in: query
      description: >-
        Maximum number of resources to return. Defaults to 20 and is capped at
        100.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
      example: 20
    EventStartingAfter:
      name: starting_after
      in: query
      description: Cursor from a previous event list response.
      schema:
        type: string
        pattern: ^[1-9][0-9]*$
      example: '12345'
  schemas:
    EventList:
      allOf:
        - $ref: '#/components/schemas/ListEnvelope'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/Event'
    ListEnvelope:
      type: object
      required:
        - object
        - data
        - has_more
        - url
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items: {}
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
        url:
          type: string
    Event:
      type: object
      required:
        - id
        - object
        - user_id
        - item_id
        - type
        - metadata
        - occurred_at
        - created
      properties:
        id:
          type: string
          pattern: ^[1-9][0-9]*$
          example: '12345'
        object:
          type: string
          enum:
            - event
        user_id:
          type: string
          example: user-abc123
        item_id:
          type: string
          example: 7f3a2c9e
        type:
          type: string
          example: purchase
        session_id:
          type: string
          nullable: true
        request_id:
          type: string
          format: uuid
          nullable: true
        context_id:
          type: string
          nullable: true
          example: '101'
        placement:
          type: string
          nullable: true
          example: home_feed
        metadata:
          $ref: '#/components/schemas/Metadata'
        occurred_at:
          type: integer
          format: int64
          nullable: true
          example: 1777478400
        created:
          type: integer
          format: int64
          nullable: true
          example: 1777478405
      additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - conflict_error
                - rate_limit_error
                - api_error
            code:
              type: string
            message:
              type: string
            details: {}
            request_id:
              type: string
              format: uuid
          additionalProperties: true
    Metadata:
      type: object
      description: Arbitrary JSON object used for filtering, ranking, and debugging.
      additionalProperties: true
      example:
        category: electronics
        brand: Acme
        price: 10999
        currency: usd
  examples:
    EventList:
      summary: Event list
      value:
        object: list
        data:
          - id: '12345'
            object: event
            user_id: user-abc123
            item_id: 7f3a2c9e
            type: click
            click: {}
            session_id: null
            request_id: null
            context_id: '101'
            placement: null
            metadata:
              context_id: '101'
              click: {}
            occurred_at: 1777478400
            created: 1777478405
        has_more: true
        next_cursor: '12345'
        url: /v1/events
    ErrorValidation:
      summary: Validation error
      value:
        error:
          type: invalid_request_error
          code: validation_error
          message: Validation error
          details:
            fieldErrors:
              name:
                - Required
    ErrorUnauthorized:
      summary: Unauthorized
      value:
        error:
          type: authentication_error
          code: unauthorized_no_client_id_in_jwt
          message: 'Unauthorized: No client ID in JWT'
  responses:
    Error400:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            validation:
              $ref: '#/components/examples/ErrorValidation'
    Error401:
      description: Unauthenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              $ref: '#/components/examples/ErrorUnauthorized'
    Error403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error500:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.neuronsearchlab.com/oauth2/token
          scopes:
            neuronsearchlab-api/read: Read recommendations, items, and events.
            neuronsearchlab-api/write: Create, update, and delete items; submit events.

````