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

# Update Clock-In Time Window Settings

> Call this API to update the clock-in time window settings of an attendance shift and specify whether clock-in is required at a check point.

Call this API to update the clock-in time settings of an attendance shift. This API currently supports only specifying whether clock-in is required at a check point.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/shift/updatepunches](https://api.dingtalk.io/topapi/attendance/shift/updatepunches) |
| HTTP Method | POST |
| Supported App Type | appType-Internal app |
| Required Permissions | permission-qyapi\_attendance\_group\_manage-Attendance group management permission |

### Query Parameters

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

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| op\_user\_id | String | Yes | user456 | The userId of the operator. |
| punches | TopPunchVO\[] | No | | The check point information. |
| id | Number | Yes | 123 | The check point ID. Obtain the id value by calling the [Get Shift Details](https://help.dingtalk.io/open/development/shift-query.md) API. |
| free\_check | Boolean | Yes | true | Specifies whether clock-in is not required.   - **true**: Clock-in exemption is on. - **false**: Clock-in exemption is off. |
| shift\_id | Number | Yes | 456 | The shift ID. Obtain the id value by calling the [Get Shift Summaries](https://help.dingtalk.io/open/development/enterprise-shift-query-in-batches.md) API. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/updatepunches" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=16869xxx0e890' \
-d 'op_user_id=dd' \
-d 'punches=null' \
-d 'shift_id=456'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/updatepunches");
OapiAttendanceShiftUpdatepunchesRequest req = new OapiAttendanceShiftUpdatepunchesRequest();
List<TopPunchVO> punchVOS = new ArrayList<>();
TopPunchVO punchVO = new TopPunchVO();
punchVO.setFreeCheck(true);
punchVO.setId(373271823L);
req.setPunches(punchVOS);
req.setOpUserId("user456");
req.setShiftId(712550377L);
OapiAttendanceShiftUpdatepunchesResponse 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.OapiAttendanceShiftUpdatepunchesRequest("https://api.dingtalk.io/topapi/attendance/shift/updatepunches")

req.op_user_id="dd"
req.punches=""
req.shift_id=456
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 OapiAttendanceShiftUpdatepunchesRequest;
$req->setOpUserId("dd");
$punches = new TopPunchVO;
$punches->id="123";
$punches->free_check="true";
$req->setPunches(array($punches));
$req->setShiftId("456");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/updatepunches");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/updatepunches");
OapiAttendanceShiftUpdatepunchesRequest req = new OapiAttendanceShiftUpdatepunchesRequest();
req.OpUserId = "dd";
List<OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain> list2 = new List<OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain>();
OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain obj3 = new OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain();
list2.Add(obj3);
obj3.Id = 123L;
obj3.FreeCheck = true;
req.Punches_ = list2;
req.ShiftId = 456L;
OapiAttendanceShiftUpdatepunchesResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| success | Boolean | true | Indicates whether the call succeeded.   - **true**: Success - **false**: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | System error | The error message returned when the call fails. |
| request\_id | String | 5moh5icna65x | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "success": true,
  "request_id": "ed67bcymo0bw"
}
```

### Error Codes

If an error occurs when calling this API, find the 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.