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

# Interrupt a session and send a replacement instruction

> Stops active work and durably accepts a replacement instruction in one ordered operation. The session starts a fresh turn automatically. A session started before replacement instructions were available still honors the interrupt and keeps the replacement for its next resume. When the tenant is out of credit it returns 403 session_start_not_admitted with details.reason out_of_credit and changes nothing, and a suspended tenant gets the same 403 with details.reason tenant_suspended; managedAgentsInterruptSession still stops the session.



## OpenAPI

````yaml /recursion/openapi.yaml post /managed-agents/v1/sessions/{sessionId}/interrupt-and-send
openapi: 3.1.0
info:
  title: Managed Agents API
  version: 0.14.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/v1/sessions/{sessionId}/interrupt-and-send:
    post:
      tags:
        - Sessions
      summary: Interrupt a session and send a replacement instruction
      description: >-
        Stops active work and durably accepts a replacement instruction in one
        ordered operation. The session starts a fresh turn automatically. A
        session started before replacement instructions were available still
        honors the interrupt and keeps the replacement for its next resume. When
        the tenant is out of credit it returns 403 session_start_not_admitted
        with details.reason out_of_credit and changes nothing, and a suspended
        tenant gets the same 403 with details.reason tenant_suspended;
        managedAgentsInterruptSession still stops the session.
      operationId: managedAgentsInterruptAndSendSessionMessage
      parameters:
        - description: >-
            Session id (UUID) as returned by managedAgentsStartSession or
            managedAgentsListSessions.
          in: path
          name: sessionId
          required: true
          schema:
            description: >-
              Session id (UUID) as returned by managedAgentsStartSession or
              managedAgentsListSessions.
            format: uuid
            type: string
        - $ref: '#/components/parameters/RecursionTenantId'
        - $ref: '#/components/parameters/RecursionOrganizationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InterruptAndSendRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsAcceptedResponse'
          description: >-
            Shared response body of POST
            /managed-agents/v1/sessions/{sessionId}/events and POST
            /managed-agents/v1/sessions/{sessionId}/interrupt-and-send. It
            acknowledges durable acceptance of the turn, never the agent's
            reply: read the reply by listing events or streaming. Compare
            events_accepted against what was sent to detect silently dropped
            entries, and read delivery_state to learn whether an agent is
            actually going to act on them. events_accepted counts canonical
            events rather than requests, so interrupt-and-send reports 2 for its
            single instruction: the stop and the message that follows it.
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidJson'
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                discriminator:
                  propertyName: code
                  mapping:
                    invalid_json: '#/components/schemas/ManagedAgentsApiErrorInvalidJson'
                    invalid_request: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                x-recursion-error-codes:
                  - invalid_json
                  - 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:
                oneOf:
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorForbidden'
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartNotAdmitted
                discriminator:
                  propertyName: code
                  mapping:
                    forbidden: '#/components/schemas/ManagedAgentsApiErrorForbidden'
                    session_start_not_admitted: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartNotAdmitted
                x-recursion-error-codes:
                  - forbidden
                  - session_start_not_admitted
          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'
        '409':
          description: Conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorConflict'
                x-recursion-error-codes:
                  - conflict
          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'
        '415':
          description: Unsupported Media Type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnsupportedMediaType'
                x-recursion-error-codes:
                  - unsupported_media_type
          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':
          description: Service Unavailable.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorContentStoreUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorContentStoreUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorFileStorageUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorPersistenceBusy'
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartAdmissionUnavailable
                discriminator:
                  propertyName: code
                  mapping:
                    content_store_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorContentStoreUnavailable
                    content_store_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorContentStoreUnconfigured
                    file_storage_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorFileStorageUnconfigured
                    managed_agents_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                    persistence_busy: '#/components/schemas/ManagedAgentsApiErrorPersistenceBusy'
                    service_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                    session_start_admission_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartAdmissionUnavailable
                x-recursion-error-codes:
                  - content_store_unavailable
                  - content_store_unconfigured
                  - file_storage_unconfigured
                  - managed_agents_unavailable
                  - persistence_busy
                  - service_unavailable
                  - session_start_admission_unavailable
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '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:
        type: string
        minLength: 1
    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:
        type: string
        minLength: 1
  schemas:
    InterruptAndSendRequest:
      description: >-
        Request body for interrupting the active operation and starting a fresh
        turn with one replacement instruction.
      properties:
        content:
          description: >-
            Provider-shaped replacement instruction blocks, passed through
            verbatim, except that a top-level image or document block may name a
            file from the organization's catalog with source {type: file,
            file_id}, resolved exactly as on managedAgentsSendSessionEvents; a
            refusal names the block as content[j]. Takes precedence over
            message.
          items:
            $ref: '#/components/schemas/ContentBlockRequest'
          type:
            - array
            - 'null'
        message:
          description: >-
            Replacement instruction for the fresh turn. Ignored when content is
            present; otherwise required, and refused with 400 when empty or only
            whitespace.
          type: string
        referenced_session_ids:
          description: >-
            Prior sessions this session may read from the fresh turn on, by
            session id, added to any it already has. Authorized and recorded
            before the interrupt is signaled, so redirecting the agent at an
            earlier run is one request rather than two.
          items:
            type: string
          maxItems: 10
          type: array
      type: object
      additionalProperties: false
    EventsAcceptedResponse:
      description: >-
        Shared response body of POST
        /managed-agents/v1/sessions/{sessionId}/events and POST
        /managed-agents/v1/sessions/{sessionId}/interrupt-and-send. It
        acknowledges durable acceptance of the turn, never the agent's reply:
        read the reply by listing events or streaming. Compare events_accepted
        against what was sent to detect silently dropped entries, and read
        delivery_state to learn whether an agent is actually going to act on
        them. events_accepted counts canonical events rather than requests, so
        interrupt-and-send reports 2 for its single instruction: the stop and
        the message that follows it.
      properties:
        delivery_state:
          description: >-
            How the accepted events reached a reader. queued: the agent was
            mid-turn, so the input is waiting outside the transcript and the
            next turn boundary will read it; interrupt to bring that forward.
            signaled: the running session was woken and will act on them.
            resumed: the session had already finished, so it resumed to act on
            them. stored: appended to the timeline with nothing running to act
            on them yet.
          enum:
            - stored
            - signaled
            - resumed
            - queued
          type: string
        events_accepted:
          description: >-
            How many canonical events were written or queued. This counts the
            inputs actually derived from the body, not its length: a plain
            message body yields 1, and a typed user.message with no content is
            dropped, so this can be lower than the events array sent.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        ok:
          description: >-
            Always true. Every event in the request was durably accepted; any
            partial or total failure is an HTTP error instead, so this field
            never reports false.
          type: boolean
      required:
        - ok
        - delivery_state
        - events_accepted
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorInvalidJson:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - invalid_json
        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.
    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.
    ManagedAgentsApiErrorSessionStartNotAdmitted:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - session_start_not_admitted
        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.
    ManagedAgentsApiErrorConflict:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - conflict
        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.
    ManagedAgentsApiErrorUnsupportedMediaType:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unsupported_media_type
        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.
    ManagedAgentsApiErrorContentStoreUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - content_store_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.
    ManagedAgentsApiErrorContentStoreUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - content_store_unconfigured
        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.
    ManagedAgentsApiErrorFileStorageUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - file_storage_unconfigured
        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.
    ManagedAgentsApiErrorPersistenceBusy:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - persistence_busy
        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.
    ManagedAgentsApiErrorSessionStartAdmissionUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - session_start_admission_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.
    ContentBlockRequest:
      description: >-
        One caller-supplied message content block. Nested content and summary
        blocks cannot carry file sources or document blocks.
      properties:
        byte_size:
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        content:
          items:
            $ref: '#/components/schemas/NestedContentBlockRequest'
          type: array
        context:
          type: string
        data:
          type: string
        encrypted_content:
          type: string
        height:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        id:
          type: string
        input:
          additionalProperties:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
          type: object
        is_error:
          type: boolean
        media_type:
          type: string
        name:
          type: string
        omitted_bytes:
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        payload:
          $ref: '#/components/schemas/PlatformSafeJsonValue'
        provider:
          type: string
        provider_payload:
          $ref: '#/components/schemas/PlatformSafeJsonValue'
        redacted:
          type: boolean
        semantic_hint:
          type: string
        sha256:
          type: string
        signature:
          type: string
        source:
          $ref: '#/components/schemas/ContentBlockSource'
        summary:
          items:
            $ref: '#/components/schemas/NestedContentBlockRequest'
          type: array
        text:
          type: string
        title:
          type: string
        tool_use_id:
          type: string
        type:
          type: string
        uri:
          type: string
        width:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      type: object
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: document
            required:
              - type
          then:
            required:
              - source
        - if:
            required:
              - source
          then:
            properties:
              type:
                enum:
                  - text
                  - image
                  - document
            required:
              - type
    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.
    NestedContentBlockRequest:
      description: >-
        One nested caller-supplied message content block. File sources, document
        blocks, and read-time signed URLs are not accepted when nested.
      properties:
        byte_size:
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        content:
          items:
            $ref: '#/components/schemas/NestedContentBlockRequest'
          type: array
        context:
          type: string
        data:
          type: string
        encrypted_content:
          type: string
        height:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        id:
          type: string
        input:
          additionalProperties:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
          type: object
        is_error:
          type: boolean
        media_type:
          type: string
        name:
          type: string
        omitted_bytes:
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        payload:
          $ref: '#/components/schemas/PlatformSafeJsonValue'
        provider:
          type: string
        provider_payload:
          $ref: '#/components/schemas/PlatformSafeJsonValue'
        redacted:
          type: boolean
        semantic_hint:
          type: string
        sha256:
          type: string
        signature:
          type: string
        summary:
          items:
            $ref: '#/components/schemas/NestedContentBlockRequest'
          type: array
        text:
          type: string
        title:
          type: string
        tool_use_id:
          type: string
        type:
          type: string
          not:
            const: document
          description: >-
            Nested block type. Document blocks are only accepted at the message
            root.
        uri:
          type: string
        width:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      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
    ContentBlockSource:
      description: >-
        Where a user-sent image or document block takes its bytes from when the
        caller names a file instead of carrying them: a file from the
        organization's catalog, read and copied into the session when the
        message is accepted, so the block the transcript keeps names both the
        source and the copy.
      properties:
        file_id:
          type: string
          minLength: 1
          description: Nonempty id of an unexpired file in the caller's organization.
        type:
          type: string
          const: file
          description: Always file.
      required:
        - type
        - file_id
      type: object
      additionalProperties: false
  headers:
    RecursionOrganizationId:
      description: Organization id resolved for this request.
      schema:
        type: string
        minLength: 1
    RecursionTenantId:
      description: Tenant id resolved for this request.
      schema:
        type: string
        minLength: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Recursion API key, created in the console under API keys.

````