# Update product access

`PATCH https://api.cademi.com.br/api/v3/users/{user_id}/products/{product_id}/access`

Operation ID: `users.products.access.update` · API v3

Overrides the user's access to a product. Only the fields supplied in the request are changed:

- `duration` sets the access duration for this product.
- `schedule_id` assigns the user to a schedule; send `null` to remove the assignment.
- `rules_waived` controls whether the product's content release rules are waived for this user.

To avoid overwriting a newer version, send the `ETag` returned by the retrieve operation in the `If-Match` header.

Required permissions: `enrollments.manage_access`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `user_id` | path | string | yes |  |
| `product_id` | path | string | yes |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `duration` | object or null | no |  |
| `rules_waived` | boolean | no |  |
| `schedule_id` | string or null | no |  |

## Responses

### 200

Returns the user's effective access to the product, including the applied overrides.

Body: `data`: ProductAccess.

Fields of ProductAccess:

| Field | Type | Required | Description |
|---|---|---|---|
| `denial_reason` | string or null, one of `no_access`, `hidden`, `opens_soon`, `opens_at`, `ended_at`, `exam_required`, `content_in_edit`, `insufficient_progress` | yes |  |
| `ends_at` | string or null (date-time) | yes |  |
| `has_access` | boolean | yes |  |
| `object` | string, one of `product_access` | yes |  |
| `overrides` | object | yes |  |
| `product_id` | string | yes |  |
| `revision` | string or null | yes |  |
| `sources` | array of object | yes |  |
| `starts_at` | string or null (date-time) | yes |  |
| `user_id` | string | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The user or product was not found or is not accessible with the current credentials.

Body: Error.

### 412

The product access has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
