---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}:generateUserScenarios"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}:generateUserScenarios"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}:generateUserScenarios

`POST /v1/projects/{projectsId}/locations/{locationsId}:generateUserScenarios`

## Request

- Base URL: `https://aiplatform.googleapis.com`
- URL: `https://aiplatform.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}:generateUserScenarios`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/aiplatform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/aiplatform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Generates user scenarios for agent evaluation.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Request body

- GoogleCloudAiplatformV1GenerateUserScenariosRequest: Request message for DataFoundryService.GenerateUserScenarios.
  - `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.
  - `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.
  - `geminiAgentConfig` GoogleCloudAiplatformV1GeminiAgentConfig: Config for scraping a Gemini Agent (a Vertex AI Agent resource scraped via the Vertex Interactions API).
    - `geminiAgent` string: Required. The resource name of the Gemini Agent. Format: `projects/{project}/locations/{location}/agents/{agent}`. For example: `projects/123/locations/us-central1/agents/my-agent`.
  - `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.
  - `userScenarioGenerationConfig` GoogleCloudAiplatformV1UserScenarioGenerationConfig: User scenario generation configuration.
    - `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}`
    - `simulationInstruction` string: Optional. Simulation instruction to guide the user scenario generation.
    - `userScenarioCount` string, int64: Required. The number of user scenarios to generate. The maximum number of scenarios that can be generated is 100.

## Response `200`

Successful response

- GoogleCloudAiplatformV1GenerateUserScenariosResponse: Response message for DataFoundryService.GenerateUserScenarios.
  - `userScenarios` GoogleCloudAiplatformV1UserScenario[]: The generated user scenarios used to simulate multi-turn agent running results and agent evaluation.
    - `conversationPlan` string: Conversation plan to drive multi-turn agent run and get simulated agent eval dataset.
    - `startingPrompt` string: Starting prompt for the conversation between simulated user and agent under the test.
    - `testCaseTitle` string: Represents a short 3-5 word title for eval test case.

## Changes

- **2026-11-06** `3aca3b348f0c`: 4 info
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`
- **2026-10-30** `34fcc627b062`: 4 info
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/aiplatform/changes/v1/projects/:projectsId/locations/:locationsId:generateUserScenarios/post.md)

---

[API](https://skmtc.dev/google/apis/aiplatform.md) - [All operations](https://skmtc.dev/google/apis/aiplatform/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/aiplatform/revisions/3aca3b348f0c?raw)
