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

# List Events

> Flat event list, newest first, keyset-paginated (powers logs / --follow polling).



## OpenAPI

````yaml /api-reference/openapi.json get /v1/workspaces/{workspace_id}/events
openapi: 3.1.0
info:
  title: Visceral Backend
  version: 0.2.0
  description: >-
    The Visceral backend HTTP API. SDK and ingestion endpoints authenticate with
    a workspace API key; dashboard and CLI endpoints authenticate with a user
    session token. Both are sent as `Authorization: Bearer <token>`.
servers:
  - url: https://api.visceralai.dev
security: []
paths:
  /v1/workspaces/{workspace_id}/events:
    get:
      tags:
        - stats
      summary: List Events
      description: >-
        Flat event list, newest first, keyset-paginated (powers logs / --follow
        polling).
      operationId: list_events_v1_workspaces__workspace_id__events_get
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Agent Id
        - name: event_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Event Type
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - ok
                  - error
                type: string
              - type: 'null'
            title: Status
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - sessionToken: []
components:
  schemas:
    EventsPage:
      properties:
        events:
          items:
            $ref: '#/components/schemas/EventInfo'
          type: array
          title: Events
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - events
        - next_cursor
      title: EventsPage
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EventInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        trace_id:
          type: string
          title: Trace Id
        span_id:
          type: string
          title: Span Id
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        event_type:
          type: string
          title: Event Type
        event_name:
          type: string
          title: Event Name
        start_time:
          type: string
          format: date-time
          title: Start Time
        duration_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration Ms
        status_code:
          type: string
          title: Status Code
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
        cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost Usd
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
      type: object
      required:
        - id
        - trace_id
        - span_id
        - agent_id
        - event_type
        - event_name
        - start_time
        - duration_ms
        - status_code
        - model
        - input_tokens
        - output_tokens
        - cost_usd
        - tool_name
        - session_id
      title: EventInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    sessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Short-lived user access token (ES256 JWT) issued by `POST
        /v1/auth/login` or the CLI device flow.

````