Skip to main content
POST
/
api
/
{organization_id}
/
usage-group-sets
/
{usage_group_set_id}
/
usage-groups
Create a usage group
curl --request POST \
  --url https://api.select.dev/api/{organization_id}/usage-group-sets/{usage_group_set_id}/usage-groups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "usage_group_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "order": 123,
  "filter_expression": {
    "operator": "and",
    "filters": [
      {
        "field": {
          "field": "warehouse_name",
          "path": [
            "<string>"
          ]
        },
        "value": 123,
        "operator": ">",
        "not": false
      }
    ],
    "component_type": "Resource Filter"
  },
  "filter_expression_json": "<string>",
  "budget": 123
}
'
{
  "filter_expression": {
    "operator": "and",
    "filters": [
      {
        "field": {
          "field": "warehouse_name",
          "path": [
            "<string>"
          ]
        },
        "value": 123,
        "operator": ">",
        "not": false
      }
    ],
    "component_type": "Resource Filter"
  },
  "filter_expression_json": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "usage_group_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "order": 123,
  "usage_group_set_name": "<string>",
  "budget": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

usage_group_set_id
string<uuid>
required

The ID of the usage group set

organization_id
string
required

Body

application/json

The usage group configuration to create. Must include either a filter_expression object or filter_expression_json string.

name
string
required

The name of the usage group. Must be unique within the usage group set and cannot be empty.

usage_group_set_id
string<uuid>
required

The ID of the usage group set this usage group belongs to. Must match the usage_group_set_id in the URL path.

order
integer
required

The display order and cost allocation precedence of the usage group within its usage group set. Must be a non-negative integer. When usage groups have overlapping filter expressions, cost allocation goes to the usage group with the lowest order value first. We strongly recommend using unique order values per usage group within a set.

filter_expression
FilterExpression[Union[SemiStructuredDimension[AccountUsageGroupDimensions], AccountUsageGroupDimensions]] · object

A structured filter expression object that defines which Snowflake usage will be attributed to this usage group. The available dimensions depend on the usage group set's scope: account, organization, team, or Select organization. Use exactly one of filter_expression or filter_expression_json.

filter_expression_json
string | null

A JSON string representation of the filter expression. This is primarily used for Terraform provider support. Use exactly one of filter_expression or filter_expression_json. This value will be validated in the same manner as filter_expression.

budget
number | null

The budget allocated to this usage group in credits. If not specified, the usage group will have no budget limit.

Response

Successful Response

filter_expression
FilterExpression[Union[SemiStructuredDimension[AccountUsageGroupDimensions], AccountUsageGroupDimensions]] · object
required

The structured filter expression object that defines which Snowflake usage is attributed to this usage group.

filter_expression_json
string
required

The JSON string representation of the filter expression, used by the terraform provider.

id
string<uuid>
required

The unique identifier of the usage group.

created_at
string<date-time>
required

The timestamp when the usage group was created.

updated_at
string<date-time>
required

The timestamp when the usage group was last updated.

usage_group_set_id
string<uuid>
required

The ID of the usage group set this usage group belongs to.

name
string
required

The name of the usage group.

order
integer
required

The display order and cost allocation precedence of the usage group within its usage group set. Lower values have higher precedence for cost allocation when filter expressions overlap.

usage_group_set_name
string
required

The name of the usage group set this usage group belongs to.

budget
number | null

The budget allocated to this usage group in credits. Null indicates no budget limit.