> ## Documentation Index
> Fetch the complete documentation index at: https://oma-codex-339-workspace-permissions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Events

> Send Events through the OMA API.

<Info>Every request requires `?beta=true`.</Info>


## OpenAPI

````yaml /openapi/oma.en.json post /v1/sessions/{session_id}/events
openapi: 3.1.0
info:
  title: OMA API Reference
  version: 1.0.0
  description: Open Managed Agents application API reference.
servers:
  - url: http://localhost:38080
    description: Local OMA server
security:
  - omaApiKey: []
  - omaBearer: []
paths:
  /v1/sessions/{session_id}/events:
    post:
      summary: Send Events
      operationId: BetaSendEvents
      parameters:
        - name: beta
          in: query
          required: true
          description: Selects the beta API contract for this endpoint. Must be `true`.
          schema:
            type: boolean
            enum:
              - true
        - name: anthropic-version
          in: header
          required: false
          schema:
            type: string
        - name: anthropic-beta
          in: header
          required: false
          schema:
            type: string
            items:
              type: string
            x-stainless-override-schema:
              x-stainless-param: betas
              x-stainless-extend-default: true
              type: array
              description: Optional header to specify the beta version(s) you want to use.
              items:
                $ref: '#/components/schemas/AnthropicBeta'
            x-default: managed-agents-2026-04-01
        - name: session_id
          in: path
          required: true
          schema:
            type: string
          description: Path parameter session_id
          example: sesn_011CZkZAtmR3yMPDzynEDxu7
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BetaManagedAgentsSendSessionEventsParams'
      responses:
        '200':
          description: Successful response (OK)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsSendSessionEvents'
        '400':
          description: Invalid argument - The client specified an invalid argument
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '401':
          description: >-
            Unauthenticated - The request does not have valid authentication
            credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '403':
          description: >-
            Permission denied - The caller does not have permission to execute
            the specified operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '404':
          description: Not found - Some requested entity was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '408':
          description: >-
            Deadline exceeded - The deadline expired before the operation could
            complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '409':
          description: Aborted - The operation was aborted due to concurrency issue
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '412':
          description: >-
            Failed precondition - Operation was rejected because the system is
            not in required state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '413':
          description: Out of range - Operation was attempted past the valid range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '429':
          description: >-
            Resource exhausted - Some resource has been exhausted (rate
            limiting)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '431':
          description: Request header fields too large - Request metadata was too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '499':
          description: Cancelled - The operation was cancelled by the client
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '500':
          description: Internal - Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '501':
          description: Unimplemented - The operation is not implemented or supported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '503':
          description: Unavailable - The service is currently unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '504':
          description: Deadline exceeded - Upstream service did not respond in time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
