---
title: "POST /v1/{+location}:generateUserScenarios"
method: POST
path: "/v1/{+location}:generateUserScenarios"
tags: ["projects"]
---

# POST /v1/{+location}:generateUserScenarios

`POST /v1/{+location}:generateUserScenarios`

Generates user scenarios for agent evaluation.

## Path parameters

- `location` string, required

## Request body

- GoogleCloudAiplatformV1GenerateUserScenariosRequest — Request message for DataFoundryService.GenerateUserScenarios.
  - `allowCrossRegionModel` boolean — Optional. Allows the scenario generation to use cross region models. When this flag is set, the service may route traffic to other regions if a model is unavailable in the current region (e.g., to a `global` endpoint). If a fully-qualified model endpoint resource name with a different region than the request location is provided elsewhere in the request, this flag must be set to true or the request will fail.
  - `agents` object — Optional. A map containing the static configurations for each agent in the system. Key: agent_id (matches the `author` field in events). Value: The static configuration of the agent. Required unless `gemini_agent_config` is set, in which case the agents map and `root_agent_id` are derived from the referenced Gemini Agent.
  - `userScenarioGenerationConfig` GoogleCloudAiplatformV1UserScenarioGenerationConfig — User scenario generation configuration.
    - `userScenarioCount` string, int64 — Required. The number of user scenarios to generate. The maximum number of scenarios that can be generated is 100.
    - `simulationInstruction` string — Optional. Simulation instruction to guide the user scenario generation.
    - `environmentData` string — Optional. Environment data in string type.
    - `modelName` string — Optional. The model name to use for generation. It can be model name, e.g. "gemini-3-pro-preview". or the fully qualified name of the publisher model or endpoint. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
  - `rootAgentId` string — Optional. The agent id to identify the root agent. Required unless `gemini_agent_config` is set, in which case it is derived from the referenced Gemini Agent.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/aiplatform.md) · [All operations](https://skmtc.net/google/apis/aiplatform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/aiplatform/versions/b608d71b91f0/schema)
