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

# Get Observability Sessions

> Cursor-paginated sessions list.

Filter precedence:
  1. ``agent_id`` (Streamkap or external:pk:cid synthetic form)
  2. ``project_key_id`` + ``client_id`` (external pseudo-agent)
  3. No entity filter - all-tenant-activity pseudo-row.

The FE never sends both flavours - but if it does, ``agent_id`` wins.

``kind`` and ``entity_kind`` are reserved-slot dispatch params: today only
``kind=tool_call`` against ``entity_kind=streamkap|external`` returns data.
Other valid combinations return an empty page until their backing tables /
emitters land. Unknown values raise 400.



## OpenAPI

````yaml /openapi/openapi.json get /agentic/observability/sessions
openapi: 3.1.0
info:
  title: Streamkap REST API
  description: >-
    The Streamkap REST API allows you to programmatically manage your CDC
    pipelines, sources, destinations, transforms, and more.


    Authenticate using a bearer token obtained from the [Access
    Token](/api-reference/auth/access-token) endpoint with your API client
    credentials.
  contact:
    name: Streamkap Support
    url: https://streamkap.com/
    email: support@streamkap.com
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api.streamkap.com
    description: Production
security: []
tags:
  - name: Agents
    description: Create, deploy, and manage Flink-based AI agents.
  - name: Agents Observability
    description: >-
      Read-only views over the MCP audit log: agent rollup, sessions, spans,
      histograms, external-agent verify.
  - name: Alerts
    description: Manage alert subscribers, preferences, and notification credentials.
  - name: Authentication
    description: Obtain and refresh access tokens, manage client credentials and roles.
  - name: Billing
    description: Retrieve usage metrics, summaries, and export billing data.
  - name: Consumer Groups
    description: List, inspect, and reset Kafka consumer group offsets.
  - name: Dashboard
    description: Retrieve organisation-level statistics and overview data.
  - name: Destinations
    description: Create, configure, and manage data destinations and their lifecycle.
  - name: Kafka Access
    description: Manage Kafka users and their access permissions.
  - name: Logs
    description: Query and summarise system logs.
  - name: Pipelines
    description: Create, configure, and manage CDC pipelines and their lifecycle.
  - name: Project Keys
    description: Manage project keys that bundle API credentials and optional Kafka access.
  - name: Schema Registry
    description: Browse schema subjects, versions, and retrieve schema definitions.
  - name: Services
    description: View and switch service metadata.
  - name: Sources
    description: >-
      Create, configure, and manage data sources, snapshots, and their
      lifecycle.
  - name: Tags
    description: Create, update, and manage resource tags for organisation.
  - name: Topics
    description: Browse topic details, statistics, configurations, metrics, and messages.
  - name: Transforms
    description: >-
      Create, deploy, and manage data transforms, unit tests, and implementation
      details.
paths:
  /agentic/observability/sessions:
    get:
      tags:
        - Agents Observability
      summary: Get Observability Sessions
      description: >-
        Cursor-paginated sessions list.


        Filter precedence:
          1. ``agent_id`` (Streamkap or external:pk:cid synthetic form)
          2. ``project_key_id`` + ``client_id`` (external pseudo-agent)
          3. No entity filter - all-tenant-activity pseudo-row.

        The FE never sends both flavours - but if it does, ``agent_id`` wins.


        ``kind`` and ``entity_kind`` are reserved-slot dispatch params: today
        only

        ``kind=tool_call`` against ``entity_kind=streamkap|external`` returns
        data.

        Other valid combinations return an empty page until their backing tables
        /

        emitters land. Unknown values raise 400.
      operationId: getAgenticObservabilitySessions
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Streamkap agent id (Mongo ObjectId or external:pk:cid)
            title: Agent Id
          description: Streamkap agent id (Mongo ObjectId or external:pk:cid)
        - name: project_key_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'External pseudo-agent: project_key_id'
            title: Project Key Id
          description: 'External pseudo-agent: project_key_id'
        - name: client_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'External pseudo-agent: client_id'
            title: Client Id
          description: 'External pseudo-agent: client_id'
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Time range start (ISO 8601)
            title: From
          description: Time range start (ISO 8601)
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Time range end (ISO 8601)
            title: To
          description: Time range end (ISO 8601)
        - name: tool
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by tool name
            title: Tool
          description: Filter by tool name
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: success | error | denied
            title: Status
          description: success | error | denied
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Pagination cursor - last page's next_cursor
            title: Cursor
          description: Pagination cursor - last page's next_cursor
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Max items
            default: 50
            title: Limit
          description: Max items
        - name: kind
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Row kind: tool_call (default) | log | llm_call | transcript_event
              | kb_ingestion
            title: Kind
          description: >-
            Row kind: tool_call (default) | log | llm_call | transcript_event |
            kb_ingestion
        - name: entity_kind
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Entity scope: streamkap | external | kb'
            title: Entity Kind
          description: 'Entity scope: streamkap | external | kb'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObservabilitySessionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggHTTPAuthentication: []
components:
  schemas:
    ObservabilitySessionsResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ObservabilitySessionItem'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Cursor
      additionalProperties: false
      type: object
      required:
        - items
      title: ObservabilitySessionsResponse
      description: |-
        `/agentic/observability/sessions` response envelope.

        ``next_cursor`` is the ``started_at`` of the last row in the page, or
        ``None`` when fewer than ``limit`` rows were returned (signalling end
        of stream to the FE).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ObservabilitySessionItem:
      properties:
        session_id:
          type: string
          title: Session Id
        started_at:
          type: string
          format: date-time
          title: Started At
        ended_at:
          type: string
          format: date-time
          title: Ended At
        call_count:
          type: integer
          title: Call Count
        error_count:
          type: integer
          title: Error Count
        p95_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: P95 Ms
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        agent_label:
          type: string
          title: Agent Label
        entity_kind:
          type: string
          enum:
            - streamkap
            - external
          title: Entity Kind
      additionalProperties: false
      type: object
      required:
        - session_id
        - started_at
        - ended_at
        - call_count
        - error_count
        - agent_label
        - entity_kind
      title: ObservabilitySessionItem
      description: |-
        One row in the sessions list.

        ``agent_id`` / ``agent_label`` / ``entity_kind`` carry agent identity so
        the FE Overview activity feed can render event-grain rows without an
        N+1 lookup against ``/sessions/{id}``. Identity rules mirror the rollup
        convention in ``merge_agent_rollup``:

        - Streamkap: ``agent_id`` is the Mongo ObjectId, ``agent_label`` is the
          agent ``name`` (falls back to the id), ``entity_kind == "streamkap"``.
        - External: ``agent_id`` is the synthetic ``external:<pk>:<cid>`` form,
          ``agent_label`` is ``"<pk[:8]> · <cid[:6]>"``,
          ``entity_kind == "external"``.
        - Defensive fallback (row carries neither): ``agent_id`` is ``None``,
          ``agent_label`` is ``"External · unknown"``, ``entity_kind ==
          "external"``. Should never fire in practice; keeps the FE shape
          stable.
    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:
    FronteggHTTPAuthentication:
      type: http
      scheme: bearer

````