components:
  schemas:
    BetaManagedAgentsSendSessionEventsParams:
      description: Request parameters for sending events to a `session`.
      type: object
      additionalProperties: false
      required:
        - events
      properties:
        events:
          description: Events to send to the `session`.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsEventParams'
          examples:
            - - type: user.message
                content:
                  - type: text
                    text: 'Where is my order #1234?'
      example:
        events:
          - type: user.message
            content:
              - type: text
                text: 'Where is my order #1234?'
    BetaManagedAgentsSendSessionEvents:
      description: Events that were successfully sent to the session.
      type: object
      additionalProperties: false
      properties:
        data:
          description: Sent events
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsInputEvent'
    BetaErrorResponse:
      properties:
        error:
          discriminator:
            mapping:
              api_error:
                $ref: '#/components/schemas/BetaAPIError'
              authentication_error:
                $ref: '#/components/schemas/BetaAuthenticationError'
              billing_error:
                $ref: '#/components/schemas/BetaBillingError'
              invalid_request_error:
                $ref: '#/components/schemas/BetaInvalidRequestError'
              not_found_error:
                $ref: '#/components/schemas/BetaNotFoundError'
              overloaded_error:
                $ref: '#/components/schemas/BetaOverloadedError'
              permission_error:
                $ref: '#/components/schemas/BetaPermissionError'
              rate_limit_error:
                $ref: '#/components/schemas/BetaRateLimitError'
              timeout_error:
                $ref: '#/components/schemas/BetaGatewayTimeoutError'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaInvalidRequestError'
            - $ref: '#/components/schemas/BetaAuthenticationError'
            - $ref: '#/components/schemas/BetaBillingError'
            - $ref: '#/components/schemas/BetaPermissionError'
            - $ref: '#/components/schemas/BetaNotFoundError'
            - $ref: '#/components/schemas/BetaRateLimitError'
            - $ref: '#/components/schemas/BetaGatewayTimeoutError'
            - $ref: '#/components/schemas/BetaAPIError'
            - $ref: '#/components/schemas/BetaOverloadedError'
          title: Error
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        type:
          const: error
          default: error
          title: Type
          type: string
      required:
        - error
        - request_id
        - type
      title: ErrorResponse
      type: object
    BetaManagedAgentsEventParams:
      description: Union type for event parameters that can be sent to a session.
      type: object
      discriminator:
        propertyName: type
        mapping:
          user.message:
            $ref: '#/components/schemas/BetaManagedAgentsUserMessageEventParams'
          user.interrupt:
            $ref: '#/components/schemas/BetaManagedAgentsUserInterruptEventParams'
          user.tool_confirmation:
            $ref: >-
              #/components/schemas/BetaManagedAgentsUserToolConfirmationEventParams
          user.custom_tool_result:
            $ref: >-
              #/components/schemas/BetaManagedAgentsUserCustomToolResultEventParams
          user.define_outcome:
            $ref: '#/components/schemas/BetaManagedAgentsUserDefineOutcomeEventParams'
          user.tool_result:
            $ref: '#/components/schemas/BetaManagedAgentsUserToolResultEventParams'
          system.message:
            $ref: '#/components/schemas/BetaManagedAgentsSystemMessageEventParams'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsUserMessageEventParams'
        - $ref: '#/components/schemas/BetaManagedAgentsUserInterruptEventParams'
        - $ref: >-
            #/components/schemas/BetaManagedAgentsUserToolConfirmationEventParams
        - $ref: >-
            #/components/schemas/BetaManagedAgentsUserCustomToolResultEventParams
        - $ref: '#/components/schemas/BetaManagedAgentsUserDefineOutcomeEventParams'
        - $ref: '#/components/schemas/BetaManagedAgentsUserToolResultEventParams'
        - $ref: '#/components/schemas/BetaManagedAgentsSystemMessageEventParams'
    BetaManagedAgentsInputEvent:
      description: Union type for events that can be sent to a session.
      type: object
      discriminator:
        propertyName: type
        mapping:
          user.message:
            $ref: '#/components/schemas/BetaManagedAgentsUserMessageEvent'
          user.interrupt:
            $ref: '#/components/schemas/BetaManagedAgentsUserInterruptEvent'
          user.tool_confirmation:
            $ref: '#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent'
          user.custom_tool_result:
            $ref: '#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent'
          user.define_outcome:
            $ref: '#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent'
          user.tool_result:
            $ref: '#/components/schemas/BetaManagedAgentsUserToolResultEvent'
          system.message:
            $ref: '#/components/schemas/BetaManagedAgentsSystemMessageEvent'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsUserMessageEvent'
        - $ref: '#/components/schemas/BetaManagedAgentsUserInterruptEvent'
        - $ref: '#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent'
        - $ref: '#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent'
        - $ref: '#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent'
        - $ref: '#/components/schemas/BetaManagedAgentsUserToolResultEvent'
        - $ref: '#/components/schemas/BetaManagedAgentsSystemMessageEvent'
    BetaAPIError:
      properties:
        message:
          default: Internal server error
          title: Message
          type: string
        type:
          const: api_error
          default: api_error
          title: Type
          type: string
      required:
        - message
        - type
      title: APIError
      type: object
    BetaAuthenticationError:
      properties:
        message:
          default: Authentication error
          title: Message
          type: string
        type:
          const: authentication_error
          default: authentication_error
          title: Type
          type: string
      required:
        - message
        - type
      title: AuthenticationError
      type: object
    BetaBillingError:
      properties:
        message:
          default: Billing error
          title: Message
          type: string
        type:
          const: billing_error
          default: billing_error
          title: Type
          type: string
      required:
        - message
        - type
      title: BillingError
      type: object
    BetaInvalidRequestError:
      properties:
        message:
          default: Invalid request
          title: Message
          type: string
        type:
          const: invalid_request_error
          default: invalid_request_error
          title: Type
          type: string
      required:
        - message
        - type
      title: InvalidRequestError
      type: object
    BetaNotFoundError:
      properties:
        message:
          default: Not found
          title: Message
          type: string
        type:
          const: not_found_error
          default: not_found_error
          title: Type
          type: string
      required:
        - message
        - type
      title: NotFoundError
      type: object
    BetaOverloadedError:
      properties:
        message:
          default: Overloaded
          title: Message
          type: string
        type:
          const: overloaded_error
          default: overloaded_error
          title: Type
          type: string
      required:
        - message
        - type
      title: OverloadedError
      type: object
    BetaPermissionError:
      properties:
        message:
          default: Permission denied
          title: Message
          type: string
        type:
          const: permission_error
          default: permission_error
          title: Type
          type: string
      required:
        - message
        - type
      title: PermissionError
      type: object
    BetaRateLimitError:
      properties:
        message:
          default: Rate limited
          title: Message
          type: string
        type:
          const: rate_limit_error
          default: rate_limit_error
          title: Type
          type: string
      required:
        - message
        - type
      title: RateLimitError
      type: object
    BetaGatewayTimeoutError:
      properties:
        message:
          default: Request timeout
          title: Message
          type: string
        type:
          const: timeout_error
          default: timeout_error
          title: Type
          type: string
      required:
        - message
        - type
      title: GatewayTimeoutError
      type: object
    BetaManagedAgentsUserMessageEventParams:
      description: Parameters for sending a user message to the session.
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - user.message
          examples:
            - user.message
        content:
          description: Array of content blocks for the user message.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsUserContentBlock'
          examples:
            - - type: text
                text: 'Where is my order #1234?'
      example:
        type: user.message
        content:
          - type: text
            text: 'Where is my order #1234?'
    BetaManagedAgentsUserInterruptEventParams:
      description: Parameters for sending an interrupt to pause the agent.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - user.interrupt
        session_thread_id:
          description: >-
            If absent, interrupts every non-archived thread in a multiagent
            session (or the primary alone in a single-agent session). If
            present, interrupts only the named thread.
          type: string
          nullable: true
    BetaManagedAgentsUserToolConfirmationEventParams:
      description: Parameters for confirming or denying a tool execution request.
      type: object
      additionalProperties: false
      required:
        - type
        - tool_use_id
        - result
      properties:
        type:
          type: string
          enum:
            - user.tool_confirmation
        tool_use_id:
          description: >-
            The id of the `agent.tool_use` or `agent.mcp_tool_use` event this
            result corresponds to, which can be found in the last
            `session.status_idle` event's `stop_reason.event_ids` field.
          type: string
          minLength: 1
          maxLength: 128
        result:
          description: 'The confirmation result: ''allow'' or ''deny''.'
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsUserToolConfirmationResult'
        deny_message:
          description: >-
            Optional message providing context for a 'deny' decision. Only
            allowed when result is 'deny'.
          type: string
          maxLength: 10000
          nullable: true
    BetaManagedAgentsUserCustomToolResultEventParams:
      description: Parameters for providing the result of a custom tool execution.
      type: object
      additionalProperties: false
      required:
        - type
        - custom_tool_use_id
      properties:
        type:
          type: string
          enum:
            - user.custom_tool_result
        custom_tool_use_id:
          description: >-
            The id of the `agent.custom_tool_use` event this result corresponds
            to, which can be found in the last `session.status_idle` event's
            `stop_reason.event_ids` field.
          type: string
          minLength: 1
          maxLength: 128
        content:
          description: The result content returned by the tool.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsToolResultContentBlock'
        is_error:
          description: Whether the tool execution resulted in an error.
          type: boolean
          nullable: true
    BetaManagedAgentsUserDefineOutcomeEventParams:
      description: >-
        Parameters for defining an outcome the agent should work toward. The
        agent begins work on receipt.
      type: object
      additionalProperties: false
      required:
        - type
        - description
        - rubric
      properties:
        type:
          type: string
          enum:
            - user.define_outcome
          examples:
            - user.define_outcome
        description:
          description: What the agent should produce. This is the task specification.
          type: string
          examples:
            - Produce a 2-page summary as summary.md
        rubric:
          description: How to grade the outcome. Text or file reference.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsRubricParams'
          examples:
            - type: text
              content: Must cover all five sections; cite sources inline.
        max_iterations:
          description: Eval→revision cycles before giving up. Default 3, max 20.
          type: integer
          format: int32
          nullable: true
          examples:
            - 3
      example:
        type: user.define_outcome
        description: Produce a 2-page summary as summary.md
        rubric:
          type: text
          content: Must cover all five sections; cite sources inline.
        max_iterations: 3
    BetaManagedAgentsUserToolResultEventParams:
      description: >-
        Parameters for providing the result of an agent-toolset tool execution.
        Only valid on `self_hosted` environments, where sandbox-routed tools are
        executed by the client rather than the server.
      type: object
      additionalProperties: false
      required:
        - type
        - tool_use_id
      properties:
        type:
          type: string
          enum:
            - user.tool_result
        tool_use_id:
          description: >-
            The id of the `agent.tool_use` event this result corresponds to,
            which can be found in the last `session.status_idle` event's
            `stop_reason.event_ids` field.
          type: string
          minLength: 1
          maxLength: 128
        content:
          description: The result content returned by the tool.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsToolResultContentBlock'
        is_error:
          description: Whether the tool execution resulted in an error.
          type: boolean
          nullable: true
    BetaManagedAgentsSystemMessageEventParams:
      description: >-
        Privileged context for the accompanying turn and all subsequent turns,
        appended to the session's system context as a `role: "system"` turn
        rather than replacing the top-level system prompt. At most one per
        request: it must be the final event and immediately follow the
        `user.message`, `user.tool_result`, or `user.custom_tool_result` it
        accompanies. Only supported on models that accept mid-conversation
        system messages.
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - system.message
        content:
          description: System content blocks to append. Text-only.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSystemContentBlock'
    BetaManagedAgentsUserMessageEvent:
      description: A user message event in the session conversation.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - content
      properties:
        type:
          type: string
          enum:
            - user.message
          examples:
            - user.message
        id:
          description: Unique identifier for this event.
          type: string
          examples:
            - sevt_011CZkZGOp0iBcp4kaQSihUmy
        content:
          description: Array of content blocks comprising the user message.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsUserContentBlock'
          examples:
            - - type: text
                text: 'Where is my order #1234?'
        processed_at:
          description: Timestamp when the agent finished processing this message.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - '2026-03-15T10:00:00Z'
      example:
        type: user.message
        id: sevt_011CZkZGOp0iBcp4kaQSihUmy
        content:
          - type: text
            text: 'Where is my order #1234?'
        processed_at: '2026-03-15T10:00:00Z'
    BetaManagedAgentsUserInterruptEvent:
      description: >-
        An interrupt event that pauses agent execution and returns control to
        the user.
      type: object
      additionalProperties: false
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - user.interrupt
        id:
          description: Unique identifier for this event.
          type: string
        processed_at:
          description: Timestamp when the interrupt was processed.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
        session_thread_id:
          description: >-
            If absent, interrupts every non-archived thread in a multiagent
            session (or the primary alone in a single-agent session). If
            present, interrupts only the named thread.
          type: string
          nullable: true
    BetaManagedAgentsUserToolConfirmationEvent:
      description: >-
        A tool confirmation event that approves or denies a pending tool
        execution.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - tool_use_id
        - result
      properties:
        type:
          type: string
          enum:
            - user.tool_confirmation
        id:
          description: Unique identifier for this event.
          type: string
        tool_use_id:
          description: >-
            The id of the `agent.tool_use` or `agent.mcp_tool_use` event this
            result corresponds to, which can be found in the last
            `session.status_idle` event's `stop_reason.event_ids` field.
          type: string
        result:
          description: 'The confirmation result: ''allow'' or ''deny''.'
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsUserToolConfirmationResult'
        deny_message:
          description: >-
            Optional message providing context for a 'deny' decision. Only
            allowed when result is 'deny'.
          type: string
          maxLength: 10000
          nullable: true
        processed_at:
          description: Timestamp when the confirmation was processed.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
        session_thread_id:
          description: >-
            When set, the confirmation routes to this subagent's thread rather
            than the primary. Echo this from the `session_thread_id` on the
            `agent.tool_use` or `agent.mcp_tool_use` event that prompted the
            approval.
          type: string
          nullable: true
    BetaManagedAgentsUserCustomToolResultEvent:
      description: >-
        Event sent by the client providing the result of a custom tool
        execution.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - custom_tool_use_id
      properties:
        type:
          type: string
          enum:
            - user.custom_tool_result
        id:
          description: Unique identifier for this event.
          type: string
        custom_tool_use_id:
          description: >-
            The id of the `agent.custom_tool_use` event this result corresponds
            to, which can be found in the last `session.status_idle` event's
            `stop_reason.event_ids` field.
          type: string
        content:
          description: The result content returned by the tool.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsToolResultContentBlock'
        is_error:
          description: Whether the tool execution resulted in an error.
          type: boolean
          nullable: true
        processed_at:
          description: Timestamp when this result was processed.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
        session_thread_id:
          description: >-
            Routes this result to a subagent thread. Copy from the
            `agent.custom_tool_use` event's `session_thread_id`.
          type: string
          nullable: true
    BetaManagedAgentsUserDefineOutcomeEvent:
      description: >-
        Echo of a `user.define_outcome` input event. Carries the
        server-generated `outcome_id` that subsequent
        `span.outcome_evaluation_*` events reference.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - processed_at
        - outcome_id
        - description
        - max_iterations
        - rubric
      properties:
        type:
          type: string
          enum:
            - user.define_outcome
          examples:
            - user.define_outcome
        id:
          description: Unique identifier for this event.
          type: string
          examples:
            - sevt_011CZkZSTx3lFgt7odUWmkyq
        processed_at:
          description: Timestamp when the outcome was accepted.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:02:14Z'
        outcome_id:
          description: >-
            Server-generated `outc_` ID for this outcome. Referenced by
            `span.outcome_evaluation_*` events and the session's
            `outcome_evaluations` list.
          type: string
          examples:
            - outc_011CZkZRSw2kEfs6ncTVljxP
        description:
          description: What the agent should produce. Copied from the input event.
          type: string
          examples:
            - Produce a 2-page summary as summary.md
        max_iterations:
          description: Evaluate-then-revise cycles before giving up. Default 3, max 20.
          type: integer
          format: int32
          nullable: true
          examples:
            - 3
        rubric:
          description: >-
            How to grade the outcome. File rubrics are currently resolved to
            their text content; clients should handle both variants.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsRubric'
          examples:
            - type: text
              content: Must cover all five sections; cite sources inline.
      example:
        type: user.define_outcome
        id: sevt_011CZkZSTx3lFgt7odUWmkyq
        processed_at: '2026-03-15T10:02:14Z'
        outcome_id: outc_011CZkZRSw2kEfs6ncTVljxP
        description: Produce a 2-page summary as summary.md
        max_iterations: 3
        rubric:
          type: text
          content: Must cover all five sections; cite sources inline.
    BetaManagedAgentsUserToolResultEvent:
      description: >-
        Event sent by the client providing the result of an agent-toolset tool
        execution. Only valid on `self_hosted` environments, where
        sandbox-routed tools are executed by the client rather than the server.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - tool_use_id
      properties:
        type:
          type: string
          enum:
            - user.tool_result
        id:
          description: Unique identifier for this event.
          type: string
        tool_use_id:
          description: >-
            The id of the `agent.tool_use` event this result corresponds to,
            which can be found in the last `session.status_idle` event's
            `stop_reason.event_ids` field.
          type: string
        content:
          description: The result content returned by the tool.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsToolResultContentBlock'
        is_error:
          description: Whether the tool execution resulted in an error.
          type: boolean
          nullable: true
        processed_at:
          description: Timestamp when this result was processed.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
        session_thread_id:
          description: >-
            Routes this result to a subagent thread. Copy from the
            `agent.tool_use` event's `session_thread_id`.
          type: string
          nullable: true
    BetaManagedAgentsSystemMessageEvent:
      description: >-
        A mid-conversation system message event. Carries system-role content
        that is appended to the session as a `role: "system"` turn.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - content
      properties:
        type:
          type: string
          enum:
            - system.message
        id:
          description: Unique identifier for this event.
          type: string
        content:
          description: System content blocks. Text-only.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSystemContentBlock'
        processed_at:
          description: Timestamp when this system message was processed.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
    BetaManagedAgentsUserContentBlock:
      description: Content block in a user message. Can be `text`, `image`, or `document`.
      type: object
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
          image:
            $ref: '#/components/schemas/BetaManagedAgentsImageBlock'
          document:
            $ref: '#/components/schemas/BetaManagedAgentsDocumentBlock'
          redacted:
            $ref: '#/components/schemas/BetaManagedAgentsRedactedBlock'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsImageBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsDocumentBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsRedactedBlock'
    BetaManagedAgentsUserToolConfirmationResult:
      type: string
      description: UserToolConfirmationResult enum
      enum:
        - allow
        - deny
    BetaManagedAgentsToolResultContentBlock:
      description: >-
        Content block in a tool result. Can be `text`, `image`, `document`, or
        `search_result`.
      type: object
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
          image:
            $ref: '#/components/schemas/BetaManagedAgentsImageBlock'
          document:
            $ref: '#/components/schemas/BetaManagedAgentsDocumentBlock'
          search_result:
            $ref: '#/components/schemas/BetaManagedAgentsSearchResultBlock'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsImageBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsDocumentBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsSearchResultBlock'
    BetaManagedAgentsRubricParams:
      description: Rubric for grading the quality of an outcome.
      discriminator:
        propertyName: type
        mapping:
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileRubricParams'
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextRubricParams'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsFileRubricParams'
        - $ref: '#/components/schemas/BetaManagedAgentsTextRubricParams'
    BetaManagedAgentsSystemContentBlock:
      description: Content block in a mid-conversation system message. Text-only.
      type: object
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
    BetaTimestamp:
      description: A timestamp in RFC 3339 format
      type: string
      format: date-time
    BetaManagedAgentsRubric:
      description: Rubric for grading the quality of an outcome.
      discriminator:
        propertyName: type
        mapping:
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileRubric'
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextRubric'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsFileRubric'
        - $ref: '#/components/schemas/BetaManagedAgentsTextRubric'
    BetaManagedAgentsTextBlock:
      description: Regular text content.
      type: object
      additionalProperties: false
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          examples:
            - text
        text:
          description: The text content.
          type: string
          minLength: 1
          examples:
            - 'Where is my order #1234?'
      example:
        type: text
        text: 'Where is my order #1234?'
    BetaManagedAgentsImageBlock:
      description: >-
        Image content specified directly as base64 data or as a reference via a
        URL.
      type: object
      additionalProperties: false
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - image
        source:
          description: The source of the image data.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsImageSource'
    BetaManagedAgentsDocumentBlock:
      description: >-
        Document content, either specified directly as base64 data, as text, or
        as a reference via a URL.
      type: object
      additionalProperties: false
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - document
        source:
          description: The source of the document data.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsDocumentSource'
        title:
          description: The title of the document.
          type: string
          nullable: true
        context:
          description: Additional context about the document for the model.
          type: string
          nullable: true
    BetaManagedAgentsRedactedBlock:
      description: Placeholder for content withheld by OMA model policy.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - redacted
    BetaManagedAgentsSearchResultBlock:
      description: A block containing a web search result.
      type: object
      additionalProperties: false
      required:
        - type
        - source
        - title
        - content
        - citations
      properties:
        type:
          type: string
          enum:
            - search_result
        source:
          description: The URL source of the search result.
          type: string
          minLength: 1
        title:
          description: The title of the search result.
          type: string
          minLength: 1
        content:
          description: Array of text content blocks from the search result.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSearchResultContent'
        citations:
          description: Citation settings for this search result.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSearchResultCitations'
    BetaManagedAgentsFileRubricParams:
      description: Rubric referenced by a file uploaded via the Files API.
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
          examples:
            - file
        file_id:
          description: ID of the rubric file.
          type: string
          examples:
            - file_011CNha8iCJcU1wXNR6q4V8w
      example:
        type: file
        file_id: file_011CNha8iCJcU1wXNR6q4V8w
    BetaManagedAgentsTextRubricParams:
      description: Rubric content provided inline as text.
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - text
          examples:
            - text
        content:
          description: >-
            Rubric content. Plain text or markdown — the grader treats it as
            freeform text. Maximum 262144 characters.
          type: string
          maxLength: 262144
          examples:
            - Must cover all five sections; cite sources inline.
      example:
        type: text
        content: Must cover all five sections; cite sources inline.
    BetaManagedAgentsFileRubric:
      description: Rubric referenced by a file uploaded via the Files API.
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: ID of the rubric file.
          type: string
    BetaManagedAgentsTextRubric:
      description: Rubric content provided inline as text.
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - text
        content:
          description: >-
            Rubric content. Plain text or markdown — the grader treats it as
            freeform text.
          type: string
    BetaManagedAgentsImageSource:
      description: Union type for image source variants.
      type: object
      discriminator:
        propertyName: type
        mapping:
          base64:
            $ref: '#/components/schemas/BetaManagedAgentsBase64ImageSource'
          url:
            $ref: '#/components/schemas/BetaManagedAgentsURLImageSource'
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileImageSource'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBase64ImageSource'
        - $ref: '#/components/schemas/BetaManagedAgentsURLImageSource'
        - $ref: '#/components/schemas/BetaManagedAgentsFileImageSource'
    BetaManagedAgentsDocumentSource:
      description: Union type for document source variants.
      type: object
      discriminator:
        propertyName: type
        mapping:
          base64:
            $ref: '#/components/schemas/BetaManagedAgentsBase64DocumentSource'
          text:
            $ref: '#/components/schemas/BetaManagedAgentsPlainTextDocumentSource'
          url:
            $ref: '#/components/schemas/BetaManagedAgentsURLDocumentSource'
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileDocumentSource'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBase64DocumentSource'
        - $ref: '#/components/schemas/BetaManagedAgentsPlainTextDocumentSource'
        - $ref: '#/components/schemas/BetaManagedAgentsURLDocumentSource'
        - $ref: '#/components/schemas/BetaManagedAgentsFileDocumentSource'
    BetaManagedAgentsSearchResultContent:
      description: Text content within a search result.
      type: object
      additionalProperties: false
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
        text:
          description: The text content.
          type: string
          minLength: 1
    BetaManagedAgentsSearchResultCitations:
      description: Citation settings for a search result.
      type: object
      additionalProperties: false
      required:
        - enabled
      properties:
        enabled:
          description: Whether citations are enabled for this search result.
          type: boolean
    BetaManagedAgentsBase64ImageSource:
      description: Base64-encoded image data.
      type: object
      additionalProperties: false
      required:
        - type
        - media_type
        - data
      properties:
        type:
          type: string
          enum:
            - base64
        media_type:
          description: >-
            MIME type of the image (e.g., "image/png", "image/jpeg",
            "image/gif", "image/webp").
          type: string
          minLength: 1
        data:
          description: Base64-encoded image data.
          type: string
          minLength: 1
    BetaManagedAgentsURLImageSource:
      description: Image referenced by URL.
      type: object
      additionalProperties: false
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - url
        url:
          description: URL of the image to fetch.
          type: string
          minLength: 1
    BetaManagedAgentsFileImageSource:
      description: Image referenced by file ID.
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: ID of a previously uploaded file.
          type: string
          minLength: 1
    BetaManagedAgentsBase64DocumentSource:
      description: Base64-encoded document data.
      type: object
      additionalProperties: false
      required:
        - type
        - media_type
        - data
      properties:
        type:
          type: string
          enum:
            - base64
        media_type:
          description: MIME type of the document (e.g., "application/pdf").
          type: string
          minLength: 1
        data:
          description: Base64-encoded document data.
          type: string
          minLength: 1
    BetaManagedAgentsPlainTextDocumentSource:
      description: Plain text document content.
      type: object
      additionalProperties: false
      required:
        - type
        - media_type
        - data
      properties:
        type:
          type: string
          enum:
            - text
        media_type:
          description: MIME type of the text content. Must be "text/plain".
          type: string
          enum:
            - text/plain
        data:
          description: The plain text content.
          type: string
          minLength: 1
    BetaManagedAgentsURLDocumentSource:
      description: Document referenced by URL.
      type: object
      additionalProperties: false
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - url
        url:
          description: URL of the document to fetch.
          type: string
          minLength: 1
    BetaManagedAgentsFileDocumentSource:
      description: Document referenced by file ID.
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: ID of a previously uploaded file.
          type: string
          minLength: 1
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA workspace API key.
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: OMA workspace API key sent as a bearer token.

````