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

# List a session's audit log

> Returns the session's audit log — an immutable, time-ordered record of what happened during its agent runs (LLM calls, tool results, and run outcomes). Events are ordered by the time they occurred. Use `after` and `limit` to page through them; pass the response's `next_cursor` as the next request's `after` to fetch the following page.




## OpenAPI

````yaml /openapi/openapi.yaml get /sessions/{id}/audit
openapi: 3.0.3
info:
  title: Albus API
  description: Albus service REST API
  version: 1.0.0
servers:
  - url: https://albus.sh/api
    description: Production server
  - url: http://localhost:8080
    description: Local development server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Auth
    description: Identify the authenticated user.
  - name: Health
    description: Check service availability.
  - name: Secrets
    description: Manage secrets available to agent sessions.
  - name: Sessions
    description: Run and inspect agent sessions.
  - name: Tokens
    description: Manage organization API keys.
paths:
  /sessions/{id}/audit:
    parameters:
      - $ref: '#/components/parameters/SessionID'
    get:
      tags:
        - Sessions
      summary: List a session's audit log
      description: >
        Returns the session's audit log — an immutable, time-ordered record of
        what happened during its agent runs (LLM calls, tool results, and run
        outcomes). Events are ordered by the time they occurred. Use `after` and
        `limit` to page through them; pass the response's `next_cursor` as the
        next request's `after` to fetch the following page.
      operationId: getSessionAudit
      parameters:
        - $ref: '#/components/parameters/AfterCursor'
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAuditEventsResponse'
        '400':
          description: Invalid cursor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  parameters:
    SessionID:
      name: id
      in: path
      required: true
      description: >-
        Client-provided session identifier. Use the same value across requests
        to continue the same agent session.
      schema:
        type: string
        minLength: 2
        maxLength: 100
        pattern: ^[0-9a-zA-Z._:-]+$
    AfterCursor:
      name: after
      in: query
      required: false
      description: >
        Opaque pagination cursor. Return only items positioned after it; pass a
        value obtained from a previous page to fetch the next one.
      schema:
        type: string
    Limit:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return.
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 100
  schemas:
    ListAuditEventsResponse:
      type: object
      required:
        - events
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/AuditEvent'
        next_cursor:
          type: string
          description: >
            Cursor for the next page. Pass it as `after` to fetch the following
            events. Omitted when there are no more events.
    ErrBadRequest:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message
          example: Invalid request parameters
    ErrUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message
          example: Invalid or expired token
    ErrNotFound:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message
          example: Resource not found
    AuditEvent:
      type: object
      required:
        - id
        - session_id
        - invocation_id
        - type
        - payload
        - event_time
      properties:
        id:
          type: string
          description: Stable identifier of this audit event within the session.
        session_id:
          type: string
          description: The session this event belongs to.
        invocation_id:
          type: string
          description: The invocation (run) during which this event occurred.
        type:
          type: string
          enum:
            - llm_call
            - tool_result
            - run_finished
            - run_failed
          description: >
            The kind of event (e.g. "llm_call" for a model call and the tool
            calls it requested, "tool_result" for a tool's output).
        payload:
          type: object
          additionalProperties: true
          description: >
            The event's details, whose shape depends on `type` (e.g. the model
            content and requested tool calls for "llm_call").
        event_time:
          type: string
          format: date-time
          description: When the event occurred.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: http
      scheme: bearer
      description: Org-scoped API key issued via POST /tokens

````