Task templates - reusable task blueprints (قوالب المهام)
10 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/communities/{communityId}/tasks/templates | List templates (قائمة القوالب) |
POST | /api/communities/{communityId}/tasks/templates | Create template manually (إنشاء قالب) |
DELETE | /api/communities/{communityId}/tasks/templates/{templateId} | Delete template (حذف القالب) |
GET | /api/communities/{communityId}/tasks/templates/{templateId} | Get template by ID (تفاصيل القالب) |
PUT | /api/communities/{communityId}/tasks/templates/{templateId} | Update template (تحديث القالب) |
POST | /api/communities/{communityId}/tasks/templates/{templateId}/apply | Apply template (تطبيق القالب) |
GET | /api/communities/{communityId}/tasks/templates/categories | Get template categories (فئات القوالب) |
POST | /api/communities/{communityId}/tasks/templates/from-heading | Save a heading with its tasks as a template (حفظ العنوان كقالب) |
POST | /api/communities/{communityId}/tasks/templates/from-section | Save a whole section as a template (حفظ القسم كقالب) |
POST | /api/communities/{communityId}/tasks/templates/from-task | Create template from task (إنشاء قالب من مهمة) |
GET /api/communities/{communityId}/tasks/templatesReturns all task templates with optional category and kind filters. Requires tasks:manage permission (members read the ones offered to them at /member-sections/templates). Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
category | query | no | string | Filter by category |
kind | query | no | enum: task, heading, section | Only templates of this kind |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of templates | object |
POST /api/communities/{communityId}/tasks/templatesCreates a new task template from scratch. Requires tasks:manage permission. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
Request body (required) — application/json
Type: CreateTemplateRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Template created | object |
403 | Requires tasks:manage permission | — |
DELETE /api/communities/{communityId}/tasks/templates/{templateId}Deletes a task template. Requires tasks:manage permission. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
— | — | no | — | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Template deleted | — |
403 | Requires tasks:manage permission | — |
404 | Template not found | — |
GET /api/communities/{communityId}/tasks/templates/{templateId}Returns a single template with its data Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
— | — | no | — | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Template details | object |
404 | Template not found | — |
PUT /api/communities/{communityId}/tasks/templates/{templateId}Updates an existing template. Requires tasks:manage permission. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
— | — | no | — | — |
Request body (required) — application/json
Type: CreateTemplateRequest
Responses
| Status | Description | Body |
|---|---|---|
200 | Template updated | — |
403 | Requires tasks:manage permission | — |
404 | Template not found | — |
POST /api/communities/{communityId}/tasks/templates/{templateId}/applyA task template creates one task in headingId (optional title/dueDate overrides) and answers with the task. A heading template creates a heading with its tasks in sectionId; a section template creates a new section (no target). Both answer with { kind, sectionId, headingIds, taskCount }, and the new tasks inherit the section's assignments (one bulk write, no per-task webhooks). Requires tasks:manage permission.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
— | — | no | — | — |
Request body (required) — application/json
Type: ApplyTemplateRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Task created from template | object |
400 | HEADING_REQUIRED · SECTION_REQUIRED · TEMPLATE_KIND_MISMATCH · TEMPLATE_TOO_LARGE | — |
403 | Requires tasks:manage permission | — |
404 | Template, heading or section not found | — |
GET /api/communities/{communityId}/tasks/templates/categoriesReturns list of all unique template categories Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of categories | object |
POST /api/communities/{communityId}/tasks/templates/from-headingA snapshot of a community heading and its active tasks (settings, points, approval, completion method — not due dates, dependencies or assignments). Apply it into any section. memberUsable offers it to members for their private sections. Requires tasks:manage permission.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
headingId | string | yes | — |
name | string | no | Defaults to the heading name |
description | string | no | — |
category | string | no | — |
memberUsable | boolean | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Template created | object |
400 | HEADING_REQUIRED · TEMPLATE_TOO_LARGE | — |
403 | Requires tasks:manage permission | — |
404 | Heading not found in this community | — |
POST /api/communities/{communityId}/tasks/templates/from-sectionA snapshot of a community section with its active headings and tasks, its colors and preset cover (not an uploaded cover image, due dates, dependencies or assignments). Applying it creates a new section. memberUsable offers it to members for their private sections. Requires tasks:manage permission.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
sectionId | string | yes | — |
name | string | no | Defaults to the section name |
description | string | no | — |
category | string | no | — |
memberUsable | boolean | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Template created | object |
400 | SECTION_REQUIRED · TEMPLATE_TOO_LARGE | — |
403 | Requires tasks:manage permission | — |
404 | Section not found in this community | — |
POST /api/communities/{communityId}/tasks/templates/from-taskCreates a reusable template from an existing task. Requires tasks:manage permission. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
— | — | no | — | — |
Request body (required) — application/json
Type: CreateTemplateFromTaskRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Template created successfully | object |
403 | Requires tasks:manage permission | — |
404 | Source task not found | — |