Skip to content

启用/停用自定义组织

对自定义组织进行启用或停用操作

Tip: - 停用自定义组织时请确认有无在职员工、异动单据、待入职单据关联此自定义组织,如有会导致停用失败。

  • 若启/停用的生效时间当天不存在版本则会自动生成一个版本。
  • 若启/停用的生效时间当天存在版本则会修改该版本。
  • 如果该自定义组织设置了自动匹配规则,该规则也会同时被停用。

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/corehr/v2/custom_orgs/active
HTTP MethodPOST
接口频率限制5 次/秒
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用corehr:custom_org:write 读写自定义组织信息

请求头

名称类型必填描述
Authorizationstringtenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token
Content-Typestring固定值:"application/json; charset=utf-8"

请求体

名称类型必填描述
org_idstring自定义组织 ID - 可从 批量查询自定义组织的 org_id 字段中获取。
示例值:"6862995757234914823"
object_api_namestring组织类型编码,可在「飞书人事-设置-组织配置」中相应的自定义组织目录下查看
示例值:"custom_org_01"
activeboolean启用/停用状态。 - active 传 true 代表启用 - active 传 false 代表停用
示例值:true
effective_timestring自定义组织生效时间 - 填写格式: YYYY-MM-DD - 系统默认为填写日期当天的 00:00:00 生效 - 该接口只支持到最小单位为日 - 日期范围要求:1900-01-01 ~ 9999-12-31
示例值:"2020-01-01"
数据校验规则
- 长度范围:1010 字符 - 正则校验:`^((([0-9]{3}[1-9]

请求体示例

json
{
    "org_id": "6862995757234914823",
    "object_api_name": "custom_org_01",
    "active": true,
    "effective_time": "2020-01-01"
}

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {}
}

错误码

HTTP状态码错误码描述排查建议
4001160285Failed to disable as it still has active employees after the deactivation effective time.检查是否还有人员关联该组织
40011602811 or more members are in a job status change process after the current deactivation date检查是否有异动人员关联该组织
4001160508Still has an individual to be onboarded after the current deactivation date仍有待入职人员
4001160268Effective date for disabling the custom organization can't be earlier than the effective date of the last version停用日期不能早于最新的启用日期
4001161200There are still enabled subordinates on the current deactivation date停用日期下仍有启用的下级
5031161204Requset timeout联系飞书人事 Oncall
4291161604QPS over limit联系飞书人事 Oncall

内容来源:飞书开放平台 · 自动爬取整理