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

# Test an AI filter on a sample message

> Asks the AI filter the given question about a sample message, its text and up to four screenshots, and returns the answer, every answer's probability, and whether the agent would wake. Nothing is saved and no run starts. The model call is billed to the organization like a filter evaluation on a real message.



## OpenAPI

````yaml /recursion/openapi.yaml post /managed-agents/v1/automation-classifier-tests
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/v1/automation-classifier-tests:
    post:
      tags:
        - Automations
      summary: Test an AI filter on a sample message
      description: >-
        Asks the AI filter the given question about a sample message, its text
        and up to four screenshots, and returns the answer, every answer's
        probability, and whether the agent would wake. Nothing is saved and no
        run starts. The model call is billed to the organization like a filter
        evaluation on a real message.
      operationId: managedAgentsRunAutomationClassifierTest
      parameters:
        - $ref: '#/components/parameters/RecursionTenantId'
        - $ref: '#/components/parameters/RecursionOrganizationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationClassifierTestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationClassifierTestResponse'
          description: What the AI filter decided for the sample message.
          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:
                $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'
        '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/ManagedAgentsApiErrorAutomationClassifierUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                discriminator:
                  propertyName: code
                  mapping:
                    automation_classifier_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorAutomationClassifierUnconfigured
                    managed_agents_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                    service_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                x-recursion-error-codes:
                  - automation_classifier_unconfigured
                  - managed_agents_unavailable
                  - service_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:
    AutomationClassifierTestRequest:
      additionalProperties: false
      description: >-
        An AI filter and a sample message to test it on. Nothing is saved and no
        run starts; the model call is billed like any other.
      properties:
        classifier:
          $ref: '#/components/schemas/AutomationSlackClassifier'
          description: The AI filter to test, as it would be saved on the trigger.
        message:
          $ref: '#/components/schemas/AutomationClassifierTestMessage'
          description: 'A sample message: its text and up to four screenshots.'
      required:
        - classifier
        - message
      type: object
    AutomationClassifierTestResponse:
      additionalProperties: false
      description: What the AI filter decided for the sample message.
      properties:
        decision:
          $ref: '#/components/schemas/AutomationDefinitionRunClassifierDecision'
          description: The filter's decision, as a run would record it.
        wouldWake:
          description: >-
            Whether this message would wake the agent with the filter saved as
            given. In preview mode the agent always wakes; this says what mode
            on would do.
          type: boolean
      required:
        - wouldWake
        - decision
      type: object
    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.
    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.
    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.
    ManagedAgentsApiErrorAutomationClassifierUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - automation_classifier_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.
    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.
    AutomationSlackClassifier:
      additionalProperties: false
      description: >-
        An AI filter: one question about each message, the answers it may give,
        and when it wakes the agent or skips the message.
      examples:
        - answers:
            - description: A problem, a question, or a request for action.
              value: active_issue
            - description: A status update or FYI with no ask.
              value: informational
          mode: preview
          question: Does this message report a problem or ask for help?
          rule:
            conditions:
              - answer: active_issue
                atLeastPercent: 80
            when: wake
          send: text_and_images
      properties:
        answers:
          description: The answers the model chooses between.
          items:
            $ref: '#/components/schemas/AutomationSlackClassifierAnswer'
          maxItems: 10
          minItems: 2
          type: array
        mode:
          description: >-
            preview evaluates every message and records what the filter would
            have done, but always wakes the agent; on applies the rule, waking
            the agent or skipping the message.
          enum:
            - preview
            - 'on'
          type: string
        question:
          description: The question the model answers about each message.
          maxLength: 1000
          minLength: 1
          type: string
        rule:
          $ref: '#/components/schemas/AutomationSlackClassifierRule'
          description: When the filter wakes the agent or skips the message.
        send:
          description: >-
            What the model sees: the message text with its PNG and JPEG
            attachments, or the text alone.
          enum:
            - text_and_images
            - text
          type: string
      required:
        - mode
        - question
        - answers
        - rule
        - send
      type: object
    AutomationClassifierTestMessage:
      additionalProperties: false
      description: A sample message as the filter would see it.
      properties:
        images:
          description: PNG or JPEG screenshots, at most four and 10 MiB together.
          items:
            $ref: '#/components/schemas/AutomationClassifierTestImage'
          maxItems: 4
          type: array
          x-recursion-omission:
            strategy: absent
        text:
          description: The message text, with any forwarded text appended.
          maxLength: 40000
          type: string
          x-recursion-omission:
            strategy: absent
      type: object
    AutomationDefinitionRunClassifierDecision:
      additionalProperties: false
      description: What a trigger's AI filter decided for one run.
      properties:
        answer:
          description: The most likely answer's value, when the model answered.
          type: string
        billedAmountNanos:
          description: >-
            Billed cost of the classifier call in nano-USD, as an exact base-10
            integer string.
          type: string
        decidedAt:
          description: Time the decision was made.
          format: date-time
          type: string
        imageCount:
          description: Images sent with the text.
          minimum: 0
          type: integer
          maximum: 9007199254740991
        inputTokens:
          description: Input tokens the provider reported.
          minimum: 0
          type: integer
          maximum: 9007199254740991
        latencyMs:
          description: Round trip to the model in milliseconds.
          format: int64
          minimum: 0
          type: integer
          maximum: 9007199254740991
        matchedAnswer:
          description: The answer of the condition that held, if one did.
          type: string
        mode:
          description: The filter mode the run was evaluated under.
          enum:
            - preview
            - 'on'
          type: string
        model:
          description: The model that answered.
          type: string
        outcome:
          description: >-
            skipped: the run was skipped. would_skip: preview mode; on would
            have skipped it. wake: a wake condition held, or no skip condition
            did. fail_open: the filter could not decide (error, refusal,
            timeout, unreadable content), so the agent woke.
          enum:
            - skipped
            - would_skip
            - wake
            - fail_open
          type: string
        probabilities:
          additionalProperties:
            format: double
            type: number
          description: Every answer's probability, by value.
          type: object
        reason:
          description: >-
            Bounded code explaining the outcome when no condition held or the
            filter could not decide, such as mentions_agent, below_threshold,
            timeout, refused or content_incomplete.
          type: string
        rule:
          $ref: '#/components/schemas/AutomationSlackClassifierRule'
          description: The rule the decision applied. Present when the model answered.
      required:
        - mode
        - outcome
        - imageCount
        - billedAmountNanos
        - decidedAt
      type: object
    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.
    AutomationSlackClassifierAnswer:
      additionalProperties: false
      description: One answer an AI filter may choose.
      properties:
        description:
          description: What this answer means, as the model reads it.
          maxLength: 500
          minLength: 1
          type: string
        value:
          description: Stable code for this answer, recorded on the run.
          pattern: ^[a-z0-9_]{1,32}$
          type: string
      required:
        - value
        - description
      type: object
    AutomationSlackClassifierRule:
      additionalProperties: false
      description: >-
        An AI filter's rule: wake the agent, or skip the message, when any
        condition holds.
      properties:
        conditions:
          description: >-
            The conditions, any one of which is enough. Each names a different
            answer.
          items:
            $ref: '#/components/schemas/AutomationSlackClassifierCondition'
          maxItems: 10
          minItems: 1
          type: array
        when:
          description: >-
            What the filter does when any condition holds. wake wakes the agent
            and skips the message otherwise, so a message no condition is sure
            about is skipped. skip skips the message and wakes the agent
            otherwise, so such a message wakes the agent.
          enum:
            - wake
            - skip
          type: string
      required:
        - when
        - conditions
      type: object
    AutomationClassifierTestImage:
      additionalProperties: false
      description: One screenshot of a sample message.
      properties:
        data:
          description: The image bytes, base64-encoded.
          minLength: 1
          type: string
        mediaType:
          description: The image format.
          enum:
            - image/png
            - image/jpeg
          type: string
      required:
        - mediaType
        - data
      type: object
    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
    AutomationSlackClassifierCondition:
      additionalProperties: false
      description: One condition of an AI filter's rule.
      properties:
        answer:
          description: The answer value the condition looks at.
          pattern: ^[a-z0-9_]{1,32}$
          type: string
        atLeastPercent:
          description: >-
            Holds when the model gives the answer at least this probability, in
            whole percent from 5 to 95.
          maximum: 95
          minimum: 5
          type: integer
      required:
        - answer
        - atLeastPercent
      type: object
  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.

````