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

# Stream every session's events

> Stream every session the organization owns.



## OpenAPI

````yaml /openapi.json get /v1/events
openapi: 3.1.0
info:
  title: Gobare Agent API
  version: v1
  description: >-
    Programmatic access to Gobare coding-agent sessions. Conceptually aligned
    with OpenAI's Agents API; deliberately not wire-compatible with it. See the
    divergence list in the product documentation.
servers:
  - url: https://api.{domain}
    variables:
      domain:
        default: gobare.dev
security: []
paths:
  /v1/events:
    get:
      summary: Stream every session's events
      description: Stream every session the organization owns.
      operationId: get_events
      parameters:
        - name: last_event_id
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: >-
            Replay durable events after this `seq`. The `Last-Event-ID` header
            does the same thing.
      responses:
        '200':
          description: Stream every session the organization owns.
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/EventStream'
        '400':
          description: >-
            `invalid_request`. A query parameter this endpoint does not take.
            Refused rather than ignored, because an ignored filter answers with
            everything and looks like a filter that matched.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The access token is missing, unrecognised, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The token is valid but may not perform this call. The message names
            the scope it wanted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            No such endpoint, or the public API is not enabled on this
            deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            `rate_limit_exceeded`. The token is past its allowance for this
            bucket. Honour `Retry-After`; the `x-ratelimit-*` headers on every
            response say how close you were.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: An unexpected error. Quote the request id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - accessToken: []
components:
  schemas:
    EventStream:
      type: object
      description: >-
        A server-sent event. The response is text/event-stream, not JSON; this
        describes one frame's data.
      required:
        - object
        - type
        - session_id
        - created_at
      properties:
        object:
          type: string
          const: event
          description: >-
            Always `event`. Names the shape, so a value can be identified
            without knowing which call returned it.
        type:
          type: string
          description: The event's name. See events.md for the vocabulary.
        internal_type:
          type: string
          description: >-
            The control plane's own name for the event, for cross-referencing
            logs.
        session_id:
          type: string
          description: The session it happened in.
        seq:
          type:
            - integer
            - 'null'
          description: >-
            Cursor for Last-Event-ID. Null on a transient event, which does not
            advance it.
        created_at:
          type: integer
          description: Unix milliseconds.
        payload:
          type: object
          description: >-
            Everything specific to this event type. Not one shape — `examples`
            below carries a real payload for every type in the vocabulary, keyed
            by the type. Read the one you are handling rather than probing for
            fields: `agent.tool_call` carries `toolName` and `args`, not `name`
            and `arguments`, and guessing that pair wrong renders every tool
            call as an empty object.
          examples:
            turn.started:
              turnId: turn_1bdef0a94c2e47f3
            turn.ended:
              turnId: turn_1bdef0a94c2e47f3
            agent.text:
              delta: Looking at the export handler
            agent.thinking:
              delta: The error rate started at 09:12
            agent.message:
              text: I found the regression in export-svc v2.3.2.
            agent.tool_call:
              toolCallId: call_53ce8a1f
              toolName: write
              args:
                path: /workspace/outputs/report.md
                content: '# Report'
            agent.tool_result:
              toolCallId: call_53ce8a1f
              toolName: write
              isError: false
              cancelled: false
              summary: Successfully wrote 5 bytes
            agent.compaction:
              before: 182000
              after: 41000
            agent.error:
              message: the model provider returned 502
            agent.todos:
              items:
                - label: Read the alert
                  status: done
                - label: Write the postmortem
                  status: pending
            user.message:
              text: 'Alert A-4471: export error rate 12%.'
            message.queued:
              text: Also check the retry queue.
              position: 1
            message.dequeued:
              text: Also check the retry queue.
            file.changed:
              path: /workspace/src/export.ts
              kind: modified
              diff: |-
                @@ -1,3 +1,4 @@
                …
            approval.requested:
              toolCallId: call_9a1f20bd
              name: bash
              args:
                command: systemctl restart export
              sensitive: true
            approval.resolved:
              toolCallId: call_9a1f20bd
              approved: true
            question.asked:
              toolCallId: call_7be1c4d0
              question: Roll back or patch forward?
              options:
                - roll back
                - patch
              allowFreeform: true
            question.answered:
              toolCallId: call_7be1c4d0
              answer: roll back
            tool.required:
              toolCallId: call_4f01aa27
              name: lookup_order
              arguments:
                order_id: A-4471
            tool.resolved:
              toolCallId: call_4f01aa27
              name: lookup_order
              success: true
            sandbox.created:
              state: running
            sandbox.paused:
              state: paused
            sandbox.resumed:
              state: running
            preview.ready:
              port: 3000
              url: https://p-4f1c8e02a7b1.gobare.dev
            workspace.recovery_failed:
              message: no snapshot was available for this workspace
            artifact.created:
              id: art_6f2a9c41
              path: /workspace/outputs/report.md
              size_bytes: 482
              turn_id: turn_1bdef0a94c2e47f3
            mcp.unavailable:
              name: runbook
              reason: the server did not answer within 10s
            gobare.replay_truncated:
              from_seq: 91204
              note: More than 50000 events were waiting.
    Error:
      type: object
      required:
        - error
      description: Every refusal this API makes, in one shape.
      properties:
        error:
          description: Always present on a failure, and the only thing present.
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              enum:
                - invalid_request
                - authentication_error
                - permission_denied
                - not_found
                - method_not_allowed
                - conflict
                - queue_full
                - rate_limit_exceeded
                - project_limit_exceeded
                - context_length_exceeded
                - provider_error
                - provider_unauthorized
                - sandbox_error
                - sandbox_unavailable
                - directory_unavailable
                - workspace_recovery_failed
                - bridge_incompatible
                - internal_error
            message:
              type: string
            request_id:
              type: string
              description: >-
                Also on the x-request-id header. Quote it when reporting a
                problem.
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: >-
        A `gbr_pat_` access token. Scopes are recorded on the token when it is
        minted.

````