POST /admin/tenants/{tenant_id}/departments
Create a new department under a specified tenant, with the option to specify a parent department to build a hierarchical organization structure
Tenant Service `bearerAuth` application/json
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
id |
path |
string |
Yes |
|
|
|
Tenant ID |
Request Body
Schema: dto.CreateDepartmentRequest
| Field | Type | Required | Example | Constraints | Description |
name |
string |
Yes |
Technology R&D Department |
|
Department name |
code |
string |
No |
RD |
|
Department code |
manager_id |
string |
No |
usr_001 |
|
Manager ID |
parent_id |
string |
No |
dept-root |
|
Parent department ID |
Referenced Schemas
dto.DepartmentDetailResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
data |
dto.DepartmentResponse |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|
dto.DepartmentResponse
Tenant department info
| Field | Type | Required | Example | Constraints | Description |
code |
string |
No |
RD |
|
Department code |
created_at |
string |
No |
2026-01-15T10:30:00Z |
|
Creation time |
department_id |
string |
No |
dept_001 |
|
Department ID |
manager_id |
string |
No |
usr_001 |
|
Manager ID |
members_count |
integer |
No |
25 |
|
Member count |
name |
string |
No |
Technology R&D Department |
|
Department name |
parent_id |
string |
No |
dept_root |
|
Parent department ID |
tenant_id |
string |
No |
tnt_abc123 |
|
Tenant ID |
gitee_com_linmes_authms_base_dto.SimpleResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|