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

# Validate a decision file

> Checks a decision file (`{decision_id?, structure, objective?}`) and returns its structure hash, every question's hash, the canonical text the hash is the SHA-256 of, and warnings, without registering anything: free (no model call), public (needs no API key), and safe to run in CI on every change. An invalid file is a 400 whose `details.issues` lists every issue, each with its `param`, as `registerDecision` would answer; so is an objective naming an outcome the structure can't produce. `decision_id` is optional and only checked against the id pattern. Warnings never depend on an environment or a model; `UNUSED_FEATURE` names a question, attribute or aggregation the result never reaches. Key order, Unicode normalization (NFC) of instructions, criteria and attribute sources, the order of `reads` and of aggregation `inputs`, and defaults spelled out (`invert: false`, `gte: 0.5`, empty `criteria`) do not change the hashes. Read paths, string attribute labels and label comparisons stay exact, since customer content is not normalized.



## OpenAPI

````yaml /openapi.json post /v1/validate
openapi: 3.1.0
info:
  title: Moonbounce Decisions API
  version: 0.0.0
  description: >-
    Moonbounce decisions: evaluate an item's state against a decision structure
    (System One questions, attributes you supply and aggregations over both),
    record feedback and import labeled examples, review a ranked queue, and
    improve the structure through suggestions that ship as code diffs, each with
    a preview (backtest) and an evidence label.


    **Authentication.** Send an API key as `Authorization: Bearer <key>` on
    every operation except `GET /health` and `POST /v1/validate`. Call the API
    from a server, never a browser: a key must not reach one, and the API sends
    no CORS headers. A key belongs to one organization and one environment:
    production, or test for a key with the `env:test` permission. Test traffic
    never counts as production traffic.


    **Requests.** JSON bodies (`Content-Type: application/json`) of at most 1
    MB, parsed strictly: duplicate keys, lone surrogates, integers outside
    ±(2^53 - 1), `__proto__` keys, U+0000 and nesting deeper than 64 are a 400.


    **Retries.** Send an `Idempotency-Key` on every POST under /v1 that takes
    one (all but `POST /v1/validate` and `POST /v1/review/items/fill`, whose
    retry is another fill within the day's budget). Keep it for the request's
    retries. The same key with the same request returns the first stored result,
    marked `Idempotent-Replayed: true`, for 24 hours (410 if that result was
    since deleted); with another request it is 422 IDEMPOTENCY_KEY_REUSED. Keys
    are scoped to the organization and environment across every operation, so
    use a fresh key per request. A request that failed before its result was
    stored runs again when retried. 429 and 503 under /v1 may carry
    `Retry-After` (seconds); a daily QUOTA_EXCEEDED cap instead names its reset
    time.


    **Errors.** Every error under /v1 is `{"error": {"type", "message",
    "reason"?, "param"?, "details"?}}` (ErrorBody); `GET /health` answers its
    own shape. Every response carries a `Request-Id` header. Rate limits apply
    per key, and per client IP for requests without a valid key; a 429
    RATE_LIMITED carries `Retry-After`.
servers:
  - url: https://api.moonbounce.ai
    description: Production
security: []
paths:
  /v1/validate:
    post:
      tags:
        - decisions
      summary: Validate a decision file
      description: >-
        Checks a decision file (`{decision_id?, structure, objective?}`) and
        returns its structure hash, every question's hash, the canonical text
        the hash is the SHA-256 of, and warnings, without registering anything:
        free (no model call), public (needs no API key), and safe to run in CI
        on every change. An invalid file is a 400 whose `details.issues` lists
        every issue, each with its `param`, as `registerDecision` would answer;
        so is an objective naming an outcome the structure can't produce.
        `decision_id` is optional and only checked against the id pattern.
        Warnings never depend on an environment or a model; `UNUSED_FEATURE`
        names a question, attribute or aggregation the result never reaches. Key
        order, Unicode normalization (NFC) of instructions, criteria and
        attribute sources, the order of `reads` and of aggregation `inputs`, and
        defaults spelled out (`invert: false`, `gte: 0.5`, empty `criteria`) do
        not change the hashes. Read paths, string attribute labels and label
        comparisons stay exact, since customer content is not normalized.
      operationId: validateDecision
      requestBody:
        required: true
        content:
          application/json:
            examples:
              decision_file:
                summary: The decision file, as CI checks it before registering
                value:
                  decision_id: refund-exception
                  structure:
                    questions:
                      item_used:
                        type: noul
                        instructions: >-
                          Has the customer used the item beyond trying it on or
                          setting it up once?
                        reads:
                          - state.message
                      defective:
                        type: noul
                        instructions: >-
                          Does the customer describe a defect, damage on
                          arrival, or the item failing under normal use?
                        reads:
                          - state.message
                    attributes:
                      days_since_delivery:
                        type: number
                        minimum: 0
                    aggregations:
                      grant_score:
                        type: weighted_mean
                        inputs:
                          - name: questions.item_used
                            invert: true
                          - name: questions.defective
                      handling:
                        type: rules
                        rules:
                          - when:
                              name: attributes.days_since_delivery
                              gt: 30
                            outcome: escalate
                          - when:
                              name: aggregations.grant_score
                              gte: 0.72
                            outcome: grant
                          - when:
                              name: aggregations.grant_score
                              lt: 0.38
                            outcome: deny
                        else: escalate
                    result: aggregations.handling
                  objective:
                    fallback: escalate
                    mistakes:
                      - expected: deny
                        got: grant
                        severity: costly
            schema:
              $ref: '#/components/schemas/ValidateRequest'
      responses:
        '200':
          description: The file is valid
          content:
            application/json:
              examples:
                valid:
                  summary: Valid, with nothing unused
                  value:
                    structure_hash: >-
                      sha256:bdad6e5b1b879209305f1555b43ec62666a4d74a925280c66e54cc4dc07bb1ae
                    question_hashes:
                      item_used: >-
                        sha256:2cd936709034818c3beca2574ca48ef400577728a20532924ed68f1ca1f26e3d
                      defective: >-
                        sha256:8dd4a69d6bfaf9fa766adcac7cfa1c4af7eff57a690a1e39666398bf85cd1869
                    canonical: >-
                      {"aggregations":{"grant_score":{"inputs":[{"invert":true,"name":"questions.item_used"},{"name":"questions.defective"}],"type":"weighted_mean"},"handling":{"else":"escalate","rules":[{"outcome":"escalate","when":{"gt":30,"name":"attributes.days_since_delivery"}},{"outcome":"grant","when":{"gte":0.72,"name":"aggregations.grant_score"}},{"outcome":"deny","when":{"lt":0.38,"name":"aggregations.grant_score"}}],"type":"rules"}},"attributes":{"days_since_delivery":{"minimum":0,"type":"number"}},"format":"moonbounce.structure/1","questions":{"defective":{"instructions":"Does
                      the customer describe a defect, damage on arrival, or the
                      item failing under normal
                      use?","reads":["state.message"],"type":"noul"},"item_used":{"instructions":"Has
                      the customer used the item beyond trying it on or setting
                      it up
                      once?","reads":["state.message"],"type":"noul"}},"result":"aggregations.handling"}
                    warnings: []
              schema:
                $ref: '#/components/schemas/ValidateResponse'
        '400':
          description: 'Invalid request: `param` names the field at fault when one applies'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '413':
          description: The HTTP body exceeds 1 MB (reason BODY_TOO_LARGE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: >-
            RATE_LIMITED: retry after Retry-After seconds; QUOTA_EXCEEDED:
            details.reset_at gives the daily reset time (no Retry-After)
          headers:
            Retry-After:
              schema:
                type: string
                description: Seconds to wait before retrying, when waiting helps.
              required: false
              description: Seconds to wait before retrying, when waiting helps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security: []
components:
  schemas:
    ValidateRequest:
      type: object
      properties:
        decision_id:
          $ref: '#/components/schemas/DecisionId'
        structure:
          $ref: '#/components/schemas/DecisionStructure'
        objective:
          anyOf:
            - $ref: '#/components/schemas/Objective'
            - type: 'null'
          description: >-
            What the decision optimizes for, as the decision file holds it. Its
            outcomes must be ones `structure` can produce. Never part of the
            structure hash.
      required:
        - structure
      additionalProperties: false
      description: >-
        A decision file to check. `decision_id` is optional and only checked
        against the id pattern.
    ValidateResponse:
      type: object
      properties:
        structure_hash:
          $ref: '#/components/schemas/StructureHashOutput'
        question_hashes:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/QuestionHash'
          description: >-
            Each question, by name, mapped to its hash (its definition without
            its name). A question's hash is what feedback about it is stored
            against.
        canonical:
          type: string
          description: >-
            The exact text whose SHA-256 is `structure_hash`: the structure's
            canonical form in RFC 8785 (JCS) JSON.
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/ValidateWarning'
          description: >-
            Things that are valid but probably not meant. They never depend on
            an environment or a model.
      required:
        - structure_hash
        - question_hashes
        - canonical
        - warnings
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    ErrorBody:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/ErrorType'
            reason:
              type: string
              pattern: ^[A-Z][A-Z0-9_]+$
              description: >-
                Set where a caller can act on it, one of the reasons in the
                ErrorReason schema. New reasons may be added: treat an unknown
                one by the status and `type`.
            message:
              type: string
              description: For people; don't parse it.
            param:
              type: string
              description: >-
                The request field at fault, as a dotted path
                (`attribute_values.region`, `claims.1.value`).
            details:
              type: object
              properties:
                issues:
                  type: array
                  items:
                    $ref: '#/components/schemas/ErrorIssue'
              additionalProperties: {}
          required:
            - type
            - message
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
      required:
        - error
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    DecisionId:
      type: string
      pattern: ^[a-z][a-z0-9_.-]{0,127}$
      description: >-
        A name you choose for this decision, such as `refund-exception`: a
        lowercase letter, then up to 127 of `a-z 0-9 _ . -`. Unique in your
        organization and shared by its test and production keys. The first
        registration or evaluation under a new one creates the decision.
    DecisionStructure:
      type: object
      properties:
        questions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Question'
          description: System One questions, keyed by name.
        attributes:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Attribute'
          description: >-
            Values your app supplies with each call in `attribute_values`. The
            model never sees them.
        aggregations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Aggregation'
        result:
          type: string
          minLength: 1
          maxLength: 80
          description: The final feature's path, such as `aggregations.band`.
          examples:
            - questions.asks_for_refund
            - aggregations.band
      required:
        - questions
        - result
      additionalProperties: false
      description: >-
        Everything that defines a decision: questions, attribute declarations,
        aggregations and the result. Names are unique across all three maps.
    Objective:
      type: object
      properties:
        fallback:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            The safe outcome. Sending a case there when it belonged elsewhere is
            `minor`, unless that mistake is listed.
        mistakes:
          type: array
          items:
            $ref: '#/components/schemas/ObjectiveMistake'
          maxItems: 400
        target:
          type: object
          properties:
            max_loss_per_case:
              type: number
              minimum: 0
              description: A reference loss per case the owner would be content with.
          required:
            - max_loss_per_case
          additionalProperties: false
          description: >-
            Optional, a soft reference point: reports say whether loss per case
            is at or below it (`target_met`). The refine loop stops when the
            owner decides, not on the target.
        outcome:
          type: string
          minLength: 1
          maxLength: 200
          description: 'With `priority`: the outcome the two-outcome shortcut is about.'
        priority:
          type: string
          enum:
            - catch_all
            - be_sure
            - balanced
          description: >-
            With `outcome`, the shortcut: `catch_all` makes missing `outcome`
            costly and a false alarm normal, `be_sure` the reverse, `balanced`
            both normal. A listed mistake overrides the shortcut's entry for it.
      additionalProperties: false
      description: >-
        What a decision optimizes for: which mistakes matter and how much, and
        when it is good enough. Scores weigh each expected outcome equally
        however often it occurs among the cases, so a dataset's mix doesn't
        change them; severities set the loss of each mistake within that. No
        objective means every mistake is `normal`.
    StructureHashOutput:
      type: string
      pattern: ^sha256:[0-9a-f]{64}$
    QuestionHash:
      type: string
      pattern: ^sha256:[0-9a-f]{64}$
    ValidateWarning:
      type: object
      properties:
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]+$
          description: >-
            Stable, extensible warning code. `UNUSED_FEATURE`: the result never
            reaches this question, attribute or aggregation, so it changes the
            hash but never the outcome.
        param:
          type: string
          description: >-
            The field the warning is about, such as
            `structure.questions.item_used`.
        message:
          type: string
      required:
        - code
        - param
        - message
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    ErrorType:
      type: string
      enum:
        - invalid_request
        - authentication
        - permission_denied
        - not_found
        - conflict
        - rate_limited
        - engine_failed
        - unavailable
        - internal
    ErrorIssue:
      type: object
      properties:
        param:
          type: string
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]+$
          description: >-
            Stable, extensible issue code; unknown codes still have a parameter
            and human-readable message.
        message:
          type: string
      required:
        - param
        - code
        - message
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    Question:
      oneOf:
        - $ref: '#/components/schemas/NoulQuestion'
      discriminator:
        propertyName: type
        mapping:
          noul: '#/components/schemas/NoulQuestion'
    Attribute:
      oneOf:
        - $ref: '#/components/schemas/StringAttribute'
        - $ref: '#/components/schemas/NumberAttribute'
        - $ref: '#/components/schemas/BooleanAttribute'
      discriminator:
        propertyName: type
        mapping:
          string: '#/components/schemas/StringAttribute'
          number: '#/components/schemas/NumberAttribute'
          boolean: '#/components/schemas/BooleanAttribute'
    Aggregation:
      oneOf:
        - $ref: '#/components/schemas/WeightedMean'
        - $ref: '#/components/schemas/Logistic'
        - $ref: '#/components/schemas/Min'
        - $ref: '#/components/schemas/Max'
        - $ref: '#/components/schemas/Product'
        - $ref: '#/components/schemas/NoisyOr'
        - $ref: '#/components/schemas/All'
        - $ref: '#/components/schemas/Any'
        - $ref: '#/components/schemas/Bands'
        - $ref: '#/components/schemas/Rules'
        - $ref: '#/components/schemas/Match'
      discriminator:
        propertyName: type
        mapping:
          weighted_mean: '#/components/schemas/WeightedMean'
          logistic: '#/components/schemas/Logistic'
          min: '#/components/schemas/Min'
          max: '#/components/schemas/Max'
          product: '#/components/schemas/Product'
          noisy_or: '#/components/schemas/NoisyOr'
          all: '#/components/schemas/All'
          any: '#/components/schemas/Any'
          bands: '#/components/schemas/Bands'
          rules: '#/components/schemas/Rules'
          match: '#/components/schemas/Match'
    ObjectiveMistake:
      anyOf:
        - type: object
          properties:
            expected:
              type: string
              minLength: 1
              maxLength: 200
              description: The outcome the case should have had.
            got:
              type: string
              minLength: 1
              maxLength: 200
              description: The outcome the decision gave instead.
            severity:
              $ref: '#/components/schemas/Severity'
          required:
            - expected
            - got
            - severity
          additionalProperties: false
        - type: object
          properties:
            expected:
              type: string
              minLength: 1
              maxLength: 200
              description: The outcome the case should have had.
            got:
              type: string
              minLength: 1
              maxLength: 200
              description: The outcome the decision gave instead.
            loss:
              type: number
              minimum: 0
              maximum: 1000000
              description: >-
                A direct loss in place of a severity. At least 10 counts as
                severe.
          required:
            - expected
            - got
            - loss
          additionalProperties: false
      description: >-
        One mistake that matters, by severity or by a direct loss. A mistake
        that isn't listed is `normal`.
    NoulQuestion:
      type: object
      properties:
        type:
          type: string
          enum:
            - noul
        instructions:
          $ref: '#/components/schemas/Instructions'
        criteria:
          type: object
          properties:
            'true':
              type: string
              minLength: 1
              maxLength: 4000
            'false':
              type: string
              minLength: 1
              maxLength: 4000
          additionalProperties: false
        reads:
          type: array
          items:
            $ref: '#/components/schemas/StatePath'
          minItems: 1
          maxItems: 64
          description: >-
            Paths into an object `state` this question reads, such as
            `state.message` or `state.order.customer.tier`. The question sees
            just those values, nested as in the state. Without it the question
            sees the whole state, as in System One. Every path must exist in the
            call's `state`; no entry may repeat or contain another.
      required:
        - type
        - instructions
      additionalProperties: false
      description: P(true) for a statement about the state.
    StringAttribute:
      type: object
      properties:
        type:
          type: string
          enum:
            - string
        enum:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 200
          minItems: 1
          maxItems: 255
        default:
          type: string
        source:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            The model and version behind this attribute, such as
            `toxicity-classifier-v3`. Hashed.
      required:
        - type
        - enum
      additionalProperties: false
    NumberAttribute:
      type: object
      properties:
        type:
          type: string
          enum:
            - number
        minimum:
          type: number
        maximum:
          type: number
        default:
          type: number
        source:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            The model and version behind this attribute, such as
            `toxicity-classifier-v3`. Hashed.
      required:
        - type
      additionalProperties: false
    BooleanAttribute:
      type: object
      properties:
        type:
          type: string
          enum:
            - boolean
        default:
          type: boolean
        source:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            The model and version behind this attribute, such as
            `toxicity-classifier-v3`. Hashed.
      required:
        - type
      additionalProperties: false
    WeightedMean:
      type: object
      properties:
        type:
          type: string
          enum:
            - weighted_mean
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              weight:
                type: number
                exclusiveMinimum: 0
              invert:
                type: boolean
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: 'Σ wᵢ·xᵢ / Σ wᵢ: a weighted average from 0 to 1, not a probability.'
    Logistic:
      type: object
      properties:
        type:
          type: string
          enum:
            - logistic
        bias:
          type: number
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              weight:
                type: number
            required:
              - name
              - weight
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - bias
        - inputs
      additionalProperties: false
      description: σ(bias + Σ wᵢ·xᵢ), with signed weights on raw input values.
    Min:
      type: object
      properties:
        type:
          type: string
          enum:
            - min
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              invert:
                type: boolean
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: 'min xᵢ: all of these, when they overlap.'
    Max:
      type: object
      properties:
        type:
          type: string
          enum:
            - max
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              invert:
                type: boolean
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: 'max xᵢ: any of these, when they overlap.'
    Product:
      type: object
      properties:
        type:
          type: string
          enum:
            - product
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              invert:
                type: boolean
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: 'Π xᵢ: all of these, when they are independent.'
    NoisyOr:
      type: object
      properties:
        type:
          type: string
          enum:
            - noisy_or
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              invert:
                type: boolean
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: '1 − Π(1 − xᵢ): any of these, when they are independent.'
    All:
      type: object
      properties:
        type:
          type: string
          enum:
            - all
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              gte:
                type: number
              gt:
                type: number
              lte:
                type: number
              lt:
                type: number
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: 1 when every input passes its threshold (default ≥ 0.5), else 0.
    Any:
      type: object
      properties:
        type:
          type: string
          enum:
            - any
        inputs:
          type: array
          items:
            type: object
            properties:
              name:
                $ref: '#/components/schemas/FeatureRef'
              gte:
                type: number
              gt:
                type: number
              lte:
                type: number
              lt:
                type: number
            required:
              - name
            additionalProperties: false
          minItems: 1
          maxItems: 64
      required:
        - type
        - inputs
      additionalProperties: false
      description: 1 when any input passes its threshold (default ≥ 0.5), else 0.
    Bands:
      type: object
      properties:
        type:
          type: string
          enum:
            - bands
        input:
          $ref: '#/components/schemas/FeatureRef'
        below:
          $ref: '#/components/schemas/Name'
        cuts:
          type: array
          items:
            type: object
            properties:
              at:
                type: number
              outcome:
                $ref: '#/components/schemas/Name'
            required:
              - at
              - outcome
            additionalProperties: false
          minItems: 1
          maxItems: 9
        abstain:
          $ref: '#/components/schemas/Name'
      required:
        - type
        - input
        - below
        - cuts
      additionalProperties: false
      description: >-
        Names an outcome for each range of one feature's value. `at` means ≥;
        `below` is under the first cut.
    Rules:
      type: object
      properties:
        type:
          type: string
          enum:
            - rules
        rules:
          type: array
          items:
            type: object
            properties:
              when:
                $ref: '#/components/schemas/Condition'
              outcome:
                $ref: '#/components/schemas/Name'
            required:
              - when
              - outcome
            additionalProperties: false
          minItems: 1
          maxItems: 64
        else:
          $ref: '#/components/schemas/Name'
      required:
        - type
        - rules
        - else
      additionalProperties: false
      description: >-
        The first rule whose condition is true names its `outcome`; otherwise
        `else`.
    Match:
      type: object
      properties:
        type:
          type: string
          enum:
            - match
        input:
          $ref: '#/components/schemas/FeatureRef'
        cases:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Name'
          description: >-
            Maps labels to outcomes. "__proto__" is not supported as a case key;
            use a rules is-condition for that label.
        else:
          $ref: '#/components/schemas/Name'
        abstain:
          $ref: '#/components/schemas/Name'
      required:
        - type
        - input
        - cases
      additionalProperties: false
      description: Maps a label straight to an outcome.
    Severity:
      type: string
      enum:
        - minor
        - normal
        - costly
        - severe
      description: >-
        How bad a mistake is: `minor` weighs 0.5, `normal` 1, `costly` 3 and
        `severe` 10.
    Instructions:
      anyOf:
        - type: string
          minLength: 1
          maxLength: 4000
        - type: object
          additionalProperties: {}
        - type: array
          items: {}
          minItems: 1
    StatePath:
      type: string
      minLength: 1
      maxLength: 256
      description: >-
        `state.<key>` or a nested object path such as
        `state.order.customer.tier`: keys of an object `state`. A key has no
        `.`, `[` or `]`. Array indexes are not supported yet.
      examples:
        - state.message
        - state.order.order_total_usd
    FeatureRef:
      type: string
      minLength: 1
      maxLength: 80
      description: >-
        A feature's path: `questions.<name>`, `attributes.<name>` or
        `aggregations.<name>`.
      examples:
        - questions.asks_for_refund
        - aggregations.band
    Name:
      type: string
      pattern: ^[a-z][a-z0-9_]{0,63}$
    Condition:
      anyOf:
        - type: object
          properties:
            name:
              $ref: '#/components/schemas/FeatureRef'
            gte:
              type: number
            gt:
              type: number
            lte:
              type: number
            lt:
              type: number
            is:
              type: string
              minLength: 1
              maxLength: 200
            in:
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 200
              minItems: 1
              maxItems: 255
            abstained:
              type: boolean
              enum:
                - true
          required:
            - name
          additionalProperties: false
        - type: object
          properties:
            all:
              type: array
              items:
                $ref: '#/components/schemas/Condition'
              minItems: 1
              maxItems: 64
          required:
            - all
          additionalProperties: false
        - type: object
          properties:
            any:
              type: array
              items:
                $ref: '#/components/schemas/Condition'
              minItems: 1
              maxItems: 64
          required:
            - any
          additionalProperties: false
        - type: object
          properties:
            not:
              $ref: '#/components/schemas/Condition'
          required:
            - not
          additionalProperties: false

````

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