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

# Simulate Dynamic Rules



## OpenAPI

````yaml POST /api/v1/custom/org/{organization_uuid}/dynamic_rules/simulate/
openapi: 3.0.3
info:
  title: TILT
  version: 0.0.1
servers: []
security: []
paths:
  /api/v1/custom/org/{organization_uuid}/dynamic_rules/simulate/:
    post:
      tags:
        - api
      operationId: api_v1_custom_org_dynamic_rules_simulate_create
      parameters:
        - in: path
          name: organization_uuid
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateRulesRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SimulateRulesRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SimulateRulesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateRulesResponse'
          description: ''
      security:
        - jwtAuth: []
        - ProAPIToken: []
components:
  schemas:
    SimulateRulesRequest:
      type: object
      properties:
        client_account_uuid:
          type: string
          format: uuid
        trade_date:
          type: string
          format: date
        dynamic_rules:
          type: array
          items:
            $ref: '#/components/schemas/SimulateRuleDynamicRule'
        evaluation_rules:
          type: array
          items:
            $ref: '#/components/schemas/EvaluationRuleWrite'
        evaluation_rule_source:
          allOf:
            - $ref: '#/components/schemas/EvaluationRuleSourceEnum'
          default: account_config
      required:
        - client_account_uuid
        - trade_date
    SimulateRulesResponse:
      type: object
      properties:
        resolved_values:
          type: object
          additionalProperties: {}
        context:
          type: object
          additionalProperties: {}
        rule_evaluations:
          type: object
          additionalProperties: {}
        evaluation_rules:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SimulatedEvaluationRule'
        evaluation_rule_errors:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SimulatedEvaluationRuleError'
        configured_evaluation_rule_types:
          type: array
          items:
            type: string
      required:
        - configured_evaluation_rule_types
        - context
        - evaluation_rule_errors
        - evaluation_rules
        - resolved_values
        - rule_evaluations
    SimulateRuleDynamicRule:
      type: object
      properties:
        field_name:
          type: string
        rules:
          type: array
          items:
            $ref: '#/components/schemas/SimulateRuleEntry'
      required:
        - field_name
        - rules
    EvaluationRuleWrite:
      type: object
      properties:
        rule_type:
          $ref: '#/components/schemas/LegacyEvaluationRuleTypeEnum'
        enabled:
          type: boolean
          default: true
        rules:
          type: array
          items:
            $ref: '#/components/schemas/EvaluationRuleEntry'
      required:
        - rule_type
        - rules
    EvaluationRuleSourceEnum:
      enum:
        - account_config
        - portfolio_config
        - organization_config
      type: string
      description: |-
        * `account_config` - account_config
        * `portfolio_config` - portfolio_config
        * `organization_config` - organization_config
    SimulatedEvaluationRule:
      type: object
      properties:
        value:
          type: object
          additionalProperties: {}
        source:
          $ref: '#/components/schemas/AdvisorDriftConfigSourceEnum'
        source_config_uuid:
          type: string
          format: uuid
        version:
          type: string
        matched_rule_index:
          type: integer
      required:
        - matched_rule_index
        - source
        - source_config_uuid
        - value
        - version
    SimulatedEvaluationRuleError:
      type: object
      properties:
        reason:
          type: string
        source:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/AdvisorDriftConfigSourceEnum'
            - $ref: '#/components/schemas/NullEnum'
        source_config_uuid:
          type: string
          format: uuid
          nullable: true
        version:
          type: string
          nullable: true
      required:
        - reason
        - source
        - source_config_uuid
        - version
    SimulateRuleEntry:
      type: object
      properties:
        cron:
          type: string
          default: ''
        condition:
          type: string
          default: ''
        starts_from:
          type: string
          format: date
          nullable: true
        expires_at:
          type: string
          format: date
          nullable: true
        value: {}
        priority:
          type: integer
          maximum: 9999
          minimum: 0
          default: 0
      required:
        - value
    LegacyEvaluationRuleTypeEnum:
      enum:
        - model_drift
        - sleeve_tracking_error
        - cash_band
      type: string
      description: |-
        * `model_drift` - model_drift
        * `sleeve_tracking_error` - sleeve_tracking_error
        * `cash_band` - cash_band
    EvaluationRuleEntry:
      type: object
      properties:
        cron:
          type: string
          default: ''
          description: Cron expression (e.g. '* * * 12 *' for December)
        condition:
          type: string
          default: ''
          description: Boolean expression (e.g. 'aum > 1000000')
          maxLength: 1000
        starts_from:
          type: string
          format: date
          nullable: true
          description: First trade date on which the rule can match (inclusive)
        expires_at:
          type: string
          format: date
          nullable: true
          description: Last trade date on which the rule can match (inclusive)
        value:
          description: Value to use when the rule matches
        priority:
          type: integer
          maximum: 9999
          minimum: 0
          default: 0
          description: Priority order (lowest number evaluated first, 0–9999)
      required:
        - value
    AdvisorDriftConfigSourceEnum:
      enum:
        - account_config
        - portfolio_config
        - organization_config
        - system_default
      type: string
      description: |-
        * `account_config` - Account Config
        * `portfolio_config` - Portfolio Config
        * `organization_config` - Organization Config
        * `system_default` - System Default
    NullEnum:
      enum:
        - null
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ProAPIToken:
      type: apiKey
      in: header
      name: X-Api-Key

````

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