- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyCases/simulateAlert#body.aspect_1)

**Full name**: projects.locations.instances.legacyCases.simulateAlert

Simulates a specific alert within a case, optionally replacing fields or performing grouping. The simulated alert is ingested and indexed, appearing as a test case in the queue. The simulated alert can later be used to test playbook simulations and IDE actions.

### HTTP request

`POST https://{endpoint}/v1alpha/{name}/legacyCases:simulateAlert`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/chronicle/docs/reference/rest#rest_endpoints).

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the LegacyCase to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/LegacyCases |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "caseId": string, "alertIdentifier": string, "environment": string, "fieldsToReplace": { string: string, ... }, "shouldDoGrouping": boolean } ``` |

| Fields ||
|---|---|
| `caseId` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. CaseId is the unique identifier of the case. |
| `alertIdentifier` | `string` Required. AlertIdentifier is the identifier of the alert. |
| `environment` | `string` Optional. Environment is the environment for the simulation. |
| `fieldsToReplace` | `map (key: string, value: string)` Optional. FieldsToReplace is a map of fields to replace. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `shouldDoGrouping` | `boolean` Optional. ShouldDoGrouping indicates whether grouping should be performed. |

### Response body

If successful, the response body is an empty JSON object.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/chronicle`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `chronicle.legacyCases.ingestAlertTestCase`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).