{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-start-batch-evaluation-request-schema.json",
  "title": "StartBatchEvaluationRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-evaluations-api-openapi.yml#/components/schemas/StartBatchEvaluationRequest",
  "type": "object",
  "properties": {
    "batchEvaluationName": {
      "type": "string",
      "description": "The name of the batch evaluation. Must be unique within your account."
    },
    "evaluators": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Evaluator"
      },
      "description": "The list of evaluators to apply during the batch evaluation. Can include both built-in evaluators and custom evaluators. Maximum of 10 evaluators."
    },
    "insights": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insight"
      },
      "description": "The list of insight analyses to run against sessions during the batch evaluation. Maximum of 10 insights."
    },
    "dataSourceConfig": {
      "$ref": "#/$defs/DataSourceConfig"
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error."
    },
    "evaluationMetadata": {
      "$ref": "#/$defs/EvaluationMetadata"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of tag keys and values to associate with the batch evaluation."
    },
    "kmsKeyArn": {
      "type": "string",
      "description": "The ARN of the KMS key used to encrypt evaluation data. If provided, customer data is encrypted at rest with the specified key."
    },
    "description": {
      "type": "string",
      "description": "The description of the batch evaluation."
    },
    "outputConfig": {
      "$ref": "#/$defs/BedrockAgentcoreOutputConfig"
    }
  },
  "required": [
    "batchEvaluationName",
    "dataSourceConfig"
  ],
  "$defs": {
    "BedrockAgentcoreOutputConfig": {
      "type": "object",
      "properties": {
        "cloudWatchConfig": {
          "$ref": "#/$defs/CloudWatchOutputConfig"
        }
      },
      "description": "Exactly one member is set."
    },
    "CloudWatchFilterConfig": {
      "type": "object",
      "properties": {
        "sessionIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of specific session IDs to evaluate. If specified, only these sessions are included in the evaluation."
        },
        "timeRange": {
          "$ref": "#/$defs/SessionFilterConfig"
        },
        "sessionTraceIds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SessionTraceIds"
          },
          "description": "A list of session and trace ID pairs that restrict evaluation to specific traces within a session. If specified, only the listed traces are evaluated instead of the entire session."
        }
      }
    },
    "CloudWatchLogsSource": {
      "type": "object",
      "properties": {
        "serviceNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of agent service names to filter traces within the specified log groups."
        },
        "logGroupNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of CloudWatch log group names to read agent traces from. Maximum of 10 log groups."
        },
        "logGroupNamePrefixes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of CloudWatch log group name prefixes to read agent traces from. Specify this instead of logGroupNames to match log groups by prefix. Maximum of 5 prefixes. Specify either logGroupNames or logGroupNamePrefixes, not both. One of the two is required."
        },
        "filterConfig": {
          "$ref": "#/$defs/CloudWatchFilterConfig"
        }
      },
      "required": [
        "serviceNames"
      ]
    },
    "CloudWatchOutputConfig": {
      "type": "object",
      "properties": {
        "logGroupName": {
          "type": "string",
          "description": "The name of the CloudWatch log group where evaluation results will be written. This value doesn't apply when resultDestination is SOURCE_LOG_GROUP, because results are written back to the trace source log group. The name can't be under the service-reserved /aws/bedrock-agentcore/evaluations/ namespace, apart from the service-managed default group."
        },
        "logStreamName": {
          "type": "string",
          "description": "The name of the CloudWatch log stream where evaluation results will be written."
        },
        "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."
        }
      }
    },
    "DataSourceConfig": {
      "type": "object",
      "properties": {
        "cloudWatchLogs": {
          "$ref": "#/$defs/CloudWatchLogsSource"
        },
        "onlineEvaluationConfigSource": {
          "$ref": "#/$defs/OnlineEvaluationConfigSource"
        }
      },
      "description": "Exactly one member is set."
    },
    "EvaluationContent": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "The text content of the ground truth data. Used for expected response text and assertion statements."
        }
      },
      "description": "Exactly one member is set."
    },
    "EvaluationExpectedTrajectory": {
      "type": "object",
      "properties": {
        "toolNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of tool names representing the expected tool call sequence."
        }
      }
    },
    "EvaluationMetadata": {
      "type": "object",
      "properties": {
        "sessionMetadata": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SessionMetadataShape"
          },
          "description": "A list of session metadata entries containing ground truth data and test scenario identifiers for specific sessions."
        }
      },
      "description": "Exactly one member is set."
    },
    "Evaluator": {
      "type": "object",
      "properties": {
        "evaluatorId": {
          "type": "string",
          "description": "The unique identifier of the evaluator. Can reference built-in evaluators (e.g., Builtin.Helpfulness) or custom evaluators."
        }
      },
      "required": [
        "evaluatorId"
      ]
    },
    "GroundTruthSource": {
      "type": "object",
      "properties": {
        "inline": {
          "$ref": "#/$defs/InlineGroundTruth"
        }
      },
      "description": "Exactly one member is set."
    },
    "GroundTruthTurn": {
      "type": "object",
      "properties": {
        "input": {
          "$ref": "#/$defs/GroundTruthTurnInput"
        },
        "expectedResponse": {
          "$ref": "#/$defs/EvaluationContent"
        }
      }
    },
    "GroundTruthTurnInput": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "The text prompt for this conversation turn."
        }
      },
      "description": "Exactly one member is set."
    },
    "InlineGroundTruth": {
      "type": "object",
      "properties": {
        "assertions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvaluationContent"
          },
          "description": "Assertions for evaluation, reuses common model EvaluationContentList."
        },
        "expectedTrajectory": {
          "$ref": "#/$defs/EvaluationExpectedTrajectory"
        },
        "turns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GroundTruthTurn"
          },
          "description": "A list of per-turn ground truth data, each containing an input prompt and expected response."
        }
      }
    },
    "Insight": {
      "type": "object",
      "properties": {
        "insightId": {
          "type": "string",
          "description": "The unique identifier of the insight to run."
        }
      },
      "required": [
        "insightId"
      ]
    },
    "OnlineEvaluationConfigSource": {
      "type": "object",
      "properties": {
        "onlineEvaluationConfigArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the online evaluation configuration to use as the session source."
        },
        "timeRange": {
          "$ref": "#/$defs/SessionFilterConfig"
        }
      },
      "required": [
        "onlineEvaluationConfigArn"
      ]
    },
    "SessionFilterConfig": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "The start time of the time range. Only sessions with activity at or after this timestamp are included."
        },
        "endTime": {
          "type": "string",
          "description": "The end time of the time range. Only sessions with activity before this timestamp are included."
        }
      }
    },
    "SessionMetadataShape": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "The unique identifier of the session this metadata applies to."
        },
        "testScenarioId": {
          "type": "string",
          "description": "An optional test scenario identifier for categorizing and tracking evaluation results."
        },
        "groundTruth": {
          "$ref": "#/$defs/GroundTruthSource"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Additional key-value metadata associated with this session."
        }
      },
      "required": [
        "sessionId"
      ]
    },
    "SessionTraceIds": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "The unique identifier of the session that contains the traces to evaluate."
        },
        "traceIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of trace IDs within the session to evaluate."
        }
      },
      "required": [
        "sessionId",
        "traceIds"
      ]
    }
  }
}