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

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

Adds a new playbook category or updates the metadata of an existing one.

### HTTP request

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

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 add or update the workflow category for. Format: projects/{project}/locations/{location}/instances/{instance} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "id": string, "name": string, "creationTimeUnixTimeInMs": string, "modificationTimeUnixTimeInMs": string, "categoryState": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyAddOrUpdatePlaybookCategory#ApiCategoryState`), "type": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyAddOrUpdatePlaybookCategory#CategoryType`), "isDefaultCategory": boolean } ``` |

| Fields ||
|---|---|
| `id` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. Id is the unique identifier of the category. |
| `name` | `string` Required. Name is the name of the category. |
| `creationTimeUnixTimeInMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. CreationTimeUnixTimeInMs is the creation time of the category. Represents DateTime CreationTimeUnixTimeInMs as unix time |
| `modificationTimeUnixTimeInMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. ModificationTimeUnixTimeInMs is the modification time of the category. Represents DateTime ModificationTimeUnixTimeInMs as unix time |
| `categoryState` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyAddOrUpdatePlaybookCategory#ApiCategoryState`)`` Output only. CategoryState is the state of the category. |
| `type` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacyPlaybooks/legacyAddOrUpdatePlaybookCategory#CategoryType`)`` Required. CategoryType is the type of the category. |
| `isDefaultCategory` | `boolean` Required. IsDefaultCategory indicates if the category is the default category. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/ApiWorkflowCategoryDataModel`.

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

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

## ApiCategoryState

ApiCategoryState represents the state of a category.

| Enums ||
|---|---|
| `API_CATEGORY_STATE_UNSPECIFIED` | The category state is unspecified. |
| `EMPTY` | The category state is empty. |
| `FULL` | The category state is full. |
| `FULL_FROM_RESTRICTED_ENVIRONMENT` | The category state is full from a restricted environment. |
| `NO_MANAGE_PERMISSIONS` | The category state is no manage permissions. |
| `DEFAULT_CATEGORY` | The category state is default category. |

## CategoryType

CategoryType represents the type of a category.

| Enums ||
|---|---|
| `CATEGORY_TYPE_UNSPECIFIED` | The category type is unspecified. |
| `REGULAR` | The category type is regular. |
| `SYSTEM_DEFAULT` | The category type is system default. |
| `GENERATED_FROM_ALERT_PLAYBOOK` | The category type is generated from alert playbook. |