> For the complete documentation index, see [llms.txt](https://api-docs.myhappyforce.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.myhappyforce.com/docs/api-reference/company-shift.md).

# Company Shift

## Update a shift record

> Updates an existing shift record by ID. Only provided fields will be updated.

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"paths":{"/api/v1/company/shift/{shiftId}":{"put":{"tags":["Company Shift"],"summary":"Update a shift record","description":"Updates an existing shift record by ID. Only provided fields will be updated.","operationId":"updateShift","parameters":[{"name":"shiftId","in":"path","description":"Shift ID","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftUpdateRequestDTO"}}},"required":true},"responses":{"200":{"description":"Shift updated successfully"},"400":{"description":"Invalid request data"},"404":{"description":"Shift not found"}}}}},"components":{"schemas":{"ShiftUpdateRequestDTO":{"type":"object","description":"Shift update data","properties":{"startTime":{"type":"string","description":"Start time of the shift"},"endTime":{"type":"string","description":"End time of the shift"},"weekDays":{"type":"array","description":"Days of the week when the shift applies. Values: 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday, 7=Sunday","items":{"type":"integer","format":"int32"}}}}}}}
```

## Create a new shift record

> Creates a new shift record for an employee. A shift defines working hours and days of the week when the employee should work.

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"paths":{"/api/v1/company/shift/{companyId}/user/{employeeId}":{"post":{"tags":["Company Shift"],"summary":"Create a new shift record","description":"Creates a new shift record for an employee. A shift defines working hours and days of the week when the employee should work.","operationId":"createShift","parameters":[{"name":"companyId","in":"path","description":"Company ID","required":true,"schema":{"type":"string"}},{"name":"employeeId","in":"path","description":"Employee ID","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftCreateRequestDTO"}}},"required":true},"responses":{"200":{"description":"Shift created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftDTO"}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftDTO"}}}}}}}},"components":{"schemas":{"ShiftCreateRequestDTO":{"type":"object","description":"Shift creation data","properties":{"startTime":{"type":"string","description":"Start time of the shift"},"endTime":{"type":"string","description":"End time of the shift"},"weekDays":{"type":"array","description":"Days of the week when the shift applies. Values: 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday, 7=Sunday","items":{"type":"integer","format":"int32"}}},"required":["endTime","startTime","weekDays"]},"ShiftDTO":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"employeeId":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"weekDays":{"type":"array","items":{"type":"integer","format":"int32"}}}}}}}
```

## Get shifts for a company

> Retrieves all shift records for a company. Supports pagination.

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"paths":{"/api/v1/company/shift/{companyId}":{"get":{"tags":["Company Shift"],"summary":"Get shifts for a company","description":"Retrieves all shift records for a company. Supports pagination.","operationId":"getCompanyShifts","parameters":[{"name":"companyId","in":"path","description":"Company ID","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"Starting index for pagination (default: 0)","required":false,"schema":{"type":"integer","default":0}},{"name":"to","in":"query","description":"Ending index for pagination (default: 10)","required":false,"schema":{"type":"integer","default":10}}],"responses":{"200":{"description":"Successfully retrieved shifts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftDTO"}}}}}}}},"components":{"schemas":{"ShiftDTO":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"employeeId":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"weekDays":{"type":"array","items":{"type":"integer","format":"int32"}}}}}}}
```
