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

Update spec. The following fields in the `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec` can be updated:

- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec.FIELDS.display_name`
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec.FIELDS.source_uri`
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec.FIELDS.lint_response`
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec.FIELDS.attributes`
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec.FIELDS.contents`
- `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.specs#Spec.FIELDS.spec_type`

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec.

In case of contents or source_uri being present in update mask, specType must also be present. Also, specType can not be present in update mask if contents or source_uri is not present.

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

### HTTP request

`PATCH https://apihub.googleapis.com/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}`

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

### Path parameters

| Parameters ||
|---|---|
| `spec.name` | `string` Identifier. The name of the spec. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` |

### 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.apis.versions.specs#Spec`.

### 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.apis.versions.specs#Spec`.

### 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.specs.update`

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