---
title: "POST /recommendations"
method: POST
path: "/recommendations"
---

# POST /recommendations

`POST /recommendations`

Starts a recommendation job that analyzes agent traces and generates optimization suggestions for system prompts or tool descriptions to improve agent performance.

## Request body

- object
  - `name` string, required — The name of the recommendation. Must be unique within your account.
  - `description` string — The description of the recommendation.
  - `type` 'SYSTEM_PROMPT_RECOMMENDATION' | 'TOOL_DESCRIPTION_RECOMMENDATION', required — The type of recommendation to generate.
  - `recommendationConfig` object, required — The configuration for a recommendation, varying by recommendation type.
    - `systemPromptRecommendationConfig` object — The configuration for a system prompt recommendation.
      - `systemPrompt` object, required — The current system prompt to optimize.
        - `text` string, password — The system prompt text provided inline.
        - `configurationBundle` object — The system prompt sourced from a configuration bundle version.
          - `bundleArn` string, required — The Amazon Resource Name (ARN) of the configuration bundle.
          - `versionId` string, required — The version identifier of the configuration bundle.
          - `systemPromptJsonPath` string, required — The JSON path within the configuration bundle that contains the system prompt.
      - `agentTraces` object, required — The agent traces to analyze for generating recommendations.
        - `sessionSpans` Span[] — Agent traces provided as inline session spans in OpenTelemetry format.
        - `cloudwatchLogs` object — Agent traces read from CloudWatch Logs.
          - `logGroupArns` String[], required — The list of CloudWatch log group ARNs to read agent traces from.
          - `serviceNames` ServiceName[], required — The list of service names to filter traces within the specified log groups.
          - `startTime` string, date-time, required — The start time of the time range to read traces from.
          - `endTime` string, date-time, required — The end time of the time range to read traces from.
          - `rule` object — Optional rule configuration for filtering traces.
            - `filters` CloudWatchLogsFilter[] — The list of filters to apply when reading agent traces.
              - …
        - `batchEvaluation` object — Use a completed batch evaluation as the source of agent traces.
          - `batchEvaluationArn` string, required — The ARN of the completed batch evaluation to use as the trace source.
      - `evaluationConfig` object — The evaluation configuration specifying which evaluator to use for assessing recommendation quality.
        - `evaluators` RecommendationEvaluatorReference[], required — The list of evaluators to use for assessing recommendation quality.
          - `evaluatorArn` string, required — The Amazon Resource Name (ARN) of the evaluator.
    - `toolDescriptionRecommendationConfig` object — The configuration for a tool description recommendation.
      - `toolDescription` object, required — The current tool descriptions to optimize.
        - `toolDescriptionText` object — Tool descriptions provided as inline text.
          - `tools` ToolDescriptionInput[], required — The list of tool descriptions to optimize.
            - `toolName` string, required — The name of the tool.
            - `toolDescription` object, required — The current description of the tool to optimize.
              - …
        - `configurationBundle` object — Tool descriptions sourced from a configuration bundle version.
          - `bundleArn` string, required — The Amazon Resource Name (ARN) of the configuration bundle.
          - `versionId` string, required — The version identifier of the configuration bundle.
          - `tools` ConfigurationBundleToolEntry[], required — The list of tool entries mapping tool names to their JSON paths within the bundle.
            - `toolName` string, required — The name of the tool.
            - `toolDescriptionJsonPath` string, required — The JSON path within the configuration bundle's components that contains the tool description.
      - `agentTraces` object, required — The agent traces to analyze for generating tool description recommendations.
        - `sessionSpans` Span[] — Agent traces provided as inline session spans in OpenTelemetry format.
        - `cloudwatchLogs` object — Agent traces read from CloudWatch Logs.
          - `logGroupArns` String[], required — The list of CloudWatch log group ARNs to read agent traces from.
          - `serviceNames` ServiceName[], required — The list of service names to filter traces within the specified log groups.
          - `startTime` string, date-time, required — The start time of the time range to read traces from.
          - `endTime` string, date-time, required — The end time of the time range to read traces from.
          - `rule` object — Optional rule configuration for filtering traces.
            - `filters` CloudWatchLogsFilter[] — The list of filters to apply when reading agent traces.
              - …
        - `batchEvaluation` object — Use a completed batch evaluation as the source of agent traces.
          - `batchEvaluationArn` string, required — The ARN of the completed batch evaluation to use as the trace source.
  - `kmsKeyArn` string — The ARN of the KMS key used to encrypt recommendation data. If provided, customer data is encrypted at rest with the specified key.
  - `clientToken` string — 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.
  - `tags` object — A map of tag keys and values to associate with the recommendation.

## Response `202`

Success

