أنواع المشاريع — the categories a project is filed under.
Mounted at /api/project-types, OUTSIDE /communities/{id}: the community
comes from the communityId query parameter or the X-Tenant-Id header. On
create, a communityId in the body must equal that one (400 COMMUNITY_MISMATCH).
Reads need no token; create/edit/delete need projects:manage or projects:moderate.
6 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/project-types | List the community's project types |
POST | /api/project-types | Create a project type (managers) |
DELETE | /api/project-types/{id} | Delete a type (managers) |
GET | /api/project-types/{id} | One project type |
PUT | /api/project-types/{id} | Rename or re-describe a type (managers) |
GET | /api/project-types/project/{projectId} | The types of one project |
GET /api/project-typesAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | query | yes | string (uuid) | — |
q | query | no | string | — |
page | query | no | integer | — |
pageSize | query | no | integer | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | { success, data: ProjectType[], ...page } | — |
POST /api/project-typesAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | query | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | — |
description | string | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | data is the ProjectType | — |
400 | name missing | — |
DELETE /api/project-types/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Deleted | — |
GET /api/project-types/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | data is the ProjectType | — |
404 | Not found | — |
PUT /api/project-types/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Request body — application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | — |
description | string | no | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | data is the ProjectType | — |
GET /api/project-types/project/{projectId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
projectId | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | data is ProjectType[] | — |