# Create an exam question

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

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

Adds a question to the exam.

The question must have at least two alternatives, and at least one of them must be marked as correct. Questions are single-choice: if more than one alternative is marked as correct, only the first one is treated as correct.

Required permissions: `exams.update`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `product_id` | path | string | yes |  |
| `exam_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `alternatives` | array of object | yes |  |
| `format` | string, one of `multiple_choice` | yes |  |
| `image` | string or null | no |  |
| `text` | string | yes |  |

## Responses

### 201

Returns the newly created 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 exam was not found in the specified product or is not accessible with the current credentials.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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