启用/停用自定义组织
对自定义组织进行启用或停用操作
Tip: - 停用自定义组织时请确认有无在职员工、异动单据、待入职单据关联此自定义组织,如有会导致停用失败。
- 若启/停用的生效时间当天不存在版本则会自动生成一个版本。
- 若启/停用的生效时间当天存在版本则会修改该版本。
- 如果该自定义组织设置了自动匹配规则,该规则也会同时被停用。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/corehr/v2/custom_orgs/active |
| HTTP Method | POST |
| 接口频率限制 | 5 次/秒 |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | corehr:custom_org:write 读写自定义组织信息 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
请求体
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
org_id | string | 是 | 自定义组织 ID - 可从 批量查询自定义组织的 org_id 字段中获取。 示例值:"6862995757234914823" |
object_api_name | string | 是 | 组织类型编码,可在「飞书人事-设置-组织配置」中相应的自定义组织目录下查看 示例值:"custom_org_01" |
active | boolean | 是 | 启用/停用状态。 - active 传 true 代表启用 - active 传 false 代表停用 示例值:true |
effective_time | string | 是 | 自定义组织生效时间 - 填写格式: YYYY-MM-DD - 系统默认为填写日期当天的 00:00:00 生效 - 该接口只支持到最小单位为日 - 日期范围要求:1900-01-01 ~ 9999-12-31 示例值:"2020-01-01" 数据校验规则: - 长度范围: 10 ~ 10 字符 - 正则校验:`^((([0-9]{3}[1-9] |
请求体示例
json
{
"org_id": "6862995757234914823",
"object_api_name": "custom_org_01",
"active": true,
"effective_time": "2020-01-01"
}响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 400 | 1160285 | Failed to disable as it still has active employees after the deactivation effective time. | 检查是否还有人员关联该组织 |
| 400 | 1160281 | 1 or more members are in a job status change process after the current deactivation date | 检查是否有异动人员关联该组织 |
| 400 | 1160508 | Still has an individual to be onboarded after the current deactivation date | 仍有待入职人员 |
| 400 | 1160268 | Effective date for disabling the custom organization can't be earlier than the effective date of the last version | 停用日期不能早于最新的启用日期 |
| 400 | 1161200 | There are still enabled subordinates on the current deactivation date | 停用日期下仍有启用的下级 |
| 503 | 1161204 | Requset timeout | 联系飞书人事 Oncall |
| 429 | 1161604 | QPS over limit | 联系飞书人事 Oncall |
