Skip to content

启用/停用公司

对公司进行启用或停用操作

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

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/corehr/v2/companies/active
HTTP MethodPOST
接口频率限制5 次/秒
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用corehr:company:write 查看、创建、更新、删除公司信息

请求头

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

请求体

名称类型必填描述
company_idstring公司 ID - 可从 批量查询公司的 id 字段中获取。
示例值:"1616161616"
effective_timestring公司启用/停用生效时间 - 填写格式: YYYY-MM-DD - 系统默认为填写日期当天的 00:00:00 生效 - 该接口只支持到最小单位为日 - 日期范围要求:1900-01-01 ~ 9999-12-31
示例值:"2020-01-01"
activeboolean启用/停用状态。 - active 传 true 代表启用 - active 传 false 代表停用
示例值:true
operation_reasonstring操作原因
示例值:"业务操作"

请求体示例

json
{
    "company_id": "1616161616",
    "effective_time": "2020-01-01",
    "active": true,
    "operation_reason": "业务操作"
}

响应

响应体

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

响应体示例

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

错误码

HTTP状态码错误码描述排查建议
4001160402param is invalid检查传参是否正确
4001160267Activation date cannot be earlier than the effeective date of the last deactivated version启用日期不能早于最新的停用日期
4001160268Effective date for disabling can't be earlier than theeffective date of the last version停用日期不能早于最新的启用日期
4001160350Failed to enable. Its parent has been deactivated on启用失败,上级公司已停用
4001160501Failed to disable this as it still has sub after the deactivation effective time停用日期下仍有启用的下级
4001160072Unable to deactivate, because there are still active contracts or employees or pre-hires in it since effective time停用失败,停用日期仍有关联此公司的合同记录、在职员工和待入职员工
4001160281Failed to disable as 1 or more members of it are in a job status change process after the current deactcivation date停用失败,停用日期仍有关联此公司的异动记录
5031161204Requset timeout请求超时,请稍后重试。必要时请联系飞书人事 Oncall
4291161604QPS over limit请求频率过高,请稍后重试。必要时请联系飞书人事 Oncall

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