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

**Full name**: projects.locations.instances.cases.getOrCreateCaseSummary

Gets or initiates the creation of an AI-driven summary for a case. Use this method to leverage AI for generating a concise overview of case reasons, next steps, and a general investigation summary.

### HTTP request

`POST https://{endpoint}/v1alpha/{name}:getOrCreateCaseSummary`

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 Case. Format: projects/{project}/locations/{location}/instances/{instance}/cases/{case} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "isFirstRequest": boolean } ``` |

| Fields ||
|---|---|
| `isFirstRequest` | `boolean` Required. Whether this is the first request during polling the case generation state. |

### Response body

Response message for cases.getOrCreateCaseSummary.

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

| JSON representation |
|---|
| ``` { "reasons": [ string ], "nextSteps": [ string ], "summary": string, "state": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.cases/getOrCreateCaseSummary#SummaryState`), "markdownResults": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.cases/getOrCreateCaseSummary#CaseSummaryMarkdownResults`) }, "updateTime": string } ``` |

| Fields ||
|---|---|
| `reasons[]` | `string` Output only. The reasons in the case summary. |
| `nextSteps[]` | `string` Output only. The next steps in the case summary. |
| `summary` | `string` Output only. The summary prediction. |
| `state` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.cases/getOrCreateCaseSummary#SummaryState`)`` Output only. The state of the case summary generation. |
| `markdownResults` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.cases/getOrCreateCaseSummary#CaseSummaryMarkdownResults`)`` Output only. The raw results after entity marking. |
| `updateTime` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The modification time of the record in milliseconds. |

### 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.cases.update`

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

## SummaryState

Possible states for the case summary generation.

| Enums ||
|---|---|
| `SUMMARY_STATE_UNSPECIFIED` | Unspecified state. |
| `PENDING_START` | Not yet started - pending to start due to resources limitation. |
| `IN_PROGRESS` | Currently being generated by the AI in another thread. |
| `SUCCESSFUL` | Generation Completed. |
| `ERROR` | Generation Failed with an error. |

## CaseSummaryMarkdownResults

The raw results after entity marking.

| JSON representation |
|---|
| ``` { "reasons": [ string ], "nextSteps": [ string ], "summary": string } ``` |

| Fields ||
|---|---|
| `reasons[]` | `string` Output only. List of reasons that were generated for the case summary, with entity markers. |
| `nextSteps[]` | `string` Output only. List of next steps that were generated for the case summary, with entity markers. |
| `summary` | `string` Output only. The case summary, with entity markers. |