POST高危 新建员工档案
参数位置:body:employeeNo、name、gender、avatar、userId、employmentType、deptId、positionId、levelId、status、hireDate、phone、wechat、email、education、school、major、birthDate、address、emergencyContact、emergencyPhone、emergencyRelation、contractEndDate、probationEndDate、reportToEmployeeId、workLocation、idCard、passportNo、bankAccount、bankName、socialSecurityNo、educations、workHistories、certifications、trainings、attachments。 必填:name(姓名)、phone(手机号,11位大陆手机号)、deptId(部门ID);可选:employeeNo(工号,不传按编码规则自动生成)、hireDate(入职日期 yyyy-MM-dd,不传默认当天)、gender(1男/0女)、email(填写须为合法邮箱)、positionId、levelId、employmentType(正式/实习/兼职)、status(0在职/1试用期/3休假中,不可直接建为离职态)、birthDate、idCard、passportNo、address、emergencyContact/emergencyPhone/emergencyRelation、contractEndDate、probationEndDate、reportToEmployeeId、workLocation、bankAccount、bankName、socialSecurityNo、educations/workHistories/certifications/trainings/attachments(数组)。涉及个人敏感信息。调用前请与用户确认。
| 接口编码 | 所需范围 | 后端接口 |
|---|---|---|
office.employee.create | office:write | POST /v1/employees/create(comap-office) |
⚠️ 高危接口:删除或状态变更类操作,MCP 调用须先向用户复述并获同意后携 confirm: true。
必填字段
| 字段 | 依据 |
|---|---|
name | 参数说明 |
phone | 参数说明 |
deptId | 参数说明 |
条件必填(如「某状态时必填」)不在此表,以上方参数说明为准。 判定规则见必填字段的判定。
请求体字段(body)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
employeeNo | string | — | — |
name | string | — | — |
gender | integer(int32) | — | — |
avatar | string | — | — |
userId | integer(int64) | — | — |
employmentType | string | — | — |
deptId | integer(int64) | — | — |
positionId | integer(int64) | — | — |
levelId | integer(int64) | — | — |
status | integer(int32) | — | — |
hireDate | string | — | — |
phone | string | — | — |
wechat | string | — | — |
email | string | — | — |
education | string | — | — |
school | string | — | — |
major | string | — | — |
birthDate | string | — | — |
address | string | — | — |
emergencyContact | string | — | — |
emergencyPhone | string | — | — |
emergencyRelation | string | — | — |
contractEndDate | string | — | — |
probationEndDate | string | — | — |
reportToEmployeeId | integer(int64) | — | — |
workLocation | string | — | — |
idCard | string | — | — |
passportNo | string | — | — |
bankAccount | string | — | — |
bankName | string | — | — |
socialSecurityNo | string | — | — |
educations5 | EducationDTO[] | — | — |
workHistories5 | WorkHistoryDTO[] | — | — |
certifications5 | CertificationDTO[] | — | — |
trainings7 | TrainingDTO[] | — | — |
attachments7 | EmployeeAttachmentDTO[] | — | — |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求示例
curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "office.employee.create",
"body": {}
}'
错误处理
响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:
| 错误码 | 说明 | 可重试 |
|---|---|---|
| 92101 | 访问凭证无效 | 否 |
| 92201 | 接口未登记或已停用 | 否 |
| 92202 | 超出凭证授权范围——本接口需 office:write | 否 |
| 92204 | 绑定员工无此接口的功能权限 | 否 |
| 92203 | 上游服务调用失败 | 先查询处理结果,禁止盲目重试 |
| 92301 | 请求过于频繁 | 是 |
| 92205 | 写操作处理超时,结果未知(下游可能仍在执行) | 否,先查询确认结果 |
| 92302 | 有参数相同的写请求正在处理中 | 等待并确认前一次结果,勿重复提交 |
除此之外,comap-office 自身的业务校验失败会原样透传其业务码与提示
(如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内,
以响应里的 message 为准。完整的平台层错误码见错误码说明。
← 返回员工管理