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

**Full name**: projects.locations.instances.legacyPlaybooks.legacyGetPlaybookStatsMap

Returns operational metrics for playbooks, including execution counts and performance distributions. Use this method to monitor the throughput and efficiency of automated response workflows.

### HTTP request

`POST https://{endpoint}/v1alpha/{instance}/legacyPlaybooks:legacyGetPlaybookStatsMap`

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

### Path parameters

| Parameters ||
|---|---|
| `instance` | `string` Required. The instance to get the playbook stats map for. Format: projects/{project}/locations/{location}/instances/{instance} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "fromUnixTimeMs": string, "toUnixTimeMs": string, "originalWorkflowIdentifier": string } ``` |

| Fields ||
|---|---|
| `fromUnixTimeMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The start time for the stats in unix time ms. |
| `toUnixTimeMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The end time for the stats in unix time ms. |
| `originalWorkflowIdentifier` | `string` Required. The original workflow identifier. |

### Response body

LegacyPlaybookGetPlaybookStatsMapResponse is a response for getting playbook stats map.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "steps": { string: { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyGetPlaybookStatsMap#SearchEverythingPlaybookStepRunStats`) }, ... }, "flows": { string: { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyGetPlaybookStatsMap#SearchEverythingPlaybookFlowRunStats`) }, ... } } ``` |

| Fields ||
|---|---|
| `steps` | ``map (key: string, value: object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyGetPlaybookStatsMap#SearchEverythingPlaybookStepRunStats`))`` Optional. The steps stats. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `flows` | ``map (key: string, value: object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyGetPlaybookStatsMap#SearchEverythingPlaybookFlowRunStats`))`` Optional. The flows stats. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

### 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 `instance` resource:

- `chronicle.legacyPlaybooks.get`

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

## SearchEverythingPlaybookStepRunStats

SearchEverythingPlaybookStepRunStats represents the stats for a step run.

| JSON representation |
|---|
| ``` { "successfulRuns": integer, "faultedRuns": integer, "totalRuns": integer } ``` |

| Fields ||
|---|---|
| `successfulRuns` | `integer` Required. The number of successful runs. |
| `faultedRuns` | `integer` Required. The number of faulted runs. |
| `totalRuns` | `integer` Required. The total number of runs. |

## SearchEverythingPlaybookFlowRunStats

SearchEverythingPlaybookFlowRunStats represents the stats for a flow run.

| JSON representation |
|---|
| ``` { "faultedRuns": integer, "totalRuns": integer, "branchRuns": { string: integer, ... } } ``` |

| Fields ||
|---|---|
| `faultedRuns` | `integer` Required. The number of faulted runs. |
| `totalRuns` | `integer` Required. The total number of runs. |
| `branchRuns` | `map (key: string, value: integer)` Optional. The number of runs for each branch. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |