> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dokstamp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modules

> Create and manage course modules — the individual subjects or disciplines within a course.

# Modules

Modules are the individual subjects, disciplines, or units that make up a course. Create modules at the institution level, then attach them to one or more courses.

***

## The module object

```json theme={null}
{
  "uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "code": "CS101",
  "name": "Introduction to Programming",
  "description": "Fundamentals of programming using Python.",
  "syllabus": "Variables, control flow, functions, OOP basics.",
  "workload": 80,
  "credits": 4,
  "modality": "hybrid",
  "level": "undergraduate",
  "is_active": true,
  "is_required": true,
  "institution": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Federal University of Technology"
  }
}
```

| Field         | Type    | Description                                        |
| ------------- | ------- | -------------------------------------------------- |
| `uuid`        | string  | Unique identifier                                  |
| `code`        | string  | Module code (unique per institution, max 20 chars) |
| `name`        | string  | Module name (max 150 chars)                        |
| `description` | string  | Short description                                  |
| `syllabus`    | string  | Full syllabus content                              |
| `workload`    | integer | Total hours (unsigned)                             |
| `credits`     | integer | Academic credits (unsigned)                        |
| `modality`    | enum    | `in_person`, `online`, `hybrid`                    |
| `level`       | enum    | `undergraduate`, `graduate`, `technical`, `open`   |
| `is_active`   | boolean | Whether the module is currently active             |
| `is_required` | boolean | Whether the module is mandatory in its course      |

***

## List modules

```http theme={null}
GET /modules
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.dokstamp.com/modules?where[level]=undergraduate&sort[column]=name&sort[order]=asc" \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "X-Tenant: {TENANT}"
  ```
</CodeGroup>

***

## Create a module

```http theme={null}
POST /modules
```

| Parameter          | Type    | Required | Description                                      |
| ------------------ | ------- | -------- | ------------------------------------------------ |
| `name`             | string  | Yes      | Module name                                      |
| `institution_uuid` | string  | Yes      | Parent institution UUID                          |
| `code`             | string  | No       | Module code (unique per institution)             |
| `description`      | string  | No       | Short description                                |
| `syllabus`         | string  | No       | Full syllabus                                    |
| `workload`         | integer | No       | Total contact hours                              |
| `credits`          | integer | No       | Academic credits                                 |
| `modality`         | enum    | No       | `in_person`, `online`, `hybrid`                  |
| `level`            | enum    | No       | `undergraduate`, `graduate`, `technical`, `open` |
| `is_active`        | boolean | No       | Default: `true`                                  |
| `is_required`      | boolean | No       | Default: `false`                                 |

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.dokstamp.com/modules \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Tenant: {TENANT}" \
    -d '{
      "name": "Introduction to Programming",
      "code": "CS101",
      "institution_uuid": "550e8400-e29b-41d4-a716-446655440000",
      "workload": 80,
      "credits": 4,
      "modality": "hybrid",
      "level": "undergraduate",
      "is_active": true,
      "is_required": true
    }'
  ```
</CodeGroup>

***

## Get, update, delete

```http theme={null}
GET    /modules/{uuid}
PATCH  /modules/{uuid}
PUT    /modules/{uuid}
DELETE /modules/{uuid}
DELETE /modules/batch/destroy
```

<Info>
  After creating modules, attach them to a course using `POST /courses/{uuid}/attach/modules`. See [Course Modules](/en/api-reference/courses/modules).
</Info>
