---
title: "Create Resource Group"
method: POST
path: "/api/v2/ResourceGroups"
tags: ["ResourceGroups"]
---

# Create Resource Group

`POST /api/v2/ResourceGroups`

Create a resource group by specifying parameters in the request body when invoking the following endpoint:

  > `POST https://YourAccount.lacework.net/api/v2/ResourceGroups`

## Headers

- `Authorization` string, required
- `Content-Type` string, required
- `Account-Name` string
- `Org-Access` boolean

## Request body

- union
  - ResourceGroupsAWSCreateSchema
    - `name` string, required — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'AWS', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
  - ResourceGroupsGCPCreateSchema
    - `name` string, required — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'GCP', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
  - ResourceGroupsAZURECreateSchema
    - `name` string, required — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'AZURE', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
  - ResourceGroupsMACHINECreateSchema
    - `name` string — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'MACHINE', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
  - ResourceGroupsCONTAINERCreateSchema
    - `name` string, required — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'CONTAINER', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
  - ResourceGroupsOCICreateSchema
    - `name` string, required — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'OCI', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
  - ResourceGroupsKUBERNETESCreateSchema
    - `name` string, required — The resource group's name.
    - `description` string — A brief description of the resource group.
    - `resourceType` 'KUBERNETES', required — The resource type such as cloud accounts, containers, or machines.
    - `query` object, required — The query used to fetch resources matching the filters defined here.
      - `filters` object[], required — The predicate that a resource should apply to.
        - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
          - `field` string, required — The field on which to apply the predicate.
          - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
          - `values` string[], required — The values that the predicate should match.
          - `key` string — For fields that support a tag, the key on which to filter.
      - `expression` object, required — Query expression that defines how the filters should be combined.
        - `operator` 'AND' | 'OR', required — Type of operator to apply.
        - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
          - `operator` 'AND' | 'OR' — Type of operator to apply.
          - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
          - `children` ResourceGroupsChildren — recursive
    - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.

## Response `201`

No Error

- object
  - `data` union
    - ResourceGroupsAWSResponseSchema
      - `name` string, required — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'AWS', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `true` if this is a default resource group. Otherwise, returns `false`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.
    - ResourceGroupsGCPResponseSchema
      - `name` string, required — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'GCP', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `1` if this is a default resource group. Otherwise, returns `0`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.
    - ResourceGroupsAZUREResponseSchema
      - `name` string, required — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'AZURE', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `true` if this is a default resource group. Otherwise, returns `false`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.
    - ResourceGroupsMACHINEResponseSchema
      - `name` string — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'MACHINE', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `true` if this is a default resource group. Otherwise, returns `false`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.
    - ResourceGroupsCONTAINERResponseSchema
      - `name` string, required — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'CONTAINER', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `true` if this is a default resource group. Otherwise, returns `false`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.
    - ResourceGroupsOCIResponseSchema
      - `name` string, required — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'OCI', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `1` if this is a default resource group. Otherwise, returns `0`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.
    - ResourceGroupsKUBERNETESResponseSchema
      - `name` string, required — The resource group's name.
      - `description` string — A brief description of the resource group.
      - `resourceType` 'KUBERNETES', required — The resource type such as cloud accounts, containers, or machines.
      - `query` object, required — The query used to fetch resources matching the filters defined here.
        - `filters` object[], required — The predicate that a resource should apply to.
          - `^\w+$` object — A name-value pair where the name is the name of the filter to be applied in an expression and the value is an object that defines the filter expression.
            - `field` string, required — The field on which to apply the predicate.
            - `operation` 'STARTS_WITH' | 'INCLUDES' | 'ENDS_WITH' | 'EQUALS', required — Type of operation to apply.
            - `values` string[], required — The values that the predicate should match.
            - `key` string — For fields that support a tag, the key on which to filter.
        - `expression` object, required — Query expression that defines how the filters should be combined.
          - `operator` 'AND' | 'OR', required — Type of operator to apply.
          - `children` object[], required — Combines one or more filters. You must specify either `filterName` or `children` in a filter.
            - `operator` 'AND' | 'OR' — Type of operator to apply.
            - `filterName` string — Name of the filter defined in `filters`. You must specify either `filterName` or `children` in a filter.
            - `children` ResourceGroupsChildren — recursive
      - `enabled` 0 | 1 — When sending a request, use this attribute to enable or disable a resource group. When included in a response, returns `1` for enabled resource groups, or returns `0` for disabled resource groups.
      - `resourceGroupGuid` string — Resource Group ID.
      - `guid` string — Returns the customer ID.
      - `isDefaultBoolean` boolean — Returns `true` if this is a default resource group. Otherwise, returns `false`.
      - `updatedBy` string — The email of the FortiCNAPP user who last updated the resource group configuration.
      - `updatedTime` number — When this resource group configuration last changed.

## Other responses

- `4XX` — Client Error
- `5XX` — Internal Server Error

---

[API](https://skmtc.net/lacework/apis/forticnapp-api-2-0-documentation.md) · [All operations](https://skmtc.net/lacework/apis/forticnapp-api-2-0-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lacework/forticnapp-api-2-0-documentation/versions/7015f76895f2/schema)
