- [HTTP request](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.request_body)
- [Response body](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.aspect_1)

Update the attribute. The following fields in the `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute` can be updated:

- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute.FIELDS.display_name` The display name can be updated for user defined attributes only.
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute.FIELDS.description` The description can be updated for user defined attributes only.
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute.FIELDS.allowed_values` To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted.
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute.FIELDS.cardinality` The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes/patch#body.QUERY_PARAMETERS.update_mask` should be used to specify the fields being updated.

### HTTP request

`PATCH https://apihub.googleapis.com/v1/{attribute.name=projects/*/locations/*/attributes/*}`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `attribute.name` | `string` Identifier. The name of the attribute in the API Hub. Format: `projects/{project}/locations/{location}/attributes/{attribute}` |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Required. The list of fields to update. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.attributes#Attribute`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/apihub.readwrite`
- `
  https://www.googleapis.com/auth/cloud-platform`

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `apihub.attributes.update`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).