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

# List sessions

> Returns unclassified public sessions in the calling organization, filtered by the declared session fields. Results are keyset-paginated and capped by limit (default 100, max 1000). Pass nextCursor back as cursor with the same filters and limit. Every page of one listing reads the same snapshot as the first page. Classified session trees are omitted.



## OpenAPI

````yaml /recursion/openapi.yaml get /managed-agents/v2/sessions
openapi: 3.1.0
info:
  title: Managed Agents API
  version: 0.15.0
  description: >-
    The Recursion Managed Agents REST API. Authenticate with a Recursion API key
    as a bearer token. An organization-scoped key acts in its own organization
    and needs nothing else; a tenant-scoped key must also send
    `x-organization-id` with an organization id or `default`. Field names follow
    each operation's published schema.
servers:
  - url: https://api.recursion.labelbox.com
security:
  - bearerAuth: []
paths:
  /managed-agents/v2/sessions:
    get:
      tags:
        - Sessions
      summary: List sessions
      description: >-
        Returns unclassified public sessions in the calling organization,
        filtered by the declared session fields. Results are keyset-paginated
        and capped by limit (default 100, max 1000). Pass nextCursor back as
        cursor with the same filters and limit. Every page of one listing reads
        the same snapshot as the first page. Classified session trees are
        omitted.
      operationId: managedAgentsListSessionsV2
      parameters:
        - description: Filter by session status. Any other value is rejected with 400.
          in: query
          name: status
          schema:
            description: Filter by session status. Any other value is rejected with 400.
            enum:
              - active
              - awaiting_human
              - completed
              - failed
              - cancelled
            type: string
        - description: >-
            Filter by one or more public session kinds. Classified
            platform-managed sessions are never returned by this list.
          in: query
          name: kindAny
          schema:
            description: >-
              Filter by one or more public session kinds. Classified
              platform-managed sessions are never returned by this list.
            items:
              type: string
            maxItems: 32
            minItems: 1
            type: array
            uniqueItems: true
        - description: >-
            Filter by agent id (UUID). A value that is not a UUID, including an
            empty one, is rejected with 400.
          in: query
          name: agentId
          schema:
            description: >-
              Filter by agent id (UUID). A value that is not a UUID, including
              an empty one, is rejected with 400.
            format: uuid
            type: string
        - description: >-
            Comma-separated current agent tag ids, with at most 32 distinct ids.
            A session row's agent must carry every requested tag (AND
            semantics). Unknown or cross-organization ids return 404. Tags are
            resolved at read time, not from the session snapshot.
          in: query
          name: tagIdsAll
          schema:
            description: >-
              Comma-separated current agent tag ids, with at most 32 distinct
              ids. A session row's agent must carry every requested tag (AND
              semantics). Unknown or cross-organization ids return 404. Tags are
              resolved at read time, not from the session snapshot.
            items:
              type: string
            maxItems: 32
            minItems: 1
            type: array
            uniqueItems: true
        - in: query
          name: externalSourceType
          schema:
            type: string
        - in: query
          name: externalSourceId
          schema:
            type: string
        - description: >-
            Exact-match filter on caller-defined session metadata as key:value,
            split at the first colon. Repeat the parameter to require several
            pairs; a session's root must carry every one (AND semantics).
            Children of a matching root match too, so combine with rootOnly to
            list only the roots.
          in: query
          name: metadataAll
          schema:
            description: >-
              Exact-match filter on caller-defined session metadata as
              key:value, split at the first colon. Repeat the parameter to
              require several pairs; a session's root must carry every one (AND
              semantics). Children of a matching root match too, so combine with
              rootOnly to list only the roots.
            items:
              type: string
            maxItems: 32
            minItems: 1
            type: array
            uniqueItems: true
        - description: >-
            Require the root session to carry this caller-defined metadata key
            with any value. Repeatable; every listed key must be present.
          in: query
          name: metadataKeyAll
          schema:
            description: >-
              Require the root session to carry this caller-defined metadata key
              with any value. Repeatable; every listed key must be present.
            items:
              type: string
            maxItems: 32
            minItems: 1
            type: array
            uniqueItems: true
        - description: >-
            Return only root sessions. Use this for cost list rows -- each root
            carries its whole tree's costUsd -- so children cannot consume the
            bounded page before their tree root.
          in: query
          name: rootOnly
          schema:
            description: >-
              Return only root sessions. Use this for cost list rows -- each
              root carries its whole tree's costUsd -- so children cannot
              consume the bounded page before their tree root.
            type: boolean
        - description: >-
            Return only root sessions whose active browser handoff is awaiting a
            person (not already being driven or resolved). Applied before
            ordering and pagination.
          in: query
          name: needsUser
          schema:
            description: >-
              Return only root sessions whose active browser handoff is awaiting
              a person (not already being driven or resolved). Applied before
              ordering and pagination.
            type: boolean
        - description: >-
            Filter root sessions by their newest immutable evaluation verdict
            before pagination. evaluated matches any verdict; none matches
            sessions with no evaluation.
          in: query
          name: evaluationResult
          schema:
            description: >-
              Filter root sessions by their newest immutable evaluation verdict
              before pagination. evaluated matches any verdict; none matches
              sessions with no evaluation.
            enum:
              - pass
              - fail
              - not_applicable
              - not_evaluable
              - evaluated
              - none
            type: string
        - description: >-
            Page size, from 1 to 1000; a value outside that range is rejected
            with 400. When more rows match, the response carries nextCursor;
            pass it back as cursor with the same filters and limit to read the
            next page.
          in: query
          name: limit
          schema:
            default: 100
            description: >-
              Page size, from 1 to 1000; a value outside that range is rejected
              with 400. When more rows match, the response carries nextCursor;
              pass it back as cursor with the same filters and limit to read the
              next page.
            maximum: 1000
            minimum: 1
            type: integer
        - description: >-
            Signed continuation token from a previous page's nextCursor. Bound
            to the organization and to the exact filters, sort, and limit it was
            issued for; valid for one hour. Later pages read the snapshot the
            first page was read at; once that snapshot is 55 minutes old the
            token is rejected with 400 and the listing must start again without
            cursor.
          in: query
          name: cursor
          schema:
            description: >-
              Signed continuation token from a previous page's nextCursor. Bound
              to the organization and to the exact filters, sort, and limit it
              was issued for; valid for one hour. Later pages read the snapshot
              the first page was read at; once that snapshot is 55 minutes old
              the token is rejected with 400 and the listing must start again
              without cursor.
            type: string
        - description: >-
            Return only the sessions this automation's runs started (UUID, as
            returned by the automations API). A value that is not a UUID,
            including an empty one, is rejected with 400.
          in: query
          name: automationId
          schema:
            description: >-
              Return only the sessions this automation's runs started (UUID, as
              returned by the automations API). A value that is not a UUID,
              including an empty one, is rejected with 400.
            format: uuid
            type: string
        - description: >-
            Return evaluation root sessions bound to this target session,
            including evaluations still running. Returns manual evaluations and,
            where supported, historical outcome evaluation roots. Linked outcome
            grading roots are found through the writer's outcome history.
            Requires kindAny=evaluation when kind is present. A value that is
            not a UUID is rejected with 400.
          in: query
          name: evaluationTargetSessionId
          schema:
            description: >-
              Return evaluation root sessions bound to this target session,
              including evaluations still running. Returns manual evaluations
              and, where supported, historical outcome evaluation roots. Linked
              outcome grading roots are found through the writer's outcome
              history. Requires kindAny=evaluation when kind is present. A value
              that is not a UUID is rejected with 400.
            format: uuid
            type: string
        - description: >-
            Column the whole list is ordered by before pagination. Ties break on
            the session's identity, so the order is total and pages neither skip
            nor repeat a session. last_activity_at is absent on a session that
            has not run a turn; those sort as the smallest value, last when
            descending. status orders each status group by updated_at, most
            recent first when ascending. session_id compares byte by byte. Any
            other value is rejected with 400.
          in: query
          name: sortBy
          schema:
            default: updated_at
            description: >-
              Column the whole list is ordered by before pagination. Ties break
              on the session's identity, so the order is total and pages neither
              skip nor repeat a session. last_activity_at is absent on a session
              that has not run a turn; those sort as the smallest value, last
              when descending. status orders each status group by updated_at,
              most recent first when ascending. session_id compares byte by
              byte. Any other value is rejected with 400.
            enum:
              - updated_at
              - created_at
              - last_activity_at
              - status
              - session_id
            type: string
        - description: Direction of sortBy. Any other value is rejected with 400.
          in: query
          name: sortDirection
          schema:
            default: desc
            description: Direction of sortBy. Any other value is rejected with 400.
            enum:
              - asc
              - desc
            type: string
        - $ref: '#/components/parameters/RecursionTenantId'
        - $ref: '#/components/parameters/RecursionOrganizationId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandaloneV2SessionListResponse'
          description: >-
            One keyset-paginated page of unclassified public sessions matching
            the requested filters. Classified session trees are omitted.
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                x-recursion-error-codes:
                  - invalid_request
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnauthorized'
                x-recursion-error-codes:
                  - unauthorized
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorForbidden'
                x-recursion-error-codes:
                  - forbidden
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorNotFound'
                x-recursion-error-codes:
                  - not_found
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '413':
          description: Payload Too Large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorPayloadTooLarge'
                x-recursion-error-codes:
                  - payload_too_large
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '429':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorRateLimitExceeded'
                x-recursion-error-codes:
                  - rate_limit_exceeded
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorInternalError'
                x-recursion-error-codes:
                  - internal_error
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '502':
          description: A dependent service returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorDependencyFailure'
                x-recursion-error-codes:
                  - bad_gateway
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '503':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: Service Unavailable.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                discriminator:
                  propertyName: code
                  mapping:
                    managed_agents_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                    service_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                x-recursion-error-codes:
                  - managed_agents_unavailable
                  - service_unavailable
        '504':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: A dependent service timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorDependencyTimeout'
                x-recursion-error-codes:
                  - gateway_timeout
