---
deprecated: true
search:
  tags:
    - Module groups
    - POST
seo:
  description: >-
    Creates a module group. Returns the created group (same shape as GET…
    Reference for the POST /module-groups endpoint in the Fuxam API v4.
sidebar:
  label: Create a module group
  badge: POST
title: Create a module group
type: openapi-operation
---
Creates a module group. Returns the created group (same shape as GET /module-groups/&#123;id&#125;). Optionally pass `moduleIds` to attach modules (each module's default version is used). When Module Hierarchy is enabled, writes return 409 Conflict and clients should use /modules/&#123;id&#125;/versions/&#123;versionId&#125;/submodules. Successful responses include Deprecation: true and a Link successor-version header to /api/v4/openapi. Scoped to your integration's institution via Basic Auth credentials.

`POST /module-groups`

**Deprecated.**

**Request body** (`application/json`, required)

- `name` (string, required)
- `code` (string)
- `description` (string)
- `color` (string)
- `icon` (string)
- `moduleIds` (string[]) — Optional module IDs to attach (resolved to default versions).

Request body example:

```json
{
  "name": "string",
  "code": "string",
  "description": "string",
  "color": "string",
  "icon": "string",
  "moduleIds": [
    "string"
  ]
}
```

**Responses**

- `201` — Module group created
- `400` — Bad Request
- `401` — Unauthorized
- `409` — Conflict — duplicate email or membership code (body includes \`existingUserId\` when known), a time-tracking session that is already running (\`activeSession\`), a time-tracking interval that overlaps an existing log (\`conflictingLog\`), idempotency key reused with a different body (\`idempotency\_key\_reused\`), or concurrent request with the same key still in progress (\`idempotency\_key\_in\_progress\`)
- `429` — Too Many Requests — 1000 requests per minute per institution. Includes \`X-RateLimit-Limit\`, \`X-RateLimit-Remaining\`, \`X-RateLimit-Reset\` (ISO-8601), and \`Retry-After\` (seconds).
- `500` — Internal Server Error

Response example, 201:

```json
{
  "data": {
    "id": "mg_001",
    "name": "Core Modules",
    "code": "CORE",
    "description": "Mandatory core modules for all students.",
    "color": "#0361fc",
    "icon": "layers",
    "institutionId": "inst_123",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-06-01T00:00:00.000Z"
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2026-06-26T00:00:00.000Z",
    "version": "v4"
  }
}
```
