# Delete custom organization

Delete the corresponding custom organization based on the incoming custom organization ID

**Notice**：- It cannot be restored after deletion, and the corresponding custom organization information cannot be searched in the system. Please operate with caution.
- When deleting a custom organization, please confirm whether there are employees, change documents, and pending entry documents associated with this custom organization. If so, the deletion will fail.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v2/custom_orgs/delete_org
HTTP Method | POST
Rate Limit | [5 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | 读写自定义组织信息(corehr:custom_org:write)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Request body

Parameter | Type | Required | Description
---|---|---|---
org_id | string | Yes | Custom Organization ID<br>- Available from the org_id field of [Bulk Query Custom Organization](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/custom_org/query).<br>**Example value**: "6862995757234914824"
object_api_name | string | Yes | Organization type code, which can be viewed under the corresponding custom organization directory in "Feishu Personnel-Settings-Organization Settings"<br>**Example value**: "custom_org_01"

### Request body example
```json
{
    "org_id": "6862995757234914824",
    "object_api_name": "custom_org_01"
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1160265 | Unable to delete  as it's still in use | Custom organization is in use and cannot be deleted
503 | 1161204 | Requset timeout | Contact Feishu [Oncall](https://applink.feishu.cn/TLJpeNdW)
429 | 1161604 | QPS over limit | Contact Feishu [Oncall](https://applink.feishu.cn/TLJpeNdW)

