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

# List sessions

> Returns Sessions newest first, cursor-paginated. By default, status=active hides archived Sessions; status accepts active, archived, or all.

The current conversation Session of a Reason (a person's chat with it, the `session_id` listReasons returns) is left out of active and archived; status=all adds the ones you can read to the active and archived Sessions. No status lists subagent Sessions, side chats, memory reviews or a deleted Reason's conversations, so a sum over the list is not a workspace's whole usage. origin accepts ui, external, external:cli|mcp|api, or comma-separated values. Follow-up execution Attempts update their Session and never appear as additional list items. A list item reports the same `status`, `outcome`, `usage` and `cost_usd` as Retrieve a session: usage and cost are the Session's totals across all its Attempts, not its latest Attempt's. Its `result` is the text summary, and Retrieve a session returns a structured result. Responses carry a weak `ETag`; send it as `If-None-Match` to receive `304 Not Modified` while the page is unchanged. A 200 or 304 may repeat usage counters (`usage`, `context`, `cost_usd`, `duration_ms`) and `model` up to 10 seconds old; every other property is current. A 304 for a page narrowed by `fields` to none of those may be up to 5 minutes old.

<sub>Scope: `sessions:read`</sub>


## OpenAPI

````yaml /openapi.docs.json get /v3/organizations/{orgId}/sessions
openapi: 3.1.0
info:
  title: Reason API
  version: 3.0.0
  description: >-
    The Reason HTTP API. Drive cloud software-engineering agents: open sessions
    against your repositories, stream their work, and manage the secrets,
    skills, and automations they run with.


    Authenticate with a Reason API key sent as a bearer token. New keys use
    `reason_`; legacy `ara_` keys remain accepted. Every resource is scoped to
    an organization; resolve your `org_id` once with `GET /v3/self`.
servers:
  - url: https://api.reason.bot
security:
  - reasonApiKey: []
tags:
  - name: Account
    description: Verify a key and resolve the organization it belongs to.
  - name: Reasons
    description: >-
      Start here. A Reason is the long-running agent a person keeps: their main
      Reason and named ones, each with its own instructions, default model and
      repositories, conversation, Loops and Sessions. Give a Reason work by
      messaging it (sendReasonMessage) and read its replies with
      listReasonMessages.
  - name: Loops
    description: >-
      Standing work a Reason does, woken by a schedule or an event: a webhook, a
      GitHub event or a Slack message. Each wake opens or continues a Session of
      the Reason; webhook events that share a correlation key continue one
      Session.
  - name: Memory
    description: >-
      What Reasons remember across Sessions. Each Session starts by reading
      MEMORY.md (a short index) and the list of topic notes, and reads a note
      when its topic comes up. `personal` memory belongs to one person (the API
      key's owner) and only their Sessions read it; `team` memory belongs to the
      Workspace and every member's Sessions read it. memory:read lists, reads
      and searches; memory:write writes and deletes, in team memory only for a
      Workspace owner or admin.
  - name: Sessions
    description: >-
      A Session is one run of work inside a Reason: every Reason message and
      Loop wake runs in one, and createSession starts one directly for a single
      unattended task with a pass/fail outcome. Its transcript, events, result
      and pull request are read here.
  - name: Skills
    description: >-
      Reusable instruction bundles Reason selects semantically from their
      descriptions for matching agent tasks.
  - name: Workspace events
    description: >-
      Follow a whole workspace without polling each Session.
      streamWorkspaceChanges is a Server-Sent Events stream of view revisions:
      when a topic's revision moves, re-read that view. streamWorkspaceEvents is
      a resumable Server-Sent Events stream of what happened (a message added, a
      turn finished), replayed from Last-Event-ID for 7 days. Event webhooks
      POST the same events, signed (Standard Webhooks), to endpoints you
      register. sessions:read reads; webhooks also need automations:read /
      automations:write; the devices topic also needs devices:read.
  - name: Pages
    description: >-
      The HTML pages Reasons make: charts, dashboards and reports a person reads
      in the chat, opens full size, shares and finds in a Reason's Library. List
      and read the pages you may see, make one in a Reason's conversation or a
      Session, keep it current with updatePage (same id, link and share link, a
      new revision), share it and delete it. pages:read reads; pages:write
      writes. An Experiments feature (pages_api): elsewhere these return 403
      `pages_api_unavailable`.
  - name: Secrets
    description: >-
      Encrypted credentials injected into the agent's sandbox. Write-only:
      values can be set but never read back.
  - name: Attachments
    description: >-
      Files uploaded to the organization and shared with sessions, downloaded
      via short-lived signed URLs.
  - name: Repositories
    description: Connected repositories, their indexing state, and generated wikis.
  - name: Git Connections
    description: Linked source-control accounts and the repositories they expose.
  - name: Machines
    description: >-
      Named Workspace queues served by headless workers. Sessions target a
      Machine by name and wait for a free worker; more workers serve more
      Sessions concurrently.
  - name: Devices
    description: >-
      Owned Mac and headless Device identity, bounded enrollment and root
      grants.
  - name: Cloud Access
    description: >-
      Keyless cloud sign-in for sessions: Reason's OIDC issuer facts and the
      AWS, Google Cloud and Azure connections a workspace trusts, including
      which run triggers each one signs in.
  - name: MCP Servers
    description: >-
      Org-level Model Context Protocol servers exposed to the agent. Secret
      values are write-only.
  - name: Plugins
    description: >-
      The plugin catalog (catalog connectors, custom MCP servers, native app
      connectors): install, browser OAuth sign-in, bundled skills and per-Reason
      settings. Never returns credentials.
  - name: Change Request Reviews
    description: >-
      Automated senior-engineer reviews posted on pull requests and merge
      requests.
  - name: Consumption
    description: 'Billing-aligned usage: daily consumption and billing cycles.'
  - name: Metrics
    description: Aggregate analytics over sessions, change requests, and usage.
  - name: Audit Logs
    description: An append-only record of changes made within the organization.
  - name: Organizations
    description: The top-level tenant. Create, read, update, and delete organizations.
  - name: Members
    description: People in an organization and their pending invites.
  - name: Roles
    description: Role assignments that govern what each member can do.
  - name: Settings
    description: 'Organization configuration: namespaced settings and the run tag policy.'
  - name: Provider credentials
    description: >-
      Configure Bring-Your-Own-Key (BYOK) API keys and subscription credentials
      for model providers. Secret values are write-only.
  - name: Feedback
    description: Report problems with the API or these docs to the Reason team.
  - name: Projects
    description: >-
      Deprecated: a project is a Reason with the same id. Use the Reasons
      operations; these remain for existing clients.
  - name: Automations
    description: >-
      The older form of Loops. Prefer the Loops under a Reason (listReasonLoops,
      createReasonLoop), which take every wake: schedule, webhook, GitHub,
      Slack. Use these for what Loops do not carry yet: a run's MCP and app
      tools, and automations not filed under a Reason.
paths:
  /v3/organizations/{orgId}/sessions:
    parameters:
      - $ref: '#/components/parameters/orgId'
    get:
      tags:
        - Sessions
      summary: List sessions
      description: >-
        Returns Sessions newest first, cursor-paginated. By default,
        status=active hides archived Sessions; status accepts active, archived,
        or all. The current conversation Session of a Reason (a person's chat
        with it, the `session_id` listReasons returns) is left out of active and
        archived; status=all adds the ones you can read to the active and
        archived Sessions. No status lists subagent Sessions, side chats, memory
        reviews or a deleted Reason's conversations, so a sum over the list is
        not a workspace's whole usage. origin accepts ui, external,
        external:cli|mcp|api, or comma-separated values. Follow-up execution
        Attempts update their Session and never appear as additional list items.
        A list item reports the same `status`, `outcome`, `usage` and `cost_usd`
        as Retrieve a session: usage and cost are the Session's totals across
        all its Attempts, not its latest Attempt's. Its `result` is the text
        summary, and Retrieve a session returns a structured result. Responses
        carry a weak `ETag`; send it as `If-None-Match` to receive `304 Not
        Modified` while the page is unchanged. A 200 or 304 may repeat usage
        counters (`usage`, `context`, `cost_usd`, `duration_ms`) and `model` up
        to 10 seconds old; every other property is current. A 304 for a page
        narrowed by `fields` to none of those may be up to 5 minutes old.


        <sub>Scope: `sessions:read`</sub>
      operationId: listSessions
      parameters:
        - in: query
          name: status
          schema:
            type: string
            enum:
              - active
              - archived
              - all
            default: active
          description: >-
            Which Sessions to list by archive state, not by run status: active
            for the working list, archived for archived Sessions only, all for
            both. `all` also lists the current Reason conversations you can read
            (a person's chat with a Reason), which active and archived leave
            out; a deleted Reason's conversations are never listed.
        - in: query
          name: origin
          schema:
            type: string
            maxLength: 100
            pattern: >-
              ^(?:ui|external|external:(?:cli|mcp|api))(?:,(?:ui|external|external:(?:cli|mcp|api)))*$
          description: >-
            Where the Sessions were started, one source or several joined by
            commas: `ui` is the Reason app, `external` covers CLI, MCP and API
            starts together, and external:cli, external:mcp or external:api
            picks one. Omitted, every source is listed.
        - in: query
          name: archived
          schema:
            type: string
            enum:
              - exclude
              - only
              - include
          description: >-
            Older spelling of `status`, read only when `status` is omitted:
            exclude leaves archived Sessions out, only lists just them, include
            lists both and, like status=all, the current Reason conversations
            you can read. With neither filter, archived Sessions are left out.
        - in: query
          name: search
          schema:
            type: string
            minLength: 3
            maxLength: 500
          description: >-
            Words to look for in Session titles, ignoring case and taken
            literally; transcripts are not searched. A search returns smaller
            pages, so follow `end_cursor` for more matches.
        - in: query
          name: project_id
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            deprecated: true
          description: >-
            Deprecated: Projects are retired in favour of Reasons. Filters by an
            accessible Project ID in this Workspace, as returned in a Session's
            project_id.
        - in: query
          name: reason_id
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: >-
            Lists only the Sessions filed under this Reason (listReasons), one
            you can see or one of your archived ones. The same id as project_id:
            send either, or both with the same value.
        - in: query
          name: first
          schema:
            type: integer
            default: 50
          description: >-
            How many Sessions one page holds, up to 200 (a larger value is
            capped); a page of `search` matches holds at most 24.
        - in: query
          name: limit
          schema:
            type: integer
          description: >-
            Page size under its other name, for clients that send `limit`: it
            means exactly what `first` means, and `first` wins when both are
            set.
        - in: query
          name: after
          schema:
            type: string
          description: >-
            Opaque cursor: the previous page's `end_cursor`, to read the next
            page. Omit it for the first (newest) page.
        - in: query
          name: fields
          schema:
            type: string
            example: status,repo,model,updated_at
          description: >-
            The Session properties each item needs, comma-separated;
            `session_id` always comes back. For a lean page,
            `status,repo,model,updated_at` returns each item as `session_id`
            plus those four, a small fraction of a full item. Names are those of
            Retrieve a session except `previous_attempt_failure`, which only
            Retrieve a session returns; an unknown name is refused with 400
            `invalid_request` listing `allowed_fields`. Each item leaves out
            every other property, even ones the Session schema marks required.
            Without `usage`, `context`, `cost_usd`, `duration_ms` and `model`,
            the `ETag` changes when a Session's listed property or who can see
            it changes, and at least every 5 minutes, so a poll sending
            `If-None-Match` gets `304 Not Modified` in between; a 304 page is
            never more than 5 minutes old.
        - in: query
          name: outcome
          schema:
            type: string
            maxLength: 60
            pattern: >-
              ^(?:success|failure|action_required)(?:,(?:success|failure|action_required))*$
          description: >-
            Lists only Sessions whose `outcome` is one of these,
            comma-separated: success, failure or action_required.
            `outcome=action_required` is the digest of blocked Sessions: each
            one's `blocker` says what stopped it and the next step (add
            `fields=title,blocker,url` for a compact digest). The filter applies
            to each page as read, so a page may hold fewer items than `first`,
            even none; follow `end_cursor` while `has_next_page` is true.
      responses:
        '200':
          description: A page of sessions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Session'
                    description: Sessions on this page, newest first.
                  end_cursor:
                    description: >-
                      Cursor of the last Session on this page; pass it as
                      `after` for the next page. Null on an empty page.
                    type:
                      - string
                      - 'null'
                  has_next_page:
                    type: boolean
                    description: True when more Sessions follow this page.
        '304':
          description: The page matching `If-None-Match` is unchanged.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          description: >-
            Search capacity is busy. Retry after the Retry-After header's number
            of seconds.
        '503':
          description: >-
            `session_usage_temporarily_unavailable`: the page's usage totals
            could not be read in time. Retry after the Retry-After header's
            number of seconds, ask for a smaller page, or name `fields` without
            `usage` and `cost_usd`.
      security:
        - reasonApiKey:
            - sessions:read
components:
  parameters:
    orgId:
      name: orgId
      in: path
      required: true
      description: Organization id or slug. Resolve it with `GET /v3/self`.
      schema:
        type: string
  schemas:
    Session:
      type: object
      properties:
        follow_up:
          description: >-
            Opt-in detail field: request fields=follow_up. Null when temporarily
            unavailable. Durable follow-through state. Pending check-ins do not
            change lifecycle status; merge is never evidence of deployment or
            verification.
          anyOf:
            - $ref: '#/components/schemas/SessionFollowUp'
            - type: 'null'
        benchmark_profile:
          description: 'Always null: benchmark_profile is retired.'
          oneOf:
            - type: string
              const: coding-benchmark-v1
            - type: 'null'
        runtime_profile:
          description: >-
            runtime/reason-sync-yield-v1 on a retired isolated Session that
            requested it through the retired runtime_profile field. Null
            otherwise.
          oneOf:
            - type: string
              const: runtime/reason-sync-yield-v1
            - type: 'null'
        experimental_runtime_profile:
          description: >-
            The runtime profile the Session's latest Attempt runs: the default
            C2 harness on every Session that runs it, whether or not its request
            named it (a Session of the retired
            runtime/reason-capability-shell-v1 continues on it) — reported as
            runtime/reason-c2-tools-v7; runtime/reason-v7-sync-yield-v1 or
            runtime/reason-v7-sync-yield-machine-sdk-v1 on a stored Session of
            that retired harness; runtime/reason-v7-2026-10,
            runtime/reason-v7-2026-11, runtime/reason-v8-2026-10,
            runtime/reason-v8.1-2026-10, runtime/reason-v8.2-2026-10,
            runtime/reason-agent-1.2, runtime/reason-agent-1.3 or
            runtime/reason-agent-1.3.1 on a Session that runs it; a Session of a
            deleted v7 evaluation profile reports the default C2 harness, which
            it re-admits to. Null otherwise.
          oneOf:
            - type: string
              enum:
                - runtime/reason-c2-tools-v7
                - runtime/reason-v7-sync-yield-v1
                - runtime/reason-v7-sync-yield-machine-sdk-v1
                - runtime/reason-v7-2026-10
                - runtime/reason-v7-2026-11
                - runtime/reason-v8-2026-10
                - runtime/reason-v8.1-2026-10
                - runtime/reason-v8.2-2026-10
                - runtime/reason-agent-1.2
                - runtime/reason-agent-1.3
                - runtime/reason-agent-1.3.1
            - type: 'null'
        experimental_runtime_features:
          description: >-
            The runtime features the Session's create named
            (experimental_runtime_features), in canonical order. Null when it
            named none.
          type:
            - array
            - 'null'
          items:
            type: string
            enum:
              - banner
              - sdk_index
              - service_tier
              - output_cap
              - git_metadata
              - serial_reads
              - recovery_defer_idle_hands
              - fewer_tests_low
              - fewer_tests_medium
              - fewer_tests_high
              - fewer_tests_max
              - fewer_tests_max_alone
              - verify_line_alone
              - addendum_placebo
              - bash_yield
              - sync_bash
              - turn_line_removed
              - turn_line_questions
              - output_cap_continue
              - image_history_append_only
              - cache_ttl_1h
        session_policy:
          type: object
          properties:
            version:
              type: number
              const: 1
              description: Version of this policy shape.
            mode:
              type: string
              enum:
                - standard
                - isolated
                - ephemeral
              description: >-
                How the Session runs: standard for normal work, ephemeral for a
                single benchmark trial. isolated is retired: only Sessions
                created before its retirement report it, and a retry, follow-up,
                wake or move of one returns 409 session_mode_retired.
            components:
              type: object
              properties:
                memoryRead:
                  type: boolean
                  description: Whether memory reads are enabled.
                memoryWrite:
                  type: boolean
                  description: Whether memory writes are enabled.
                skills:
                  type: boolean
                  description: Whether skills are enabled.
                inheritedInstructions:
                  type: boolean
                  description: Whether inherited instructions are enabled.
                integrations:
                  type: boolean
                  description: Whether integrations are enabled.
                secretInjection:
                  type: boolean
                  description: Whether secret injection is enabled.
              required:
                - memoryRead
                - memoryWrite
                - skills
                - inheritedInstructions
                - integrations
                - secretInjection
              description: >-
                The optional capability families, each enabled (true) or
                disabled (false) for this Session.
            workspaceOwnership:
              type: string
              enum:
                - managed
                - externally-managed
              description: >-
                Filesystem persistence owner. Sessions created with the
                deprecated ara-managed spelling report managed.
            personalContext:
              description: >-
                Present and false when the Session was created with
                personal_context: false: it runs without its creator's personal
                skills, memory, secrets and connections. Absent when the
                creator's personal context loads.
              type: boolean
              const: false
            pullRequestPolicy:
              description: >-
                Present as draft_only when the Session was created with
                pull_request_policy: draft_only: its pull requests stay drafts
                and it cannot merge, queue, auto-merge or mark one ready. Absent
                for the normal delivery flow.
              type: string
              const: draft_only
          required:
            - version
            - mode
            - components
            - workspaceOwnership
          description: >-
            Server-resolved immutable Session policy. Enabled components remain
            subject to normal permissions and configuration.
        session_id:
          type: string
          description: >-
            The Session's stable id; pass it as sessionId to the other session
            tools.
        placement_receipt:
          $ref: '#/components/schemas/PlacementReceipt'
        origin:
          type: string
          enum:
            - ui
            - external:cli
            - external:mcp
            - external:api
          description: >-
            Where the Session was started: ui is the Reason app, external:cli,
            external:mcp and external:api the CLI, an MCP client and the API.
        origin_agent:
          description: Name of the agent or client that started the Session, when known.
          type:
            - string
            - 'null'
        agent_identity_source:
          description: >-
            How origin_agent was established: self_reported by the caller, from
            the credential, or from the Device.
          oneOf:
            - type: string
              enum:
                - self_reported
                - credential
                - device
            - type: 'null'
        status:
          type: string
          enum:
            - running
            - exit
            - error
            - suspended
          description: >-
            Lifecycle state, not task success: running, exit (execution
            completed), error (execution failed), or suspended (cancelled/quota;
            suspended_reason says which). An exit can have outcome failure or
            action_required. The task succeeded if and only if outcome is
            success; check outcome, result, and diagnostics before treating work
            as successful.
        suspended_reason:
          description: >-
            Why status is suspended: cancelled (an explicit cancel stopped the
            Session) or quota_exhausted (the Workspace ran out of quota). Null
            for every other status.
          oneOf:
            - type: string
              enum:
                - cancelled
                - quota_exhausted
            - type: 'null'
        url:
          type: string
          description: Web URL to watch the session.
        created_at:
          description: When the Session was created.
          type:
            - string
            - 'null'
          format: date-time
        started_at:
          description: When execution started; null before it starts.
          type:
            - string
            - 'null'
          format: date-time
        finished_at:
          description: When execution finished; null while running.
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          description: >-
            When the Session's current Attempt last changed (status, result,
            pull request, usage); sort or diff on it to see which Sessions moved
            since a previous read.
          type:
            - string
            - 'null'
          format: date-time
        title:
          description: >-
            Display title: the Session's own title, else the issue title, else
            the start of the opening prompt.
          type:
            - string
            - 'null'
        prompt:
          description: >-
            The opening instruction, truncated to 16 KiB. Check
            prompt_truncated; read the session messages for the full text.
          type:
            - string
            - 'null'
        prompt_truncated:
          type: boolean
          description: True when prompt was cut to the 16 KiB echo limit.
        prompt_bytes:
          description: UTF-8 byte length of the full prompt, before truncation.
          type:
            - integer
            - 'null'
        tags:
          type: array
          items:
            type: string
          description: The Session's tag labels; empty when it has none.
        project_id:
          deprecated: true
          description: >-
            Deprecated: Projects are retired in favour of Reasons. Project
            containing the session, or null for an unassigned session.
          type:
            - string
            - 'null'
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        reason_id:
          description: >-
            The Reason (listReasons) this Session is listed under: the one whose
            conversation started it, directly or through the Sessions it
            started. A Session filed in a former Project names that Project's
            id, which its Reason kept. Null when no Reason started it.
          type:
            - string
            - 'null'
        created_by_session_id:
          description: >-
            The Session whose agent started this one with sessions_create; null
            when a person, a trigger or a Loop started it.
          type:
            - string
            - 'null'
        delegation:
          type: object
          properties:
            max_depth:
              type: integer
              minimum: 1
              maximum: 5
              description: How deep the tree may nest below its root Session.
            children_can_create_sessions:
              type: boolean
              description: >-
                Whether subagents above the last level may create Sessions that
                join the tree.
          required:
            - max_depth
            - children_can_create_sessions
          description: >-
            The delegation limits a caller set for this Session's tree (see
            `delegation` on createSession); absent when none were set, which is
            the default tree.
        automation_id:
          description: >-
            The automation (Loop) whose trigger started this Session, as
            listReasonLoops (or listAutomations) names it; null otherwise.
          type:
            - string
            - 'null'
        target:
          anyOf:
            - oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      const: cloud
                      description: Run on Reason-managed cloud compute.
                  required:
                    - kind
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      const: mac
                    device_id:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    root_id:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  required:
                    - kind
                    - device_id
                    - root_id
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      const: headless
                      description: >-
                        Run on a CLI-connected computer or externally
                        provisioned worker.
                    device_id:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      description: Connected computer or worker ID returned by listDevices.
                    root_id:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    workspace_mode:
                      description: >-
                        Defaults to a stable Session-managed checkout.
                        project_root explicitly operates the selected existing
                        root.
                      type: string
                      enum:
                        - managed
                        - project_root
                    workspace_path:
                      description: >-
                        Absolute path of the project_root on the Device, as the
                        client sees it (for example /app). Read only with
                        workspace_mode project_root, as the working directory
                        the default C2 harness names in its model prompt;
                        ignored otherwise, and rejected when the request names
                        experimental_runtime_profile runtime/reason-c2-tools-v7.
                        It grants nothing and never selects a directory.
                      type: string
                      maxLength: 4096
                      pattern: ^\/[^\u0000\r\n]*$
                  required:
                    - kind
                    - device_id
                    - root_id
                  additionalProperties: false
            - type: 'null'
          description: >-
            Present on GET: the execution target this Session was created with
            (`cloud`, or the Device and root it runs on). A later handoff is not
            reflected. A Machine target reads back as its placed headless
            worker; see `machine`.
        machine:
          $ref: '#/components/schemas/SessionMachine'
        repo:
          description: >-
            The Session's starting repository as owner/name; null for a
            repository-neutral Session.
          type:
            - string
            - 'null'
        provider:
          description: Source-control provider for the session repository.
          oneOf:
            - type: string
              enum:
                - github
                - gitlab
            - type: 'null'
        model:
          description: Concrete model selected for this session, or null when inherited.
          type:
            - string
            - 'null'
        reason_version:
          description: >-
            The Reason Agent version (X.Y, e.g. 1.4 for Reason Agent 1.4) of the
            server that executed the Session's latest turn. It names the daily
            release; reason_commit_sha is the exact build. During a rolling
            deploy this is the release that actually ran the turn, not the
            newest one. Null before the turn starts and for turns that ran
            before versions were recorded.
          type:
            - string
            - 'null'
        reason_commit_sha:
          description: >-
            The commit the server that executed the Session's latest turn was
            built from. Null when reason_version is null or the build carried no
            commit.
          type:
            - string
            - 'null'
        reasoning_effort:
          description: >-
            Reasoning effort override the Session runs with; null when none was
            set.
          type:
            - string
            - 'null'
        hands_mode:
          type: string
          enum:
            - adaptive
            - brain_only
          description: >-
            Durable physical execution policy. Brain-only sessions never acquire
            a shell, browser, sandbox, or physical secret environment.
        branch:
          description: >-
            Name of the Session's working branch in its workspace. It is
            assigned when the machine starts, before any commit, so it exists on
            the remote only once the Session pushed to it: check pr_url and
            branch_has_commits.
          type:
            - string
            - 'null'
        branch_has_commits:
          description: >-
            Whether the working branch reached the remote without a pull
            request: true when it has pushed commits, false when the Session
            ended without pushing any (the branch may not exist on the remote).
            Null while undetermined, and when pr_url is set.
          type:
            - boolean
            - 'null'
        pr_url:
          description: >-
            URL of the pull request the Session opened or continued; null when
            there is none.
          type:
            - string
            - 'null'
        pr_title:
          description: Title of that pull request.
          type:
            - string
            - 'null'
        result_summary:
          description: >-
            Text summary of the latest turn's answer; null before a turn
            finishes.
          type:
            - string
            - 'null'
        outcome:
          description: >-
            The task verdict, and the one field that says whether the work
            succeeded: the task succeeded if and only if outcome is success.
            Retrieve a session and List sessions report the same value. With
            `completion_mode: run_outcome` it is the verdict the agent recorded
            (success, failure, or action_required when a person or an
            unavailable dependency must act); a run that stops without recording
            one never reports success, normally action_required with its reply
            in result. Recording a verdict is a tool call, so a prompt that
            forbids tools gets action_required even when the reply is correct.
            Without `completion_mode` no verdict is recorded: an exit reports
            success because the execution completed (action_required when the
            turn ended waiting on a person), which does not say the work was
            checked. Null while running and when status is error or suspended
            without a verdict.
          oneOf:
            - type: string
              enum:
                - success
                - failure
                - action_required
            - type: 'null'
        result:
          description: >-
            Caller-defined JSON result for a noninteractive completion, or the
            ordinary final summary for legacy Sessions.
        blocker:
          description: >-
            When outcome is failure or action_required: what blocked the Session
            and the next step a person takes, in one sentence the agent wrote
            (for example "Connect 1password: the deploy reads its token from the
            vault"). The agent states it when it records the verdict, or it is
            the access card the turn waits on. Null when the agent stated none,
            while running, and when outcome is success. List sessions reports it
            on each row.
          type:
            - string
            - 'null'
        failure:
          description: >-
            Why the latest turn stopped and how to get it going again, for a
            caller that does not read the transcript. Null while running and
            when the turn did not stop on a failure (an agent's own verdict is
            in `outcome` and `blocker`). List sessions reports it on each row.
          type:
            - object
            - 'null'
          properties:
            category:
              type: string
              description: >-
                What kind of stop, for example `cloud_start_failed`,
                `model_auth`, `provider_model_not_included`,
                `integration_access` or `runtime_failure`. New categories may
                appear.
            title:
              type: string
              description: A few words, as the app titles the notice.
            message:
              type: string
              description: >-
                One or two plain sentences: what happened and how to get going
                again, the same words the app shows.
            resolution:
              type: string
              enum:
                - retry
                - change_request
                - person
                - none
              description: >-
                Who can get it going again. `retry`: send the same request again
                (sendSessionMessage, or create the Session again); nothing needs
                changing. `change_request`: edit the request or choose another
                model, then send it. `person`: only someone with access to the
                workspace or its accounts can fix it (a signed-out model
                account, credits, a plan, a connection's access); give them
                `message` and the `actions` link, and retry once they say it is
                fixed. `none`: a person stopped it on purpose.
            actions:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                    description: >-
                      The button's words in the app, for example `Reconnect` or
                      `Open Billing`.
                  url:
                    type: string
                    description: Where the fix is, in the Reason app.
                required:
                  - label
                  - url
              description: >-
                Links to the fix in the Reason app; empty when there is nothing
                to open.
          required:
            - category
            - title
            - message
            - resolution
            - actions
        error_class:
          description: >-
            Stable runtime failure class when execution did not produce a task
            outcome. Runtime codes use the run_ prefix (for example run_error,
            run_timeout, run_cancelled) and cloud execution codes the cloud_
            prefix (for example cloud_device_unavailable); since 2026-10 they
            replace the earlier runtime-internal and ara_cloud_ spellings, which
            the API no longer reports.
          type:
            - string
            - 'null'
        usage_limit_resume:
          description: >-
            Present on GET: the pending automatic continuation after a connected
            model account's usage limit. Null when none is pending, including
            after Stop or newer input. A pending continuation does not guarantee
            provider capacity. Poll this field instead of repeatedly sending the
            same request.
          type:
            - object
            - 'null'
          properties:
            resumes_at:
              description: >-
                When the provider's usage limit resets and Reason will try to
                continue automatically. Null means the provider supplied no
                reset time; the continuation waits for restored usage or a
                different model account.
              type:
                - string
                - 'null'
              format: date-time
          required:
            - resumes_at
        error_message:
          description: >-
            Redacted persisted error preview, bounded to 1000 characters; null
            when unavailable.
          type:
            - string
            - 'null'
        failure_diagnostics:
          description: >-
            Where and why the latest Attempt failed: the attribution its failure
            recorded when it ended the Attempt, else derived from the stored
            failure signature. An unknown stage remains null.
          type:
            - object
            - 'null'
          properties:
            failure_stage:
              description: Execution stage where failure occurred.
              type:
                - string
                - 'null'
            reason_code:
              description: >-
                Specific machine-readable reason code for the failure. Runtime
                and cloud execution codes use the run_ and cloud_ prefixes, as
                in error_class.
              type:
                - string
                - 'null'
            root_cause:
              description: Root cause classification of the failure.
              type:
                - string
                - 'null'
          required:
            - failure_stage
            - reason_code
            - root_cause
        failure_stage:
          description: Execution stage where failure occurred.
          type:
            - string
            - 'null'
        reason_code:
          description: >-
            Specific machine-readable reason code for the failure. Runtime and
            cloud execution codes use the run_ and cloud_ prefixes, as in
            error_class.
          type:
            - string
            - 'null'
        root_cause:
          description: Root cause classification of the failure.
          type:
            - string
            - 'null'
        previous_attempt_failure:
          description: >-
            The most recent failed Attempt of the current Turn before the
            current Attempt, so a failure stays readable after a retry replaced
            it (for example a cloud_device_unavailable start failure followed by
            a successful retry). The current Attempt's own failure is in
            error_class and failure_diagnostics; this is null when the current
            Attempt failed, no earlier Attempt of the Turn did, or the current
            run is not a Session Attempt (a resource transition or wake).
            Returned by getSession on a full read, or when `fields` names it;
            not on the Session list.
          type:
            - object
            - 'null'
          properties:
            attempt_id:
              type: string
              description: The failed Attempt's id.
            status:
              type: string
              description: The failed Attempt's public status (error).
            error_class:
              description: That Attempt's failure class, as in error_class.
              type:
                - string
                - 'null'
            failure_stage:
              description: Execution stage where that Attempt failed.
              type:
                - string
                - 'null'
            reason_code:
              description: That Attempt's reason code, as in reason_code.
              type:
                - string
                - 'null'
            root_cause:
              description: That Attempt's root cause classification.
              type:
                - string
                - 'null'
            finished_at:
              description: When that Attempt finished.
              type:
                - string
                - 'null'
          required:
            - attempt_id
            - status
            - error_class
            - failure_stage
            - reason_code
            - root_cause
            - finished_at
        diagnostic_message:
          description: >-
            Fixed public message selected from an allowlisted persisted error
            class, never error prose, prompts or tool output. Null when unknown.
          type:
            - string
            - 'null'
          maxLength: 160
        duration_ms:
          description: Execution time in milliseconds; null when not recorded.
          type:
            - integer
            - 'null'
        cost_usd:
          description: >-
            Total model spend in USD across the session's turns. Null when usage
            was never reported.
          type:
            - number
            - 'null'
        usage:
          type: object
          properties:
            input_tokens:
              description: Model input tokens across the Session's turns.
              type:
                - integer
                - 'null'
            output_tokens:
              description: Model output tokens across the Session's turns.
              type:
                - integer
                - 'null'
            total_tokens:
              description: input_tokens plus output_tokens; null unless both are known.
              type:
                - integer
                - 'null'
          required:
            - input_tokens
            - output_tokens
            - total_tokens
          description: >-
            Token usage totals for the session. Fields are null for runs that
            predate usage persistence.
        context:
          type: object
          properties:
            tokens:
              description: Tokens in the model's context window after the latest turn.
              type:
                - integer
                - 'null'
            window:
              description: The model's context window size.
              type:
                - integer
                - 'null'
            percent:
              description: Context occupancy 0-100, rounded.
              type:
                - integer
                - 'null'
            compaction_threshold_tokens:
              description: >-
                The context size at which the latest turn folded earlier turns
                into a summary, for the model it ran on: the Session's or
                workspace's `compaction.threshold_tokens` (at most what the
                model can hold), else Reason's recommendation. Recorded when a
                turn ends; absent before the first turn ends and for turns that
                predate it.
              type:
                - integer
                - 'null'
            compaction_threshold_source:
              description: >-
                What set `compaction_threshold_tokens`: `session` (this
                Session's `compaction`), `workspace` (the workspace's
                `compaction` setting) or `recommended` (Reason's own threshold).
                Present with `compaction_threshold_tokens`.
              oneOf:
                - type: string
                  enum:
                    - recommended
                    - workspace
                    - session
                - type: 'null'
          required:
            - tokens
            - window
            - percent
          description: >-
            Live context occupancy after the latest turn (not billing
            throughput).
        is_archived:
          type: boolean
          description: >-
            True when the Session is archived (archiveSession); listSessions
            hides it unless status is archived or all.
        session_type:
          type: string
          enum:
            - session
            - sidechat
            - subagent
          description: Session, sidechat fork, or read-only subagent Session.
        source_session_id:
          description: >-
            The fork source for a sidechat or spawning Session for a subagent;
            null for a normal Session.
          type:
            - string
            - 'null'
        read_only:
          type: boolean
          description: True only for subagent Sessions.
        repos:
          type: array
          items:
            type: string
          description: >-
            Every repository currently attached to the session, as owner/name.
            Present on Retrieve a session only, and only when recorded.
        run:
          $ref: '#/components/schemas/SessionTurnRun'
        change_requests:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                description: Pull request or merge request URL.
              status:
                type: string
                enum:
                  - active
                  - completed
                  - retired
                description: >-
                  The Session's delivery record for this change request, not its
                  live provider state: it stays active after the pull request
                  merged or closed. Read the pull request itself for whether it
                  is open.
            required:
              - url
              - status
          description: >-
            Every change request the session opened, including ones in
            repositories other than `repo`. Present on Retrieve a session only,
            and only when recorded.
      required:
        - session_policy
        - session_id
        - status
        - url
        - created_at
    SessionFollowUp:
      type: object
      properties:
        waiting:
          type: boolean
          description: >-
            At least one enabled check-in is pending. Does not imply that the
            Session is idle or that a wake will execute successfully.
        pending_check_ins:
          type: array
          items:
            $ref: '#/components/schemas/SessionCheckIn'
          description: Pending check-ins, at most 100.
        pending_check_ins_has_more:
          type: boolean
          description: >-
            True when more than 100 check-ins are pending and the rest are left
            out.
        pr_subscription:
          type: object
          properties:
            status:
              type: string
              enum:
                - armed
                - ended
                - skipped
                - not_recorded
              description: >-
                Any active watch means armed. Otherwise skipped means a
                persisted skipped attempt for a PR without a watch; ended means
                watches are recorded. Watch evidence takes precedence for the
                same PR. No record is not evidence of a skip.
            items:
              type: array
              items:
                $ref: '#/components/schemas/SessionPrSubscription'
              description: The Session's pull request subscriptions, at most 100.
            has_more:
              type: boolean
              description: >-
                True when more than 100 subscriptions exist and the rest are
                left out.
            latest_attempts:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: The attempt receipt's id.
                  repository:
                    type: string
                    description: The pull request's repository, owner/name.
                  number:
                    type: integer
                    description: The pull request number.
                  status:
                    type: string
                    enum:
                      - armed
                      - ended
                      - skipped
                    description: What the attempt recorded for the subscription.
                  reason:
                    type: string
                    enum:
                      - watch_active
                      - subscription_ended
                      - pending_without_watch
                      - trigger_not_created
                      - watch_not_active
                      - subscription_failed
                    description: Why it recorded that status.
                  observed_at:
                    type: string
                    description: When the attempt was recorded.
                required:
                  - id
                  - repository
                  - number
                  - status
                  - reason
                  - observed_at
              description: >-
                Newest recorded attempt per pull request within the latest 100
                receipts. Historical observations, not current subscription
                state.
            attempts_has_more:
              type: boolean
              description: True when older receipts beyond the latest 100 were not read.
          required:
            - status
            - items
            - has_more
            - latest_attempts
            - attempts_has_more
          description: >-
            Pull request subscriptions: the overall status, each subscription,
            and the latest recorded attempt per pull request.
        latest_wake:
          description: >-
            Latest fired check-in and its recorded wake metadata, not proof an
            Attempt ran or a deployment completed. Null when none has fired.
          type:
            - object
            - 'null'
          properties:
            check_in_id:
              type: string
              description: The check-in that fired.
            recorded_at:
              type: string
              description: When the wake was recorded.
            cause:
              type: string
              enum:
                - events
                - deadline
                - scheduled
                - not_recorded
              description: >-
                What fired it: events (the awaited event arrived), deadline (it
                gave up waiting), scheduled (its time came) or not_recorded.
            source:
              description: The awaited event's source; null for a timed check-in.
              oneOf:
                - type: string
                  enum:
                    - slack
                    - github
                    - webhook
                    - web
                - type: 'null'
            end_reason:
              description: >-
                Why the watch ended at that wake; null when it did not end or no
                reason was recorded.
              oneOf:
                - type: string
                  enum:
                    - merged
                    - closed
                    - wake_cap
                    - repeat_failure
                    - idle
                    - cancelled
                - type: 'null'
          required:
            - check_in_id
            - recorded_at
            - cause
            - source
            - end_reason
      required:
        - waiting
        - pending_check_ins
        - pending_check_ins_has_more
        - pr_subscription
        - latest_wake
      description: >-
        Read-only, bounded projection of durable Session follow-through. Does
        not infer deployment or successful completion.
    PlacementReceipt:
      type: object
      properties:
        execution:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
            target:
              type: object
              properties:
                kind:
                  type: string
                  enum:
                    - cloud
                    - mac
                    - headless
                    - cli
                    - worker
                computer_id:
                  type: string
                device_id:
                  type: string
                root_id:
                  type: string
              required:
                - kind
            basis:
              type: string
              enum:
                - applied_placement
                - transition_source
                - retained_placement
          required:
            - status
            - reason
          description: >-
            Observed Session placement, not launch intent, desktop origin or a
            requested destination. Known identifies a placement, not permission
            or a guarantee that a command can run.
        physical_control:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
            target:
              type: object
              properties:
                kind:
                  type: string
                  enum:
                    - cloud
                    - mac
                    - headless
                    - cli
                    - worker
                computer_id:
                  type: string
                device_id:
                  type: string
                root_id:
                  type: string
              required:
                - kind
          required:
            - status
            - reason
          description: >-
            Physical control can target a different computer for each operation.
            No default target is inferred from execution or desktop provenance.
        root_grant:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
            root_id:
              type: string
          required:
            - status
            - reason
          description: >-
            A known root id is not proof of a current grant. Operations
            reauthorize their exact root and actor.
        browser:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
          required:
            - status
            - reason
          description: >-
            Browser profile and signed-in identity are operation-specific.
            Unknown does not mean signed out or unavailable.
        computer:
          description: >-
            Authorized inventory observation only; ready or live does not assert
            this Session is executing there.
          type: object
          properties:
            id:
              type: string
            kind:
              type: string
              enum:
                - cloud
                - mac
                - cli
                - worker
            state:
              type: string
            live:
              type: boolean
          required:
            - id
            - kind
            - state
            - live
      required:
        - execution
        - physical_control
        - root_grant
        - browser
      description: >-
        Additive observational receipt. Unknown means this response cannot
        establish the fact; unavailable means there is affirmative evidence it
        is not currently usable. Never authorizes an operation. Absent on older
        servers and on list responses.
    SessionMachine:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        name:
          type: string
        state:
          type: string
          enum:
            - waiting
            - placed
        queue_position:
          description: >-
            Live attempts ahead in the Machine queue while waiting; null once
            placed.
          type:
            - integer
            - 'null'
        device_id:
          description: Worker the attempt was placed on.
          type:
            - string
            - 'null'
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        enqueued_at:
          type: string
        placed_at:
          type:
            - string
            - 'null'
      required:
        - id
        - name
        - state
        - queue_position
        - device_id
        - enqueued_at
        - placed_at
      description: >-
        Present on GET for a Session attempt that targets a Machine: its queue
        state, live queue position while waiting, and the worker it was placed
        on.
    SessionTurnRun:
      type: object
      properties:
        requested_model:
          description: >-
            The model the turn asked for: the one named on create or by the
            message that started the turn, else the Session's default. Null when
            none was recorded.
          type:
            - string
            - 'null'
        model:
          description: >-
            The model the turn actually ran on. It differs from
            `requested_model` only when model rollover moved the turn to another
            model; `rollovers` lists each move.
          type:
            - string
            - 'null'
        requested_model_source_id:
          description: >-
            The connected account the Session was set to start on:
            `model_source_id` on create, or the account agents_spawn or
            sessions_create gave a child (an id from listModels). Null when none
            was named and routing chose.
          type:
            - string
            - 'null'
        model_source_id:
          description: >-
            The account that served the turn's model: `ara` for Reason credits,
            otherwise a connected account's id from listModels. Null when the
            turn ran without model routing and no account was pinned.
          type:
            - string
            - 'null'
        billing_mode:
          description: >-
            Who paid for the turn's model: `ara_paid` is Reason credits,
            `customer_paid` a connected subscription or API key. Null when
            unrecorded.
          oneOf:
            - type: string
              enum:
                - ara_paid
                - customer_paid
            - type: 'null'
        reasoning_effort:
          description: >-
            The reasoning effort the turn ran at; null when none was set and the
            model's default applied. A Reason's own conversation turn reports
            the lower effort it coordinates at; the Sessions it starts keep the
            assigned one.
          type:
            - string
            - 'null'
        speed:
          type: string
          enum:
            - fast
            - ultrafast
            - standard
          description: >-
            `fast` when the turn asked the provider for its priority tier (Fast
            mode), `ultrafast` for a ChatGPT subscription's Ultrafast tier,
            `standard` otherwise. Fast takes effect only where the provider
            offers a priority tier.
        rollovers:
          type: array
          items:
            type: object
            properties:
              at:
                description: When the turn moved.
                type:
                  - string
                  - 'null'
                format: date-time
              reason:
                description: >-
                  Why: `capacity` (a usage limit or no credit),
                  `provider_unavailable` (an outage), `declined` (the model
                  refused the request), or `recovered` (back on the earlier
                  account). New values may appear.
                type:
                  - string
                  - 'null'
              from_model:
                description: The model before the move.
                type:
                  - string
                  - 'null'
              from_model_source_id:
                description: The account before the move.
                type:
                  - string
                  - 'null'
              to_model:
                description: The model after the move.
                type:
                  - string
                  - 'null'
              to_model_source_id:
                description: 'The account after the move: `ara` for Reason credits.'
                type:
                  - string
                  - 'null'
              to_billing_mode:
                description: Who pays after the move.
                oneOf:
                  - type: string
                    enum:
                      - ara_paid
                      - customer_paid
                  - type: 'null'
            required:
              - at
              - reason
              - from_model
              - from_model_source_id
              - to_model
              - to_model_source_id
              - to_billing_mode
          description: >-
            Each move model rollover made during the turn, oldest first; empty
            when the turn stayed where it started. A move decided before the
            turn started (see `model_rolled_over` on create) shows as
            `model_source_id` differing from `requested_model_source_id`
            instead.
      required:
        - requested_model
        - model
        - requested_model_source_id
        - model_source_id
        - billing_mode
        - reasoning_effort
        - speed
        - rollovers
      description: >-
        What one turn asked for and what it actually ran on (model, account,
        billing, effort, speed) and any rollovers during it. On Retrieve a
        session it describes the latest turn; on each conversation reply (`kind:
        reply`), the turn that reply answers. Only ids and model names: never an
        account's label or credential.
    Error:
      type: object
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              required:
                - type
                - message
              properties:
                type:
                  type: string
                message:
                  type: string
                request_id:
                  type:
                    - string
                    - 'null'
        message:
          type: string
        required_scope:
          type: string
          description: >-
            The capability required when the request was denied for a missing
            scope.
    SessionCheckIn:
      type: object
      properties:
        id:
          type: string
          description: The check-in's id; pass it as followupId to cancelSessionFollowup.
        next_run_at:
          type: string
          description: When it next fires, or its deadline when it waits for an event.
        every_minutes:
          description: Repeat interval in minutes; null for a one-time check-in.
          type:
            - number
            - 'null'
        until:
          description: >-
            When a repeating check-in stops; null when it has no end or does not
            repeat.
          type:
            - string
            - 'null'
        paused:
          type: boolean
          description: True while it is paused and does not fire.
        waits_for_device:
          type: boolean
          description: >-
            True when it fires once a Device becomes available rather than at a
            fixed time.
        waits_for_session:
          type: boolean
          description: >-
            True when it watches another Session: that Session's report cancels
            it.
        waits_for:
          description: The event it waits for; null for a timed check-in.
          type:
            - object
            - 'null'
          properties:
            source:
              type: string
              enum:
                - slack
                - github
                - webhook
                - web
              description: Where the awaited event comes from.
            kind:
              type: string
              enum:
                - wait
                - pr
              description: >-
                pr for a pull request subscription, wait for any other event
                watch.
            keep_watching:
              type: boolean
              description: >-
                True when every matching event wakes the Session until the
                deadline, not only the first.
          required:
            - source
            - kind
            - keep_watching
      required:
        - id
        - next_run_at
        - every_minutes
        - until
        - paused
        - waits_for_device
        - waits_for_session
        - waits_for
      description: >-
        A pending check-in. Notes, conditions, URLs, credentials and event
        bodies are deliberately excluded.
    SessionPrSubscription:
      type: object
      properties:
        id:
          type: string
          description: The subscription's id.
        check_in_id:
          type: string
          description: >-
            The check-in that carries it; pass it as followupId to
            cancelSessionFollowup.
        repository:
          description: The pull request's repository, owner/name; null when not recorded.
          type:
            - string
            - 'null'
        number:
          description: The pull request number; null when not recorded.
          type:
            - integer
            - 'null'
        status:
          type: string
          enum:
            - armed
            - ended
          description: armed while the subscription is active, ended once it stopped.
        paused:
          type: boolean
          description: True while it is paused.
        end_reason:
          description: >-
            Persisted subscription stop reason. Null means no recognized reason
            was recorded; cancellation is not inferred.
          oneOf:
            - type: string
              enum:
                - merged
                - closed
                - wake_cap
                - repeat_failure
                - idle
                - cancelled
            - type: 'null'
      required:
        - id
        - check_in_id
        - repository
        - number
        - status
        - paused
        - end_reason
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: prompt_required
    Unauthorized:
      description: Missing, invalid, or expired key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: missing_bearer
            message: Authorization required
    Forbidden:
      description: The key lacks the required scope or role.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: missing_scope
            required_scope: sessions:read
  securitySchemes:
    reasonApiKey:
      type: http
      scheme: bearer
      bearerFormat: 'reason_<hex> (legacy: ara_<hex>)'
      description: >-
        Your Reason API key from Settings › API keys. New keys use `reason_`;
        legacy `ara_` keys remain accepted. Keys are capability-scoped: run,
        mcp:read, mcp:write, secrets:read, secrets:write, sessions:read,
        sessions:debug, devices:read, devices:write, devices:use,
        computers:read, computers:write, ssh:write, knowledge:read, memory:read,
        memory:write, skills:read, skills:write, pages:read, pages:write,
        repos:read, repos:write, reviews:read, reviews:write, deployment:read,
        analytics:read, org:read, org:write, attachments:read,
        attachments:write, guardrails:read, guardrails:write, network:read,
        network:write, automations:read, automations:write, agent_auth:read.
        devices:write, devices:use, computers:read, computers:write, ssh:write,
        network:read and network:write are opt-in, excluded from default keys.
        computers:read lists visible cloud and connected computers without
        waking them or granting execution access. devices:read discovers local
        Device targets; devices:use separately consents to local execution, so a
        discover-and-run local workflow needs both. devices:write manages
        enrollment and device grants; computers:write creates or deletes cloud
        computers; ssh:write manages retained SSH access. network:read reads the
        saved workspace network policy; network:write replaces custom allowed
        hosts and requires a current organization owner/admin. Legacy project
        PATCH requests containing network_allowed_hosts also require
        network:write plus their existing run scope and project management
        permission; saved project hosts do not affect current session egress.
        Only owners/admins can mint or manage keys with network:write; keys
        cannot grant themselves more authority. See /docs/network-policies for
        replacement semantics and runtime applicability. mcp:write manages MCP
        server configuration only; it does not authorize remote MCP-tool
        execution. sessions:read reads sessions, including the assistant,
        reasoning and tool activity in their events. sessions:debug is
        privileged: only for organization owners/admins, it expands session
        events to the full diagnostic projection (diagnostic event kinds, status
        text and raw event metadata).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.