> ## 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.

# List items

> List a session's durable items.



## OpenAPI

````yaml /openapi.json get /v1/sessions/{session_id}/items
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/sessions/{session_id}/items:
    get:
      summary: List items
      description: List a session's durable items.
      operationId: get_sessions_session_id_items
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: How many to return, 1–100. Default 20.
        - name: order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
          description: Newest first (`desc`, the default) or oldest first (`asc`).
        - name: after
          in: query
          required: false
          schema:
            type: string
          description: >-
            The `last_id` of the previous page. A cursor this collection cannot
            place — expired, deleted, or never issued — answers with an empty
            page rather than starting over, so a paging loop ends instead of
            repeating itself.
      responses:
        '200':
          description: List a session's durable items.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemList'
        '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 no such object under this token's organization.
            Another organization's id is indistinguishable from one that never
            existed, deliberately.
          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:
    ItemList:
      type: object
      required:
        - object
        - data
      properties:
        object:
          type: string
          const: list
          description: >-
            Always `list`. Names the shape, so a value can be identified without
            knowing which call returned it.
        data:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        has_more:
          type: boolean
        last_id:
          type:
            - string
            - 'null'
    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.
    Item:
      type: object
      required:
        - object
        - id
        - session_id
        - type
        - created_at
      properties:
        object:
          type: string
          const: item
          description: >-
            Always `item`. Names the shape, so a value can be identified without
            knowing which call returned it.
        id:
          type: string
          description: Ours. Stable; use it as a paging cursor.
        session_id:
          type: string
          description: The session this item belongs to.
        type:
          type: string
          enum:
            - message
            - tool_call
            - command_execution
            - file_change
            - approval
            - question
            - mcp_unavailable
            - error
          description: >-
            What kind of thing happened. Decides which of `content` and `detail`
            carries the substance. `error` says a run could not start or could
            not continue, and `detail.message` says why.
        created_at:
          type: integer
          description: Unix milliseconds.
        role:
          type: string
          enum:
            - user
            - assistant
          description: 'On `message` items only: who said it.'
        content:
          type: string
          description: The text of a `message`. Empty on other kinds.
        detail:
          type: object
          description: >-
            Everything kind-specific: the command run, the path changed, the
            arguments passed. `examples` carries a real one per item type.
            `detail.event` is the *event* name — items and events share one
            vocabulary, and that field is the join between them. It is also how
            the two halves of `tool_call` are told apart: a call and its result
            are both `type: "tool_call"`, and only `detail.event` says which.
            There is no `tool_result` item type; code written from the enum
            alone renders every tool call twice.
          examples:
            message:
              event: agent.message
              text: I found the regression in export-svc v2.3.2.
            tool_call:
              event: agent.tool_call
              toolCallId: call_53ce8a1f
              toolName: write
              args:
                path: /workspace/outputs/report.md
            command_execution:
              event: agent.tool_result
              toolCallId: call_1c72fe08
              toolName: bash
              exitCode: 0
              summary: restarting checkout
            file_change:
              event: file.modified
              path: /workspace/src/export.ts
              kind: modified
            approval:
              event: approval.requested
              toolCallId: call_9a1f20bd
              name: bash
              args:
                command: systemctl restart export
            question:
              event: question.asked
              toolCallId: call_7be1c4d0
              question: Roll back or patch forward?
            mcp_unavailable:
              event: mcp.unavailable
              name: runbook
              reason: the server did not answer within 10s
            error:
              event: agent.error
              message: the model provider returned 502
            tool_call (result):
              event: agent.tool_result
              toolCallId: call_53ce8a1f
              toolName: write
              isError: false
              summary: Successfully wrote 5 bytes
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: >-
        A `gbr_pat_` access token. Scopes are recorded on the token when it is
        minted.

````