Create a Custom Label

Create a new Custom Label rule. Custom Labels create business-relevant labels from cloud billing data using rule-based conditions and output mappings.

Conditions determine which billing line items the rule applies to. Filters support equals, like (regular expression), and set (key exists) operators. Conditions can be nested up to 3 levels using and, or, and not logical operators.

Output types:

  • TEMPLATE — Generate label values using expression templates with variable substitution.
  • MAPPING — Assign label values based on the value of an existing billing field.
  • DATA_MAPPING — Bulk label assignment from an uploaded data source.

Rules can be saved as DRAFT for review before being published, or published immediately to begin processing.

See Custom Labels for detailed guidance.

Body Params

Create request variant for TEMPLATE output type. Outputs use expression templates with variable substitution.

uuid
required
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
EqualsFilter | LikeFilter | SetFilter | Level2AndCondition | Level2OrCondition | Level2NotCondition | Level3AndCondition | Level3OrCondition | Level3NotCondition
required

Condition tree that determines which billing line items the rule applies to. A Condition is one of: a Filter (equals, like, set), a Level2Condition (and / or / not over filters), or a Level3 logical operator (and / or / not over filters and level-2 conditions). Nesting is bounded at three levels.

dependsOn
array of uuids
dependsOn
string | null
string | null

Day the rule stops applying, as an ISO 8601 date or datetime. Charges on this day are not labeled, so a rule for one day ends on the next day. Only the day is stored: any time of day or offset is ignored, and responses return midnight UTC. Must be a later day than startTime. Null means no end constraint.

string
required
number
string | null

First day the rule applies, as an ISO 8601 date or datetime. Only the day is stored: any time of day or offset is ignored, and responses return midnight UTC. Null means no start constraint.

string
enum

Optional. Set to DRAFT to save the rule without publishing. Omit to publish on creation. The non-empty requirements documented on this request body (for example sourceKey, values, patterns, key, expression) apply only to a rule that is published; a DRAFT may be incomplete.

Allowed:
string
enum
required
Allowed:
outputs
array of objects
required
length ≥ 1
outputs*
Responses

Language
Credentials
Bearer
JWT
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json