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

> List a session's turns.



## OpenAPI

````yaml /openapi.json get /v1/sessions/{session_id}/turns
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}/turns:
    get:
      summary: List turns
      description: List a session's turns.
      operationId: get_sessions_session_id_turns
      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 turns.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TurnList'
        '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:
    TurnList:
      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/Turn'
        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.
    Turn:
      type: object
      required:
        - object
        - id
        - session_id
        - status
        - created_at
      properties:
        object:
          type: string
          const: turn
          description: >-
            Always `turn`. Names the shape, so a value can be identified without
            knowing which call returned it.
        id:
          type: string
          description: Ours. Quote it when reporting a problem with this turn.
        session_id:
          type: string
          description: The session this turn belongs to.
        status:
          type: string
          enum:
            - working
            - completed
            - failed
            - cancelled
          description: >-
            `working` covers everything before it settles, including a turn
            parked on a tool result from you — watch the session's
            `requires_action` for that, not this field. `completed`, `failed`
            and `cancelled` are settled; a settled turn never moves again.
        created_at:
          type: integer
          description: Unix milliseconds, when the input was accepted.
        started_at:
          type:
            - integer
            - 'null'
          description: >-
            When the agent began. Null until it does — a turn is `working` from
            the moment it is accepted, including while it waits behind another
            one, so this is the only field that tells the two apart. `queued`
            was removed from `status`; this description still named it.
        completed_at:
          type:
            - integer
            - 'null'
          description: When it settled. Null until it has.
        artifacts:
          type:
            - string
            - 'null'
          enum:
            - pending
            - ready
            - partial
            - failed
            - null
          description: >-
            Whether this turn's artifacts can be fetched yet. Publication runs
            after the turn settles, so an empty artifact list under `pending`
            means not yet, and under `ready` means the turn produced nothing.
            `partial` means publishing finished and left something behind — read
            `artifacts_skipped` for what and why.
        artifacts_skipped:
          type: array
          description: >-
            Files publishing did not take, and why. Empty unless `artifacts` is
            `partial`. A file past the per-file ceiling, or one that did not fit
            in what the turn had left, is reported here rather than
            disappearing.
          items:
            type: object
            required:
              - path
              - reason
            properties:
              path:
                type: string
                description: The path inside the workspace, as the agent wrote it.
              reason:
                type: string
                description: Why it was not taken. Written for a person, not branched on.
        subagent_id:
          type:
            - string
            - 'null'
          description: Always null today; reserved for delegation.
        error:
          type:
            - object
            - 'null'
          description: Why it failed, when it did. Null otherwise.
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: >-
        A `gbr_pat_` access token. Scopes are recorded on the token when it is
        minted.

````