> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Notify Approval Undo

> Call this API to undo an approved form by user ID and approval ID, reverting related overtime, leave, outing, business trip, or makeup clock-in records.

Call this API to notify an approval undo. Supports overtime, leave request, outing, business trip, and makeup clock-in types.

## API Call Description

After you call the [Notify Approval Completion](https://help.dingtalk.io/open/development/api-processapprovefinish.md) API, a submitted Approval form may need to be undone. In this case, call this API to undo the modified attendance records.

## Request

| **Basic information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/approve/cancel](https://api.dingtalk.io/topapi/attendance/approve/cancel) |
| HTTP Method | POST |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Permissions | permission-qyapi\_attendance\_group\_manage-Attendance group management permission |

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | bE74xxxx | The App credential used to call this API.   - Internal app: Obtain it by calling the [Get the access\_token of an Internal App](https://help.dingtalk.io/open/development/obtain-orgapp-token) API. - Third-party enterprise app: Obtain it by calling the Get the access\_token of a Third-Party Enterprise API. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| userid | String | Yes | manager4220 | The employee's user ID. |
| approve\_id | String | Yes | 2376620852 | The approval ID. Use the value of the custom parameter approve\_id from the [Notify Approval Completion](https://help.dingtalk.io/open/development/api-processapprovefinish.md) API. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/approve/cancel" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=95676xxxxdee' \
-d 'approve_id=1234abcd' \
-d 'userid=dd_dd'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/approve/cancel");
OapiAttendanceApproveCancelRequest req = new OapiAttendanceApproveCancelRequest();
req.setUserid("manager4220");
req.setApproveId("2376620852");
OapiAttendanceApproveCancelResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiAttendanceApproveCancelRequest("https://api.dingtalk.io/topapi/attendance/approve/cancel")

req.userid="dd_dd"
req.approve_id="1234abcd"
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiAttendanceApproveCancelRequest;
$req->setUserid("dd_dd");
$req->setApproveId("1234abcd");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/approve/cancel");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/approve/cancel");
OapiAttendanceApproveCancelRequest req = new OapiAttendanceApproveCancelRequest();
req.Userid = "dd_dd";
req.ApproveId = "1234abcd";
OapiAttendanceApproveCancelResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode":0,
  "errmsg":"ok"
}
```

### Error Codes

If this API returns an error, find a solution in the [Global Error Codes](https://help.dingtalk.io/open/development/server-api-error-codes-1.md) document based on the error message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.