# Update module

`PATCH https://api.tentary.com/v1/modules/{module_id}`

Source: https://tentary.com/de/help/api/update-module/
Area: Kurse
MCP tool: `update_module`. Changes data at once.

---

Changes the fields that you send.

- `parent_module_id` and `position` move the module. `parent_module_id` `null` makes it a main module.
- The fields have the same names and formats as the items of [`GET /v1/courses/{course_id}`](https://tentary.com/de/help/api/get-course-outline/).

To delete a module, use [`POST /v1/delete`](https://tentary.com/de/help/api/delete-item/).

## Authorization

`Authorization: Bearer <API key>`

A personal API key (tnt_...). Create it in the Tentary app on the page AI & API.

## Path parameters

- `module_id` (integer, required, path): The id of a module from get_course_outline. Limits: min 1.

## Request body

- `parent_module_id` (integer, can be null): Move it into this module. null = main module. Limits: min 1.
- `title` (string): Title that buyers see. Limits: minLength 1, maxLength 255.
- `position` (integer): Place among the items of the same module: 1 = first. Default: last. Limits: min 1.
- `draft` (boolean): true = buyers do not see it. New items are drafts unless draft is false. draft true removes the release rule.
- `release` (object, can be null): When buyers get the item. null = at once (also left out on create; left out on update = no change). One rule: days or hours after purchase, a date, or after another lesson is done (only if the course tracks progress). Days and dates unlock at drip_release_hour of get_course_outline. Needs draft false. The answers add lesson_title and enforced to after_lesson (read only; enforced false = the course does not track progress, so the rule has no effect).
  - `type` (string, required) Allowed values: `days_after_purchase`, `hours_after_purchase`, `date`, `after_lesson`.
  - `days` (integer) Limits: min 1, max 9999.
  - `hours` (integer) Limits: min 1, max 9999.
  - `date` (string): Like 2026-12-01. Limits: pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.
  - `lesson_id` (integer): after_lesson: a lesson of the same course. Limits: min 1.
- `cover_image_url` (string, can be null): Module image: the image_url from finish_image, or a public image URL that Tentary copies. Buyers see it only with course layout cards, on the card of a main module (16:9). null removes it. Limits: maxLength 2048.

## Response

- `id` (integer): The ID.
- `course_id` (integer): The course ID.
- `parent_module_id` (integer, can be null): null = a main module.
- `title` (string): The title.
- `cover_image_url` (string, can be null): Module image. Shows only with course layout cards.
- `position` (integer): Place in its module or among the main items, 1 = first.
- `draft` (boolean): true = buyers see nothing of the module and the items in it.
- `release` (object, can be null): When buyers get the item. null = at once.
  - One of:
    - Variant type: days_after_purchase:
      - `type` (string): The rule type. Allowed values: `days_after_purchase`.
      - `days` (integer): Days after the purchase.
    - Variant type: hours_after_purchase:
      - `type` (string): The rule type. Allowed values: `hours_after_purchase`.
      - `hours` (integer): Hours after the purchase.
    - Variant type: date:
      - `type` (string): The rule type. Allowed values: `date`.
      - `date` (string<date>): Like 2026-01-31.
    - Variant type: after_lesson:
      - `type` (string): The rule type. Allowed values: `after_lesson`.
      - `lesson_id` (integer): The lesson that the buyer must finish first.
      - `lesson_title` (string, can be null): The title of that lesson.
      - `enforced` (boolean): false = the course does not track progress, so the rule has no effect.
- `admin_url` (string<uri>): The page in the Tentary app.

## Example request

```bash
curl -X PATCH "https://api.tentary.com/v1/modules/308" \
  -H "Authorization: Bearer $TENTARY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "After every run"
}'
```

## Example response

```json
{
  "id": 308,
  "course_id": 202,
  "parent_module_id": null,
  "title": "After every run",
  "cover_image_url": null,
  "position": 1,
  "draft": false,
  "release": null,
  "admin_url": "https://app.tentary.com/courses/edit/202"
}
```
