Skip to main content
PUT
/
api
/
{organization_id}
/
usage-group-sets
/
{usage_group_set_id}
/
usage-groups
/
{usage_group_id}
Update a usage group
curl --request PUT \
  --url https://api.select.dev/api/{organization_id}/usage-group-sets/{usage_group_set_id}/usage-groups/{usage_group_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "filter_expression": {
    "operator": "and",
    "filters": [
      {}
    ]
  },
  "filter_expression_json": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "budget": 123,
  "order": 123
}'
{
  "filter_expression": {
    "operator": "and",
    "filters": [
      {}
    ]
  },
  "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>",
  "budget": 123,
  "order": 123,
  "usage_group_set_name": "<string>"
}

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

usage_group_id
string<uuid>
required

The ID of the usage group

organization_id
string
required

Body

application/json

The usage group updates to apply. Only specified fields will be updated.

id
string<uuid>
required

The unique identifier of the usage group to update. Must match the ID in the URL path.

filter_expression
object | null

A structured filter expression object that defines which Snowflake usage will be attributed to this usage group. The available dimensions depend on whether the usage group set is scoped to an account or organization. Use exactly one of filter_expression or filter_expression_json.

  • FilterExpression[Union[SemiStructuredDimension[AccountUsageGroupDimensions], AccountUsageGroupDimensions]]
  • FilterExpression[Union[SemiStructuredDimension[OrganizationUsageGroupDimensions], OrganizationUsageGroupDimensions]]
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.

name
string | null

The new name of the usage group. If provided, must not be empty.

budget
number | null

The new budget allocated to this usage group in credits. Set to null to remove the budget limit.

order
integer | null

The new display order and cost allocation precedence of the usage group within its usage group set. If provided, 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.

Response

Successful Response

filter_expression
object
required

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

  • FilterExpression[Union[SemiStructuredDimension[AccountUsageGroupDimensions], AccountUsageGroupDimensions]]
  • FilterExpression[Union[SemiStructuredDimension[OrganizationUsageGroupDimensions], OrganizationUsageGroupDimensions]]
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.