---
title: "Update Cloud Resource Label Rule"
method: PUT
path: "/cloud-resource-label-rule/{id}"
tags: ["Cloud Resource Label Rule"]
---

# Update Cloud Resource Label Rule

`PUT /cloud-resource-label-rule/{id}`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/cloud-resource-label-rule/{id}`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/cloud-resource-label-rule/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to update an existing Cloud Resource Label Rule

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `data` CloudResourceLabelRuleUpdateSchema, required: Update schema for CloudResourceLabelRule model. Update
    - `criteria` object: Versioned conditions that determine whether this rule matches a resource. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `name` string: Name of this rule. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `description` string: Description of this rule. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `isEnabled` boolean: Whether this rule is enabled. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `matchLabels` object[]: Only trigger for resources that already have at least one of these labels. Leave empty to match regardless of labels. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
      - `id` string
    - `nameRegexPattern` string: Regex (case-insensitive) matched against the resource name. Leave empty to match any name. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `cloudTagPattern` string: Regex (case-insensitive) matched against each of the resource's cloud tags, written key=value: ^team=payments$ matches every resource tagged team=payments, ^env= every resource with an env tag. Leave empty to match any tags. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `cloudResourceKind` 'environment' | 'resource': environment: App Platforms' environments. resource: the resources of Cloud's accounts. Empty: both, as rules made before the two products split. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `descriptionRegexPattern` string: Regex (case-insensitive) matched against the resource description. Leave empty to match any description. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `labelsToAdd` object[]: Labels to attach to the resource when this rule matches. Already-attached labels are not duplicated. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
      - `id` string

## Response `200`

Updated successfully

- object
  - `data` CloudResourceLabelRuleReadSchema: Read schema for CloudResourceLabelRule model. Read
    - `_id` string, uuid: ID of this object. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `createdAt` object: Date and Time when the object was created. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `updatedAt` object: Date and Time when the object was updated. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `deletedAt` object: Date and Time when the object was deleted. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `criteria` object: Versioned conditions that determine whether this rule matches a resource. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `projectId` string, uuid: ID of your OneUptime Project in which this object belongs. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [No access - you don't have permission for this operation]
    - `name` string, required: Name of this rule. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `description` string: Description of this rule. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `isEnabled` boolean: Whether this rule is enabled. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `matchLabels` object[]: Only trigger for resources that already have at least one of these labels. Leave empty to match regardless of labels. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
      - `id` string
    - `nameRegexPattern` string: Regex (case-insensitive) matched against the resource name. Leave empty to match any name. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `cloudTagPattern` string: Regex (case-insensitive) matched against each of the resource's cloud tags, written key=value: ^team=payments$ matches every resource tagged team=payments, ^env= every resource with an env tag. Leave empty to match any tags. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `cloudResourceKind` 'environment' | 'resource': environment: App Platforms' environments. resource: the resources of Cloud's accounts. Empty: both, as rules made before the two products split. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `descriptionRegexPattern` string: Regex (case-insensitive) matched against the resource description. Leave empty to match any description. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
    - `labelsToAdd` object[]: Labels to attach to the resource when this rule matches. Already-attached labels are not duplicated. Permissions - Create: [Project Owner, Project Admin, Create Cloud Resource Label Rule], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [Project Owner, Project Admin, Edit Cloud Resource Label Rule]
      - `id` string
    - `createdByUserId` string, uuid: User ID who created this object (if this object was created by a User). Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member, Viewer, Read Cloud Resource Label Rule], Update: [No access - you don't have permission for this operation]

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `404`: Not found. The record does not exist, belongs to another project, or is one you may not read - the same answer for each.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