components:
  parameters:
    RecursionTenantId:
      name: x-tenant-id
      in: header
      required: false
      description: >-
        Optional tenant consistency check. When present, it must name the tenant
        bound to the API key, including when x-organization-id is `default`.
      schema:
        minLength: 1
        type: string
    RecursionOrganizationId:
      name: x-organization-id
      in: header
      required: false
      description: >-
        Organization in which to act. Required for a tenant-scoped API key.
        Optional for an organization-scoped key, where it must name that same
        organization. The value may be an organization id or `default`.
      schema:
        minLength: 1
        type: string
  schemas:
    StandaloneV2SessionListResponse:
      properties:
        items:
          description: >-
            Unclassified public sessions matching the query filters, most
            recently updated first. Classified session trees are omitted.
          items:
            $ref: '#/components/schemas/StandaloneV2SessionListItem'
          type: array
        nextCursor:
          description: Cursor for the next page, or null on the last page.
          type:
            - 'null'
            - string
        total:
          description: >-
            Total matching sessions when known; null when the snapshot cannot
            count them cheaply.
          minimum: 0
          type:
            - 'null'
            - integer
          maximum: 9007199254740991
      required:
        - items
        - nextCursor
        - total
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorInvalidRequest:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - invalid_request
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorUnauthorized:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unauthorized
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorForbidden:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - forbidden
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorNotFound:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - not_found
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorPayloadTooLarge:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - payload_too_large
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorRateLimitExceeded:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - rate_limit_exceeded
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorInternalError:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - internal_error
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorDependencyFailure:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - bad_gateway
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorManagedAgentsUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - managed_agents_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorServiceUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - service_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorDependencyTimeout:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - gateway_timeout
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    StandaloneV2SessionListItem:
      properties:
        activeHandoff:
          $ref: '#/components/schemas/StandaloneV2ActiveHandoff'
          description: >-
            Current browser handoff, including its exclusive driver claim and
            deadline. Absent when no browser handoff is active. Never contains
            the short-lived access URL.
        agentId:
          description: >-
            Agent this session runs (UUID). Empty for imported sessions that
            were not started from an agent.
          type: string
        agentVersionId:
          description: >-
            Agent version this session runs (UUID), pinned at start so a later
            edit to the agent cannot change a running session. It changes only
            when the session moves to another version of its agent.
          type: string
        computerUse:
          description: >-
            Whether this session has a computer-enabled environment and a
            display that passed its readiness probe.
          type: boolean
        concurrencySlotHeld:
          description: >-
            Whether this root session currently occupies the agent's
            max_concurrent_sessions slot. True while admitted and non-terminal.
            False exclusively while an active queued root waits to start.
            Omitted for unlimited agents, child sessions, legacy rows, and
            terminal or deleted sessions.
          type: boolean
        config:
          type: object
          additionalProperties: false
          description: >-
            Always an empty object in a session-list row. Read the individual
            session for resolved runtime settings.
        costState:
          description: >-
            final once the session has ended, its sandbox has stopped, and every
            charge has settled: costUsd will not change unless the session is
            resumed. so_far while it can still grow. Present exactly when
            costUsd is.
          enum:
            - final
            - so_far
          type: string
        costUsd:
          description: >-
            Billed cost of this session's whole tree as an exact canonical
            decimal USD string. On Recursion, a writer's cost also includes
            linked cloned outcome evaluation roots, counting each ledger charge
            once; manual evaluations remain independent. On other surfaces, cost
            remains tree-only. Compute still running is included as an estimate;
            the figure is final once every included tree has ended and settled.
            Returned by managedAgentsGetSession and managedAgentsListSessions
            only, and absent when it cannot be read.
          examples:
            - '1.234567'
          type: string
        createdAt:
          description: RFC 3339 timestamp of when this record was created. Server-assigned.
          format: date-time
          type: string
        credentialRefs:
          description: >-
            Explicit allowlist of individual credentials the session may use;
            empty when none are listed. Read credentialRefsConfigured to tell an
            intentionally empty allowlist from a legacy session granted whole
            vaults.
          items:
            $ref: '#/components/schemas/StandaloneV2VaultCredentialRef'
          type: array
        credentialRefsConfigured:
          description: >-
            True when credentialRefs is an explicit allowlist. False on legacy
            sessions granted every credential in their vaults, which would
            otherwise be indistinguishable from an empty allowlist.
          type: boolean
        effectiveModel:
          description: >-
            Provider-qualified model string this session runs, including any
            per-session model override. Written at start; it changes only when
            the session moves to another version of its agent. Prefer this over
            resolving model_ref_id or the current agent version when displaying
            the model a session runs.
          type: string
        environmentId:
          description: Environment whose sandbox definition this session runs in (UUID).
          type: string
        evaluationEligibility:
          $ref: '#/components/schemas/StandaloneV2SessionEligibility'
          description: Current server-owned Evaluate-now decision for this session.
        executionState:
          description: >-
            Where the agent loop is. Empty for sessions without a loop, such as
            imported rollouts. provisioning includes any automatic setup-image
            refresh before sandbox creation. The deployment's compute-ready
            timeout (five minutes by default) bounds sandbox readiness after
            refresh, not the setup run itself. A failed setup or sandbox timeout
            fails the session with the reason in failure. This field, read from
            the session itself, is the authoritative status -- a session's event
            stream is written on a separate path and can lag it, so an empty
            event list does not mean the session is still starting.
          enum:
            - provisioning
            - queued
            - running
            - idle
            - completed
          type: string
        externalSourceId:
          description: >-
            Identifier of the session's counterpart in the external_source_type
            system, so a caller can find the session again from that side. Set
            together with external_source_type.
          type: string
        externalSourceType:
          description: >-
            Kind of external system this session is correlated to, e.g.
            slack_thread. Set together with external_source_id and filterable
            when listing sessions.
          type: string
        failure:
          $ref: '#/components/schemas/SessionFailure'
          description: >-
            Structured terminal failure. Omitted for healthy sessions and legacy
            rows.
        forkedAtEventId:
          description: >-
            Event in the parent session (UUID) this session was forked from, so
            the fork's starting context is identifiable. Set only on forks.
          type: string
        kind:
          type: string
          enum:
            - api_call
            - chat
            - rollout
            - subagent
            - benchmark
            - evaluation
          description: Public session kind returned by the session list.
        lastActivityAt:
          description: >-
            RFC 3339 timestamp of when the agent loop last made progress.
            Distinct from updated_at, which any metadata write touches. Absent
            for sessions that run no loop.
          format: date-time
          type: string
        latestEvaluation:
          $ref: '#/components/schemas/StandaloneV2LatestEvaluation'
          description: >-
            Newest immutable evaluation summary, or null when the session has
            none.
        metadata:
          additionalProperties:
            type: string
          description: >-
            Caller-defined string key/value pairs supplied when the session was
            started, e.g. ids from your own system. Immutable, present on root
            sessions only, and filterable with metadataAll=key:value or
            metadataKeyAll=key on GET /v2/sessions. At most 32 entries; keys use
            letters, digits, '_', '.', and '-' up to 64 characters; values are
            1-512 characters.
          type: object
        modelRefId:
          description: >-
            Model reference the session's turns run on (UUID), resolved from the
            agent version or the start request. Written at start; it changes
            only when the session moves to another version of its agent.
          type: string
        organizationId:
          description: >-
            Organization that owns this record. Resolved from the API key; never
            accepted from the caller.
          type: string
        parentSessionId:
          description: >-
            Session that created this one (UUID) — the delegating session for a
            subagent, or the source session for a fork. Empty on a root session.
          type: string
        projectId:
          description: >-
            Identifier of the external project the session's work belongs to,
            interpreted according to project_source.
          type: string
        rootSessionId:
          description: >-
            Root session of the multi-agent tree this session belongs to (UUID).
            Equal to sessionId for a root session.
          type: string
        sandboxInstanceId:
          description: >-
            Provider-assigned id of the sandbox instance serving this session.
            Empty before provisioning finishes; historical self_hosted sessions
            may also have no instance id.
          type: string
        sandboxProvider:
          description: >-
            Sandbox runtime that provisioned this session's compute, from the
            supported sandbox providers list.
          type: string
        sessionId:
          description: Identifier for this session (UUID). Server-assigned.
          type: string
        sessionPath:
          description: >-
            Position of this session within its tree, as a slash-delimited path
            of session ids. "/" for a root session.
          type: string
        sourceRefs:
          additionalProperties:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
          description: >-
            Secondary provenance ids from the originating system beyond the
            primary external source, e.g. an imported rollout's problem,
            problem-version, and run ids.
          type: object
        status:
          $ref: '#/components/schemas/SessionStatus'
          description: >-
            Coarse session state shared with RL rollout imports: active,
            awaiting_human (for a rollout, carries no score), completed, failed,
            or cancelled. For where a running agent loop is, read
            execution_state instead.
        stopReason:
          description: >-
            Why the loop is not running. Set whenever execution_state is idle or
            completed. sleeping means the agent chose to wait and the session
            resumes on the next message or at wake_at; awaiting_subagents means
            a coordinator is waiting on delegated work; out_of_credit and
            tenant_suspended pause before new work and continue on the next
            message after the tenant is admitted again; an out_of_credit pause
            from the last 72 hours also continues on its own within about a
            minute once the tenant is admitted again; budget_reached means the
            session tree reached its budget and paused before its next model
            request, and raising or removing the session's budget continues it.
          type: string
        updatedAt:
          description: >-
            RFC 3339 timestamp of the last change to this record.
            Server-assigned.
          format: date-time
          type: string
        userId:
          description: >-
            User the session was started on behalf of, resolved from the request
            scope.
          type: string
        vaultIds:
          description: >-
            Vaults (UUIDs) the session may draw credentials from. Combine with
            credentialRefs to narrow the grant to specific credentials.
          items:
            type: string
          type: array
        wakeAt:
          description: >-
            RFC 3339 timestamp at which a sleeping session wakes itself if
            nobody messages it first. Absent unless the agent scheduled a timed
            wait.
          format: date-time
          type: string
      required:
        - rootSessionId
        - sessionPath
        - sessionId
        - organizationId
        - kind
        - status
        - computerUse
        - credentialRefs
        - credentialRefsConfigured
        - config
        - createdAt
        - updatedAt
        - evaluationEligibility
        - latestEvaluation
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorDetails:
      type: object
      properties:
        field:
          description: >-
            Request field or header responsible for the error, when one can be
            identified.
          type: string
        issues:
          description: >-
            Boundary-validation failures as path-prefixed human-readable
            messages.
          type: array
          items:
            type: string
        requestId:
          description: Request correlation identifier for support and log lookup.
          type: string
        retryable:
          description: >-
            Server advice about failure transience. `true` means transient,
            `false` means non-transient, and absence gives no advice. Automatic
            replay is allowed only when this field is not `false` and the
            operation-specific retry and idempotency contract permits replay.
          type: boolean
      additionalProperties:
        $ref: '#/components/schemas/PlatformSafeJsonValue'
      description: >-
        Optional structured error details. Reserved transport fields are typed;
        code-specific fields remain forward compatible.
    StandaloneV2ActiveHandoff:
      properties:
        accessExpiresAt:
          description: >-
            Latest time the current display access remains usable; never later
            than deadline_at.
          format: date-time
          type: string
        deadlineAt:
          description: When the handoff automatically expires and the agent resumes.
          format: date-time
          type: string
        handoffId:
          description: Stable identifier for this browser handoff.
          type: string
        reason:
          description: Why the agent asked a person to take over the shared browser.
          type: string
        requestedAt:
          description: When the agent requested the handoff.
          format: date-time
          type: string
        state:
          description: >-
            Whether nobody has opened access yet, one person currently owns the
            display, or hand-back/deadline resolution is being delivered.
          enum:
            - awaiting_user
            - user_driving
            - resolved
          type: string
        wakeCause:
          description: >-
            Resolution cause once resolved: user_handed_back, deadline_elapsed,
            cancelled, or interrupted.
          type: string
      required:
        - handoffId
        - reason
        - requestedAt
        - deadlineAt
        - state
      type: object
      additionalProperties: false
    StandaloneV2VaultCredentialRef:
      properties:
        credentialId:
          description: Credential to select inside vault_id.
          type: string
        vaultId:
          description: >-
            Vault holding the credential. Required, because credential ids are
            unique only within a vault.
          type: string
      required:
        - vaultId
        - credentialId
      type: object
      additionalProperties: false
    StandaloneV2SessionEligibility:
      properties:
        eligible:
          description: Whether this session may be selected for Evaluate now.
          type: boolean
        reason:
          description: >-
            Stable reason the session is currently ineligible; omitted when
            eligible.
          type: string
        snapshotEventId:
          description: >-
            Newest durable canonical UUID event boundary frozen if evaluation
            starts now.
          format: uuid
          type: string
      required:
        - eligible
      type: object
      additionalProperties: false
    SessionFailure:
      description: >-
        Structured, sanitized reason a session terminated abnormally. Present on
        a session only after a terminal failure; healthy and legacy sessions
        omit it.
      properties:
        at:
          description: Time the terminal failure was persisted.
          format: date-time
          type: string
        category:
          description: >-
            Who can act on this failure: transient (wait or retry), caller_error
            (change the request or configuration, retrying as-is will not help),
            or internal (report it). retryable=false with category=caller_error
            is a fixable mistake, not an outage. A retryable failure is never
            caller_error: if the platform will retry, changing the request is
            not the fix.
          enum:
            - transient
            - caller_error
            - internal
          type: string
        code:
          description: Stable machine-readable failure code.
          type: string
        message:
          description: >-
            Sanitized bounded operator-facing message; never contains raw
            provider response bodies or credentials.
          type: string
        phase:
          description: >-
            Lifecycle phase that failed, such as provisioning, setup, workflow,
            or model.
          type: string
        retryable:
          description: >-
            Whether the platform will retry, or a retry of the same request may
            succeed on its own. False does not mean permanently broken -- read
            category to tell a transient condition from a request the caller
            must change.
          type: boolean
      required:
        - phase
        - code
        - message
        - retryable
        - category
        - at
      type: object
      additionalProperties: false
    StandaloneV2LatestEvaluation:
      properties:
        createdAt:
          description: UTC timestamp when the newest evaluation was recorded.
          format: date-time
          type: string
        evaluationId:
          description: Stable identity of the newest immutable evaluation for this session.
          format: uuid
          type: string
        result:
          description: Overall pass, fail, not-applicable, or could-not-evaluate verdict.
          type: string
      required:
        - evaluationId
        - result
        - createdAt
      type: object
      additionalProperties: false
    PlatformSafeJsonValue:
      description: >-
        A JSON value whose integer members stay within the exact ECMAScript
        safe-integer range at every nesting level.
      oneOf:
        - type: 'null'
        - type: boolean
        - type: string
        - type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        - type: number
          not:
            type: integer
        - type: array
          items:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
        - additionalProperties:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
          type: object
    SessionStatus:
      description: Coarse session state shared by Managed Agents and imported RL rollouts.
      enum:
        - active
        - awaiting_human
        - completed
        - failed
        - cancelled
      type: string
  headers:
    RecursionOrganizationId:
      description: Organization id resolved for this request.
      schema:
        minLength: 1
        type: string
    RecursionTenantId:
      description: Tenant id resolved for this request.
      schema:
        minLength: 1
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Recursion API key, created in the console under API keys.

````