- StartRecommendationResponse
  - `recommendationId` string, required — The unique identifier of the created recommendation.
  - `recommendationArn` string, required — The Amazon Resource Name (ARN) of the created recommendation.
  - `name` string, required — The name of the recommendation.
  - `description` string — The description of the recommendation.
  - `type` 'SYSTEM_PROMPT_RECOMMENDATION' | 'TOOL_DESCRIPTION_RECOMMENDATION', required — The type of recommendation.
  - `recommendationConfig` object, required — The configuration for the recommendation.
    - `systemPromptRecommendationConfig` object — The configuration for a system prompt recommendation.
      - `systemPrompt` object, required — The current system prompt to optimize.
        - `text` string, password — The system prompt text provided inline.
        - `configurationBundle` object — The system prompt sourced from a configuration bundle version.
          - `bundleArn` string, required — The Amazon Resource Name (ARN) of the configuration bundle.
          - `versionId` string, required — The version identifier of the configuration bundle.
          - `systemPromptJsonPath` string, required — The JSON path within the configuration bundle that contains the system prompt.
      - `agentTraces` object, required — The agent traces to analyze for generating recommendations.
        - `sessionSpans` Span[] — Agent traces provided as inline session spans in OpenTelemetry format.
        - `cloudwatchLogs` object — Agent traces read from CloudWatch Logs.
          - `logGroupArns` String[], required — The list of CloudWatch log group ARNs to read agent traces from.
          - `serviceNames` ServiceName[], required — The list of service names to filter traces within the specified log groups.
          - `startTime` string, date-time, required — The start time of the time range to read traces from.
          - `endTime` string, date-time, required — The end time of the time range to read traces from.
          - `rule` object — Optional rule configuration for filtering traces.
            - `filters` CloudWatchLogsFilter[] — The list of filters to apply when reading agent traces.
              - …
        - `batchEvaluation` object — Use a completed batch evaluation as the source of agent traces.
          - `batchEvaluationArn` string, required — The ARN of the completed batch evaluation to use as the trace source.
      - `evaluationConfig` object — The evaluation configuration specifying which evaluator to use for assessing recommendation quality.
        - `evaluators` RecommendationEvaluatorReference[], required — The list of evaluators to use for assessing recommendation quality.
          - `evaluatorArn` string, required — The Amazon Resource Name (ARN) of the evaluator.
    - `toolDescriptionRecommendationConfig` object — The configuration for a tool description recommendation.
      - `toolDescription` object, required — The current tool descriptions to optimize.
        - `toolDescriptionText` object — Tool descriptions provided as inline text.
          - `tools` ToolDescriptionInput[], required — The list of tool descriptions to optimize.
            - `toolName` string, required — The name of the tool.
            - `toolDescription` object, required — The current description of the tool to optimize.
              - …
        - `configurationBundle` object — Tool descriptions sourced from a configuration bundle version.
          - `bundleArn` string, required — The Amazon Resource Name (ARN) of the configuration bundle.
          - `versionId` string, required — The version identifier of the configuration bundle.
          - `tools` ConfigurationBundleToolEntry[], required — The list of tool entries mapping tool names to their JSON paths within the bundle.
            - `toolName` string, required — The name of the tool.
            - `toolDescriptionJsonPath` string, required — The JSON path within the configuration bundle's components that contains the tool description.
      - `agentTraces` object, required — The agent traces to analyze for generating tool description recommendations.
        - `sessionSpans` Span[] — Agent traces provided as inline session spans in OpenTelemetry format.
        - `cloudwatchLogs` object — Agent traces read from CloudWatch Logs.
          - `logGroupArns` String[], required — The list of CloudWatch log group ARNs to read agent traces from.
          - `serviceNames` ServiceName[], required — The list of service names to filter traces within the specified log groups.
          - `startTime` string, date-time, required — The start time of the time range to read traces from.
          - `endTime` string, date-time, required — The end time of the time range to read traces from.
          - `rule` object — Optional rule configuration for filtering traces.
            - `filters` CloudWatchLogsFilter[] — The list of filters to apply when reading agent traces.
              - …
        - `batchEvaluation` object — Use a completed batch evaluation as the source of agent traces.
          - `batchEvaluationArn` string, required — The ARN of the completed batch evaluation to use as the trace source.
  - `status` 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'DELETING', required — The status of the recommendation.
  - `createdAt` string, date-time, required — The timestamp when the recommendation was created.
  - `updatedAt` string, date-time, required — The timestamp when the recommendation was last updated.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — AccessDeniedException
- `482` — ConflictException
- `483` — ValidationException
- `484` — ThrottlingException
- `485` — InternalServerException

---

[API](https://skmtc.net/aws/apis/bedrock-agentcore.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agentcore/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agentcore/versions/79623b33d495/schema)
