# Reorder exam questions

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

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

Sets the order in which the exam questions are presented.

The request must contain exactly the set of questions currently in the exam, excluding questions in the trash. If the supplied set does not match, the request is rejected with `order_set_mismatch` and the existing order remains unchanged.

To avoid overwriting a newer version, send the exam `ETag` from the exam 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 |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `ids` | array of string | yes |  |

## Responses

### 200

Returns the questions in their new order.

Body: `data`: array of 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 exam was not found in the specified product or is not accessible with the current credentials.

Body: Error.

### 412

The exam has changed since the supplied revision was retrieved.

Body: Error.

### 422

The supplied question IDs do not match the set of questions currently in the exam.

Body: Error.

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