Moka People icon

Moka People

Moka People (HCM 人事系统) API 集成

组织接口 → 新增组织部门

AI-generated

Summary

Submit a batch request to add new organizational departments in the Moka People HCM system by providing an array of department objects with required details.

Inputs

  • apiCode (required) — The API code configured in Moka People backend under Settings → External API Settings for the Add Organizational Department interface.
  • data (required) — A JSON array of department objects to add, each must include nodeCode (department code), deptSampleName (department name), effectDate (effective date), superiorDept.superiorDeptCode (superior department code), and superiorDept.superiorDeptId (superior department ID). Optional fields like deptType, deptHierarchy, deptDirector, deptHrbp, treeOrder, and extendFields can also be included.
  • options.timeout — Request timeout in milliseconds. 0 means no timeout.

Output shape

a list of response objects corresponding to each input department entry

The operation sends the provided department data wrapped in a 'data' object to the Moka People API's batch create department endpoint. Each input item produces a corresponding response item or error object if the call fails. Errors can be handled per-item if 'Continue on Fail' is enabled.

Examples

Example 1: Add multiple departments at once

Provide the API code and a JSON array with department details including mandatory fields as documented, to create multiple departments in Moka People organizational structure.

Links

Discussion