**Full name**: projects.locations.datasets.consentStores.consents.activate

Activates the latest revision of the specified `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.consents#Consent` by committing a new revision with `state` updated to `ACTIVE`. If the latest revision of the specified Consent is in the `ACTIVE` state, no new revision is committed. A `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/Shared.Types/Code#ENUM_VALUES.FAILED_PRECONDITION` error occurs if the latest revision of the specified Consent is in the `REJECTED` or `REVOKED` state.

### HTTP request

`POST https://healthcare.googleapis.com/v1/{name=projects/*/locations/*/datasets/*/consentStores/*/consents/*}:activate`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the Consent to activate, of the form `projects/{projectId}/locations/{locationId}/datasets/{datasetId}/consentStores/{consentStoreId}/consents/{consent_id}`. An `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/Shared.Types/Code#ENUM_VALUES.INVALID_ARGUMENT` error occurs if `revisionId` is specified in the name. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `healthcare.consents.activate` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "consentArtifact": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "expireTime": string, "ttl": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `consentArtifact` | `string` Required. The resource name of the Consent artifact that contains documentation of the user's consent, of the form `projects/{projectId}/locations/{locationId}/datasets/{datasetId}/consentStores/{consentStoreId}/consentArtifacts/{consent_artifact_id}`. If the draft Consent had a Consent artifact, this Consent artifact overwrites it. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `consentArtifact`: - `healthcare.consentArtifacts.get` |
| Optional. Allows setting expiration time for Consents. Expired consents are ignored in access determination methods such as \[CheckDataAccess\]. This value overrides the expiration duration configured for the consent store. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `expireTime` | ``string(`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Timestamp in UTC of when this Consent is considered expired. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `ttl` | ``string(`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` The time to live for this Consent from when it is marked as active. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.consents#Consent`.

### Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).