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

**Full name**: projects.locations.instances.legacySoarReports.legacyAddOrUpdateReportTemplate

Adds a new report template or updates an existing one. Templates define the visual structure, layout, and contained widgets of a report, which can then be generated manually or on a schedule.

### HTTP request

`POST https://{endpoint}/v1alpha/{instance}/legacySoarReports:legacyAddOrUpdateReportTemplate`

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 data sources for. Format: projects/{project}/locations/{location}/instances/{instance} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "creator": string, "creatorFullName": string, "category": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarReports/legacyAddOrUpdateReportTemplate#ReportTemplateCategoryEnum`), "name": string, "reportWidgets": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/LegacyDashboardWidgetDataModel`) } ], "creationTimeUnixTimeInMs": string, "modificationTimeUnixTimeInMs": string, "id": string, "isSystem": boolean, "hasScheduler": boolean } ``` |

| Fields ||
|---|---|
| `creator` | `string` Output only. Deprecated: This is a security breach. this should be retrieved from the requesting user and not specified in the request. |
| `creatorFullName` | `string` Output only. The full name of the creator of the report template. Deprecated: This is a security breach. this should be retrieved from the requesting user and not specified in the request. |
| `category` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarReports/legacyAddOrUpdateReportTemplate#ReportTemplateCategoryEnum`)`` Required. The category of the report template. |
| `name` | `string` Required. The name of the report template. |
| `reportWidgets[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/LegacyDashboardWidgetDataModel`)`` Optional. The widgets of the report template. |
| `creationTimeUnixTimeInMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The creation time of the report template. |
| `modificationTimeUnixTimeInMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The last modified time of the report template. |
| `id` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The report template id. |
| `isSystem` | `boolean` Required. Whether the report template is a system report. |
| `hasScheduler` | `boolean` Optional. Whether the report template has a scheduler. |

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

- `chronicle.legacySoarReports.update`

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

## ReportTemplateCategoryEnum

ReportTemplateCategoryEnum defines the category of the report template.

| Enums ||
|---|---|
| `ROI` | Roi category. |
| `MANAGEMENT` | Management category. |
| `SLA` | Sla category. |
| `TIER1` | Tier1 category. |
| `GENERAL` | General category. |