# Update an exam question

`PATCH https://api.cademi.com.br/api/v3/products/{product_id}/exams/{exam_id}/questions/{exam_question_id}`

Operation ID: `exams.questions.update` · API v3

Updates an exam question. When `alternatives` is supplied, it replaces the entire set of alternatives. Answers already recorded in completed attempts are not regraded.

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

Required permissions: `exams.update`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `product_id` | path | string | yes |  |
| `exam_id` | path | string | yes |  |
| `exam_question_id` | path | string | yes |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `alternatives` | array of object | no |  |
| `deleted` | boolean, one of `false` | no | Only false is accepted. Restores the question from the trash. |
| `image` | string or null | no |  |
| `text` | string | no |  |

## Responses

### 200

Returns the updated question.

Body: `data`: ExamQuestion.

Fields of ExamQuestion:

| Field | Type | Required | Description |
|---|---|---|---|
| `alternatives` | array of object | yes |  |
| `created_at` | string (date-time) | yes |  |
| `deleted` | boolean | yes |  |
| `exam_id` | string | yes | Public ID of the exam, prefixed with exm_. |
| `format` | string, one of `multiple_choice` | yes |  |
| `id` | string | yes | Public ID of the exam question, prefixed with exq_. |
| `image` | string or null | yes |  |
| `object` | string, one of `exam_question` | yes |  |
| `position` | integer | yes |  |
| `revision` | string | yes |  |
| `text` | string | yes |  |
| `updated_at` | string (date-time) | 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 question was not found for the specified exam or is not accessible with the current credentials.

Body: Error.

### 412

The question 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
