{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-create-online-evaluation-config-request-schema.json",
  "title": "CreateOnlineEvaluationConfigRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-online-evaluation-configs-api-openapi.yml#/components/schemas/CreateOnlineEvaluationConfigRequest",
  "type": "object",
  "properties": {
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency."
    },
    "onlineEvaluationConfigName": {
      "type": "string",
      "description": "The name of the online evaluation configuration. Must be unique within your account."
    },
    "description": {
      "type": "string",
      "description": "The description of the online evaluation configuration that explains its monitoring purpose and scope."
    },
    "rule": {
      "$ref": "#/$defs/Rule"
    },
    "dataSourceConfig": {
      "$ref": "#/$defs/BedrockAgentcoreControlDataSourceConfig"
    },
    "evaluators": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvaluatorReference"
      },
      "description": "The list of evaluators to apply during online evaluation. Can include both built-in evaluators and custom evaluators created with CreateEvaluator."
    },
    "insights": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insight"
      },
      "description": "The list of insight types to run against agent sessions."
    },
    "clusteringConfig": {
      "$ref": "#/$defs/ClusteringConfig"
    },
    "outputConfig": {
      "$ref": "#/$defs/BedrockAgentcoreControlOutputConfig"
    },
    "evaluationExecutionRoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the IAM role that grants permissions to read from CloudWatch logs, write evaluation results, and invoke Amazon Bedrock models for evaluation. If the configuration references evaluators encrypted with a customer managed KMS key, this role must also have kms:Decrypt permission on the KMS key. The service validates this permission at configuration creation time. For more information, see Encryption at rest for AgentCore Evaluations."
    },
    "enableOnCreate": {
      "type": "boolean",
      "description": "Whether to enable the online evaluation configuration immediately upon creation. If true, evaluation begins automatically."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of tag keys and values to assign to an AgentCore Online Evaluation Config. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment."
    }
  },
  "required": [
    "onlineEvaluationConfigName",
    "rule",
    "dataSourceConfig",
    "evaluationExecutionRoleArn",
    "enableOnCreate"
  ],
  "$defs": {
    "BedrockAgentcoreControlCloudWatchOutputConfig": {
      "type": "object",
      "properties": {
        "logGroupName": {
          "type": "string",
          "description": "The name of the CloudWatch log group where evaluation results will be written. An existing log group is used as-is; otherwise the service creates it, which requires the evaluation execution role to grant logs:CreateLogGroup on the log group. Don't specify this value when resultDestination is SOURCE_LOG_GROUP. The name can't be under the service-reserved /aws/bedrock-agentcore/evaluations/ namespace, apart from this configuration's own service-managed default group."
        },
        "metricsNamespace": {
          "type": "string",
          "description": "The CloudWatch metrics namespace where evaluation result metrics are published. If you omit this value, the service publishes metrics to Bedrock-AgentCore/Evaluations. This value can't begin with AWS/."
        },
        "resultDestination": {
          "type": "string",
          "enum": [
            "DEDICATED_LOG_GROUP",
            "SOURCE_LOG_GROUP"
          ],
          "description": "The destination where evaluation results are written. Valid values: DEDICATED_LOG_GROUP (default) – Writes results to a dedicated result log group. SOURCE_LOG_GROUP – Writes results back to the log group that the agent traces were read from. If you use this value, don't specify logGroupName."
        }
      }
    },
    "BedrockAgentcoreControlDataSourceConfig": {
      "type": "object",
      "properties": {
        "cloudWatchLogs": {
          "$ref": "#/$defs/CloudWatchLogsInputConfig"
        }
      },
      "description": "Exactly one member is set."
    },
    "BedrockAgentcoreControlFilterValue": {
      "type": "object",
      "properties": {
        "stringValue": {
          "type": "string",
          "description": "The string value for text-based filtering."
        },
        "doubleValue": {
          "type": "number",
          "description": "The numeric value for numerical filtering and comparisons."
        },
        "booleanValue": {
          "type": "boolean",
          "description": "The boolean value for true/false filtering conditions."
        }
      },
      "description": "Exactly one member is set."
    },
    "BedrockAgentcoreControlOutputConfig": {
      "type": "object",
      "properties": {
        "cloudWatchConfig": {
          "$ref": "#/$defs/BedrockAgentcoreControlCloudWatchOutputConfig"
        }
      },
      "required": [
        "cloudWatchConfig"
      ]
    },
    "CloudWatchLogsInputConfig": {
      "type": "object",
      "properties": {
        "logGroupNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of CloudWatch log group names to monitor for agent traces."
        },
        "logGroupNamePrefixes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of CloudWatch log group name prefixes to monitor for agent traces. Specify this instead of logGroupNames to match log groups by prefix. Specify either logGroupNames or logGroupNamePrefixes, not both. One of the two is required."
        },
        "serviceNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of service names to filter traces within the specified log groups. Used to identify relevant agent sessions."
        }
      },
      "required": [
        "serviceNames"
      ]
    },
    "ClusteringConfig": {
      "type": "object",
      "properties": {
        "frequencies": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY"
            ]
          },
          "description": "The list of frequencies at which clustering batch evaluations are triggered."
        }
      },
      "required": [
        "frequencies"
      ]
    },
    "EvaluatorReference": {
      "type": "object",
      "properties": {
        "evaluatorId": {
          "type": "string",
          "description": "The unique identifier of the evaluator. Can reference builtin evaluators (e.g., Builtin.Helpfulness) or custom evaluators."
        }
      },
      "description": "Exactly one member is set."
    },
    "Filter": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The key or field name to filter on within the agent trace data."
        },
        "operator": {
          "type": "string",
          "enum": [
            "Equals",
            "NotEquals",
            "GreaterThan",
            "LessThan",
            "GreaterThanOrEqual",
            "LessThanOrEqual",
            "Contains",
            "NotContains"
          ],
          "description": "The comparison operator to use for filtering."
        },
        "value": {
          "$ref": "#/$defs/BedrockAgentcoreControlFilterValue"
        }
      },
      "required": [
        "key",
        "operator",
        "value"
      ]
    },
    "Insight": {
      "type": "object",
      "properties": {
        "insightId": {
          "type": "string",
          "description": "The unique identifier of the insight to run."
        }
      },
      "required": [
        "insightId"
      ]
    },
    "Rule": {
      "type": "object",
      "properties": {
        "samplingConfig": {
          "$ref": "#/$defs/SamplingConfig"
        },
        "filters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Filter"
          },
          "description": "The list of filters that determine which agent traces should be included in the evaluation based on trace properties."
        },
        "sessionConfig": {
          "$ref": "#/$defs/SessionConfig"
        }
      },
      "required": [
        "samplingConfig"
      ]
    },
    "SamplingConfig": {
      "type": "object",
      "properties": {
        "samplingPercentage": {
          "type": "number",
          "description": "The percentage of agent traces to sample for evaluation, ranging from 0.01% to 100%."
        }
      },
      "required": [
        "samplingPercentage"
      ]
    },
    "SessionConfig": {
      "type": "object",
      "properties": {
        "sessionTimeoutMinutes": {
          "type": "integer",
          "description": "The number of minutes of inactivity after which an agent session is considered complete and ready for evaluation. Default is 15 minutes."
        }
      },
      "required": [
        "sessionTimeoutMinutes"
      ]
    }
  }
}