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

# Export user events

> Export raw events for users with a user_id set. Supports cursor-based pagination for incremental sync.



## OpenAPI

````yaml openapi.json get /api/export.userEvents
openapi: 3.0.3
info:
  title: Staminads API
  description: Web analytics platform for tracking TimeScore metrics
  version: 1.0.0
servers:
  - url: https://your-instance.example.com
    description: Your Staminads instance
security: []
paths:
  /api/export.userEvents:
    get:
      tags:
        - export
      summary: Export user events
      description: >-
        Export raw events for users with a user_id set. Supports cursor-based
        pagination for incremental sync.
      operationId: ExportController_getUserEvents
      parameters:
        - name: workspace_id
          required: true
          in: query
          schema:
            type: string
        - name: cursor
          required: false
          in: query
          schema:
            type: string
        - name: since
          required: false
          in: query
          schema:
            type: string
        - name: until
          required: true
          in: query
          schema:
            type: string
        - name: user_id
          required: false
          in: query
          schema:
            type: string
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 1000
            default: 100
            type: number
      responses:
        '200':
          description: List of user events with pagination cursor
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        session_id:
                          type: string
                        user_id:
                          type: string
                        name:
                          type: string
                          enum:
                            - screen_view
                            - goal
                        path:
                          type: string
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type: string
                          format: date-time
                        referrer:
                          type: string
                        referrer_domain:
                          type: string
                        is_direct:
                          type: boolean
                        landing_page:
                          type: string
                        landing_domain:
                          type: string
                        landing_path:
                          type: string
                        utm_source:
                          type: string
                        utm_medium:
                          type: string
                        utm_campaign:
                          type: string
                        utm_term:
                          type: string
                        utm_content:
                          type: string
                        utm_id:
                          type: string
                        utm_id_from:
                          type: string
                        channel:
                          type: string
                        channel_group:
                          type: string
                        stm_1:
                          type: string
                        stm_2:
                          type: string
                        stm_3:
                          type: string
                        stm_4:
                          type: string
                        stm_5:
                          type: string
                        stm_6:
                          type: string
                        stm_7:
                          type: string
                        stm_8:
                          type: string
                        stm_9:
                          type: string
                        stm_10:
                          type: string
                        device:
                          type: string
                        browser:
                          type: string
                        browser_type:
                          type: string
                        os:
                          type: string
                        country:
                          type: string
                        region:
                          type: string
                        city:
                          type: string
                        language:
                          type: string
                        timezone:
                          type: string
                        goal_name:
                          type: string
                        goal_value:
                          type: number
                        goal_timestamp:
                          type: string
                          format: date-time
                          nullable: true
                        page_number:
                          type: integer
                        duration:
                          type: integer
                        max_scroll:
                          type: integer
                  next_cursor:
                    type: string
                    nullable: true
                  has_more:
                    type: boolean
              example:
                data:
                  - id: 019412ab-1234-7def-8000-abcdef123456
                    session_id: 019412ab-5678-7abc-8000-123456abcdef
                    user_id: user_12345
                    name: screen_view
                    path: /pricing
                    created_at: '2025-01-20T14:30:00.000Z'
                    updated_at: '2025-01-20T14:32:15.000Z'
                    referrer: https://www.google.com/search?q=analytics
                    referrer_domain: www.google.com
                    is_direct: false
                    landing_page: https://example.com/
                    landing_domain: example.com
                    landing_path: /
                    utm_source: google
                    utm_medium: cpc
                    utm_campaign: brand_2025
                    utm_term: ''
                    utm_content: ''
                    utm_id: ''
                    utm_id_from: ''
                    channel: Google Ads
                    channel_group: Paid Search
                    stm_1: premium
                    stm_2: ''
                    stm_3: ''
                    stm_4: ''
                    stm_5: ''
                    stm_6: ''
                    stm_7: ''
                    stm_8: ''
                    stm_9: ''
                    stm_10: ''
                    device: Desktop
                    browser: Chrome
                    browser_type: standard
                    os: macOS
                    country: US
                    region: California
                    city: San Francisco
                    language: en-US
                    timezone: America/Los_Angeles
                    goal_name: ''
                    goal_value: 0
                    goal_timestamp: null
                    page_number: 2
                    duration: 135
                    max_scroll: 75
                next_cursor: >-
                  eyJ0IjoxNzA1NzYwMjAwMDAwLCJpIjoiMDE5NDEyYWItMTIzNC03ZGVmLTgwMDAtYWJjZGVmMTIzNDU2In0=
                has_more: true

````