A AuthMS API Wiki API Reference iam.tianv.com →

POST /admin/tenants/{id}/departments

在指定租户下创建新部门,可指定父部门以构建层级组织架构

租户服务 `bearerAuth` application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
id path string Yes 租户ID

Request Body

Schema: dto.CreateDepartmentRequest

FieldTypeRequiredExampleConstraintsDescription
name string Yes 技术研发部 部门名称
code string No RD 部门编码
manager_id string No usr_001 负责人ID
parent_id string No dept-root 父部门ID

Responses

StatusDescriptionSchema
201创建成功dto.DepartmentDetailResponse
400请求参数错误gitee_com_linmes_authms_base_dto.SimpleResponse
401未认证gitee_com_linmes_authms_base_dto.SimpleResponse
403权限不足gitee_com_linmes_authms_base_dto.SimpleResponse
409资源冲突gitee_com_linmes_authms_base_dto.SimpleResponse
500服务器内部错误gitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.DepartmentDetailResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.DepartmentResponse No
message string No
timestamp string No

dto.DepartmentResponse

租户部门信息

FieldTypeRequiredExampleConstraintsDescription
code string No RD 部门编码
created_at string No 2026-01-15T10:30:00Z 创建时间
department_id string No dept_001 部门ID
manager_id string No usr_001 负责人ID
members_count integer No 25 成员数量
name string No 技术研发部 部门名称
parent_id string No dept_root 父部门ID
tenant_id string No tnt_abc123 租户ID

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No