# Reorder module contents

`PUT https://api.cademi.com.br/api/v3/products/{product_id}/modules/{module_id}/content/order`

Operation ID: `modules.content.order.update` · API v3

Sets the display order of the submodules and lessons placed directly in the module.

The `ids` array accepts both module public IDs (`mod_`) and lesson public IDs (`les_`) in the desired order. For each kind of item you send, the array must contain the complete set of items of that kind currently in the module. If the supplied set does not match, the API returns the `order_set_mismatch` error code and the existing order remains unchanged.

To avoid overwriting concurrent changes, send the module `ETag` from the retrieve operation in the `If-Match` header.

Required permissions: `modules.update`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `product_id` | path | string | yes |  |
| `module_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 module contents in their new order.

Body: `data`: array of ContentEntry.

Fields of ContentEntry:

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Public ID of the module or lesson, prefixed with mod or les according to kind. |
| `kind` | string, one of `module`, `lesson` | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `content_entry` | yes |  |
| `position` | integer | yes |  |
| `status` | string, one of `published`, `draft` | 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 module was not found in the specified product or is not accessible with the current credentials.

Body: Error.

### 412

The module has changed since the supplied revision was retrieved.

Body: Error.

### 422

The supplied IDs do not match the set of items available for reordering in the module.

Body: Error.

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