# Withdraw process

Rollback a single approval instance in the "Under review" status. The approval process ends after rollback.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v2/process_withdraw/:process_id
HTTP Method | PUT
Rate Limit | [50 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:process.instance:write)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>Obtain user ID(contact:user.employee_id:readonly)

### 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"

### Path parameters

Parameter | Type | Description
---|---|---
process_id | string | Process instance id<br>**Example value**: "7328345170959681068"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
user_id_type | string | No | User ID categories<br>**Example value**: open_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br><md-enum-item key="people_corehr_id" ><br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)

### Request body

Parameter | Type | Required | Description
---|---|---|---
user_id | string | No | Pass the corresponding user ID according to the user ID type specified in the query parameters, which defaults to Open ID.If the system_user is true, this field can be left unfilled.<br>**Example value**: "ou_91791271921729102012"
reason | string | No | reason<br>**Example value**: "原因自定义字符串"<br>**Data validation rules**:<br>- Maximum length: `500` characters
system_user | boolean | No | Whether to operate in the system identity or not. If it is false, the user_id must be filled in.<br>**Example value**: true<br>**Default value**: `false`

### Request body example
```json
{
    "user_id": "ou_91791271921729102012",
    "reason": "原因自定义字符串",
    "system_user": true
}
```

## 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 | 1160101 | Parameter error | Parameter error, please operate the interface field description self-check
403 | 1161003 | No permission. | The designated user is neither the initiator of the process, nor the process administrator, nor the approval form administrator, or has not applied for the permission to withdraw the process via OpenAPI.
400 | 1161005 | The approval status has been updated. | The approval status has been updated. Please try again later.
400 | 1161006 | All approvals have been completed | Please check whether the current process status is completed

