# Create shifts

POST https://api.letsdeel.com/rest/v2/time_tracking/shifts
Content-Type: application/json

Creates multiple time tracking shifts for a contract, supporting both regular shift submissions and corrections that adjust hours for previously processed shifts.
 **Token scopes**: `time-tracking:write`

Reference: https://developer.deel.com/api/endpoints/time-tracking-shifts/create-time-tracking-shifts

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /time_tracking/shifts:
    post:
      operationId: create-time-tracking-shifts
      summary: Create shifts
      description: >-
        Creates multiple time tracking shifts for a contract, supporting both
        regular shift submissions and corrections that adjust hours for
        previously processed shifts.
         **Token scopes**: `time-tracking:write`
      tags:
        - subpackage_timeTrackingShifts
      parameters:
        - name: Authorization
          in: header
          description: >
            ## Authentication

            The Deel API uses bearer tokens to authenticate requests. All API
            calls must be made over HTTPS — calls over plain HTTP or without
            authentication will fail.


            ```curl

            curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
              -H 'Authorization: Bearer YOUR-TOKEN-HERE'
            ```


            [Learn more about authentication](/api/authentication)
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/time-tracking-shifts_createTimeTrackingShifts_Response_201
        '401':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '403':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '404':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '500':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
      requestBody:
        description: >-
          Request body to create time tracking shifts supporting regular shifts
          and correction shifts.
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  $ref: >-
                    #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaData
                  description: >-
                    Request data containing contract ID and shifts to be
                    created.
              required:
                - data
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0SummaryTimeUnit:
      type: string
      enum:
        - HOUR
        - MONTH
        - DAY
        - WEEK
      description: Time unit
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0SummaryTimeUnit
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0Summary:
      type: object
      properties:
        time_unit:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0SummaryTimeUnit
          description: Time unit
        time_amount:
          type: number
          format: double
          description: Time amount
        shift_rate_external_id:
          type: string
          description: Shift Rate external ID
      required:
        - time_unit
        - time_amount
        - shift_rate_external_id
      description: Summary of calculated time and rates for the shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0Summary
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0ShiftType:
      type: string
      enum:
        - REGULAR
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0ShiftType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0PayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0PayrollCycleRef
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems0:
      type: object
      properties:
        summary:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0Summary
          description: Summary of calculated time and rates for the shift.
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0ShiftType
          description: Type of the shift
        description:
          type: string
          description: Description of the shift.
        external_id:
          type: string
          description: External ID of the shift.
        date_of_work:
          type: string
          format: date
          description: Date of shift work
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf0PayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
      required:
        - summary
        - description
        - external_id
        - date_of_work
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems0
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1Summary:
      type: object
      properties:
        time_amount:
          type: number
          format: double
          description: Time amount
      required:
        - time_amount
      description: Summary of calculated time and rates for the correction shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1Summary
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1ShiftType:
      type: string
      enum:
        - CORRECTION_ABSOLUTE
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1ShiftType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1PayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1PayrollCycleRef
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems1:
      type: object
      properties:
        summary:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1Summary
          description: Summary of calculated time and rates for the correction shift.
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1ShiftType
          description: Type of the shift
        description:
          type: string
          description: Description of the correction shift.
        external_id:
          type: string
          description: External ID of the correction shift.
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf1PayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
        shift_reference_id:
          type: string
          description: External ID of the original shift being corrected
      required:
        - summary
        - shift_type
        - description
        - external_id
        - shift_reference_id
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems1
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2ShiftType:
      type: string
      enum:
        - CORRECTION_DELTA
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2ShiftType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2CorrectionsItemsType:
      type: string
      enum:
        - SUBTRACTION
        - ADDITION
      description: Type of correction
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2CorrectionsItemsType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2CorrectionsItems:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2CorrectionsItemsType
          description: Type of correction
        time_amount:
          type: number
          format: double
          description: Time amount
      required:
        - type
        - time_amount
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2CorrectionsItems
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2PayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2PayrollCycleRef
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems2:
      type: object
      properties:
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2ShiftType
          description: Type of the shift
        corrections:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2CorrectionsItems
          description: Array of correction adjustments to apply to the original shift.
        description:
          type: string
          description: Description of the correction shift.
        external_id:
          type: string
          description: External ID of the correction shift.
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf2PayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
        shift_reference_id:
          type: string
          description: External ID of the original shift being corrected
      required:
        - shift_type
        - corrections
        - description
        - external_id
        - shift_reference_id
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems2
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3Summary:
      type: object
      properties:
        total_break_hours:
          type: number
          format: double
          description: Total break hours
        payable_break_hours:
          type: number
          format: double
          description: Payable break hours
        total_payable_hours:
          type: number
          format: double
          description: Total payable hours
        shift_duration_hours:
          type: number
          format: double
          description: Shift duration hours
        shift_rate_external_id:
          type: string
          description: Shift Rate external ID
      required:
        - total_payable_hours
        - shift_rate_external_id
      description: Summary of calculated hours and rates for the shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3Summary
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3ShiftType:
      type: string
      enum:
        - REGULAR
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3ShiftType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3PayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3PayrollCycleRef
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems3:
      type: object
      properties:
        summary:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3Summary
          description: Summary of calculated hours and rates for the shift.
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3ShiftType
          description: Type of the shift
        description:
          type: string
          description: Description of the shift.
        external_id:
          type: string
          description: External ID of the shift.
        date_of_work:
          type: string
          format: date
          description: Date of shift work
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf3PayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
      required:
        - summary
        - description
        - external_id
        - date_of_work
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems3
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4Summary:
      type: object
      properties:
        total_break_hours:
          type: number
          format: double
          description: Absolute total break hours
        payable_break_hours:
          type: number
          format: double
          description: Absolute payable break hours
        total_payable_hours:
          type: number
          format: double
          description: Absolute total payable hours
        shift_duration_hours:
          type: number
          format: double
          description: Absolute shift duration hours
      required:
        - total_payable_hours
      description: Summary of calculated hours and rates for the correction shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4Summary
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4ShiftType:
      type: string
      enum:
        - CORRECTION_ABSOLUTE
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4ShiftType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4PayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4PayrollCycleRef
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems4:
      type: object
      properties:
        summary:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4Summary
          description: Summary of calculated hours and rates for the correction shift.
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4ShiftType
          description: Type of the shift
        description:
          type: string
          description: Description of the correction shift.
        external_id:
          type: string
          description: External ID of the correction shift.
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf4PayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
        shift_reference_id:
          type: string
          description: External ID of the original shift being corrected
      required:
        - summary
        - shift_type
        - description
        - external_id
        - shift_reference_id
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems4
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5ShiftType:
      type: string
      enum:
        - CORRECTION_DELTA
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5ShiftType
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5CorrectionsItems:
      type: object
      properties:
        type:
          type: string
          description: Type of correction
        total_break_hours:
          type: number
          format: double
          description: Break hours to add or subtract
        payable_break_hours:
          type: number
          format: double
          description: Payable break hours to add or subtract
        total_payable_hours:
          type: number
          format: double
          description: Payable hours to add or subtract
        shift_duration_hours:
          type: number
          format: double
          description: Shift duration hours to add or subtract
      required:
        - type
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5CorrectionsItems
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5PayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5PayrollCycleRef
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems5:
      type: object
      properties:
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5ShiftType
          description: Type of the shift
        corrections:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5CorrectionsItems
          description: Array of correction adjustments to apply to the original shift.
        description:
          type: string
          description: Description of the correction shift.
        external_id:
          type: string
          description: External ID of the correction shift.
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItemsOneOf5PayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
        shift_reference_id:
          type: string
          description: External ID of the original shift being corrected
      required:
        - shift_type
        - corrections
        - description
        - external_id
        - shift_reference_id
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems5
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems:
      oneOf:
        - $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems0
        - $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems1
        - $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems2
        - $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems3
        - $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems4
        - $ref: >-
            #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems5
      title: >-
        TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems
    TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        shifts:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaDataShiftsItems
          description: >-
            Array of shift records to be created, supporting regular shifts and
            correction shifts.
        contract_id:
          type: string
          description: The unique identifier of the employee contract.
      required:
        - shifts
        - contract_id
      description: Request data containing contract ID and shifts to be created.
      title: TimeTrackingShiftsPostRequestBodyContentApplicationJsonSchemaData
    TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsSummaryTimeUnit:
      type: string
      enum:
        - HOUR
        - DAY
        - WEEK
        - MONTH
      description: Time unit
      title: >-
        TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsSummaryTimeUnit
    TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsSummary:
      type: object
      properties:
        time_unit:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsSummaryTimeUnit
          description: Time unit
        time_amount:
          type: number
          format: double
          description: Time amount
        total_break_hours:
          type: number
          format: double
          description: Total break hours
        payable_break_hours:
          type: number
          format: double
          description: Payable break hours
        total_payable_hours:
          type: number
          format: double
          description: Total payable hours
        shift_duration_hours:
          type: number
          format: double
          description: Shift duration hours
        shift_rate_external_id:
          type: string
          description: Shift rate external ID
      required:
        - shift_rate_external_id
      description: Summary of calculated time and rates for the shift.
      title: >-
        TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsSummary
    TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsShiftType:
      type: string
      enum:
        - REGULAR
        - CORRECTION_ABSOLUTE
        - CORRECTION_DELTA
      description: Type of the shift
      title: >-
        TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsShiftType
    TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsPayrollCycleRef:
      type: object
      properties:
        date:
          type: string
          format: date-time
          description: Date in ISO 8601 format that helps referencing a payroll cycle
      required:
        - date
      description: Reference to the payroll cycle associated with this shift.
      title: >-
        TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsPayrollCycleRef
    TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItems:
      type: object
      properties:
        summary:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsSummary
          description: Summary of calculated time and rates for the shift.
        created_at:
          type: string
          format: date-time
          description: Creation timestamp of the shift.
        shift_type:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsShiftType
          description: Type of the shift
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp of the shift.
        contract_id:
          type: string
          description: The unique identifier of the employee contract.
        description:
          type: string
          description: Description of the shift.
        external_id:
          type: string
          description: Unique identifier of the shift.
        date_of_work:
          type: string
          format: date
          description: Date of the shift.
        payroll_cycle_ref:
          $ref: >-
            #/components/schemas/TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItemsPayrollCycleRef
          description: Reference to the payroll cycle associated with this shift.
        shift_reference_id:
          type: string
          description: Reference ID for the shift
      required:
        - summary
        - shift_type
        - contract_id
        - description
        - external_id
        - date_of_work
      title: TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItems
    time-tracking-shifts_createTimeTrackingShifts_Response_201:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeTrackingShiftsPostResponsesContentApplicationJsonSchemaDataItems
          description: List of created shift records.
      required:
        - data
      title: time-tracking-shifts_createTimeTrackingShifts_Response_201
    ApiErrorRequest:
      type: object
      properties:
        method:
          type: string
          description: The HTTP method of the failed request
        url:
          type: string
          description: The relative URL of the failed request
        status:
          type: number
          format: double
          description: The status code of the response
        api_req_id:
          type: string
          description: The request ID of the failed request
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        source:
          type: string
          description: The source handler which produced the returned error
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
      title: ApiErrorRequest
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: A description of the returned error
        path:
          type: string
          description: The JSON path where input validation failed
      title: ApiError
    ApiErrorContainer:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/ApiErrorRequest'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      title: ApiErrorContainer
  securitySchemes:
    deelToken:
      type: http
      scheme: bearer
      description: >
        ## Authentication

        The Deel API uses bearer tokens to authenticate requests. All API calls
        must be made over HTTPS — calls over plain HTTP or without
        authentication will fail.


        ```curl

        curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
          -H 'Authorization: Bearer YOUR-TOKEN-HERE'
        ```


        [Learn more about authentication](/api/authentication)
    oauth2:
      type: http
      scheme: bearer
      description: >-
        Standard OAuth2 security scheme based on
        https://swagger.io/docs/specification/authentication/

```

## SDK Code Examples

```python
import requests

url = "https://api.letsdeel.com/rest/v2/time_tracking/shifts"

payload = { "data": {
        "shifts": [
            {
                "summary": {
                    "time_unit": "HOUR",
                    "time_amount": 2,
                    "shift_rate_external_id": "abcd"
                },
                "description": "sample description",
                "external_id": "shift_123456",
                "date_of_work": "2023-10-01"
            }
        ],
        "contract_id": "3j5z2e6"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/v2/time_tracking/shifts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"data":{"shifts":[{"summary":{"time_unit":"HOUR","time_amount":2,"shift_rate_external_id":"abcd"},"description":"sample description","external_id":"shift_123456","date_of_work":"2023-10-01"}],"contract_id":"3j5z2e6"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/v2/time_tracking/shifts"

	payload := strings.NewReader("{\n  \"data\": {\n    \"shifts\": [\n      {\n        \"summary\": {\n          \"time_unit\": \"HOUR\",\n          \"time_amount\": 2,\n          \"shift_rate_external_id\": \"abcd\"\n        },\n        \"description\": \"sample description\",\n        \"external_id\": \"shift_123456\",\n        \"date_of_work\": \"2023-10-01\"\n      }\n    ],\n    \"contract_id\": \"3j5z2e6\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/v2/time_tracking/shifts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"data\": {\n    \"shifts\": [\n      {\n        \"summary\": {\n          \"time_unit\": \"HOUR\",\n          \"time_amount\": 2,\n          \"shift_rate_external_id\": \"abcd\"\n        },\n        \"description\": \"sample description\",\n        \"external_id\": \"shift_123456\",\n        \"date_of_work\": \"2023-10-01\"\n      }\n    ],\n    \"contract_id\": \"3j5z2e6\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.letsdeel.com/rest/v2/time_tracking/shifts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"shifts\": [\n      {\n        \"summary\": {\n          \"time_unit\": \"HOUR\",\n          \"time_amount\": 2,\n          \"shift_rate_external_id\": \"abcd\"\n        },\n        \"description\": \"sample description\",\n        \"external_id\": \"shift_123456\",\n        \"date_of_work\": \"2023-10-01\"\n      }\n    ],\n    \"contract_id\": \"3j5z2e6\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/v2/time_tracking/shifts', [
  'body' => '{
  "data": {
    "shifts": [
      {
        "summary": {
          "time_unit": "HOUR",
          "time_amount": 2,
          "shift_rate_external_id": "abcd"
        },
        "description": "sample description",
        "external_id": "shift_123456",
        "date_of_work": "2023-10-01"
      }
    ],
    "contract_id": "3j5z2e6"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/time_tracking/shifts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"data\": {\n    \"shifts\": [\n      {\n        \"summary\": {\n          \"time_unit\": \"HOUR\",\n          \"time_amount\": 2,\n          \"shift_rate_external_id\": \"abcd\"\n        },\n        \"description\": \"sample description\",\n        \"external_id\": \"shift_123456\",\n        \"date_of_work\": \"2023-10-01\"\n      }\n    ],\n    \"contract_id\": \"3j5z2e6\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["data": [
    "shifts": [
      [
        "summary": [
          "time_unit": "HOUR",
          "time_amount": 2,
          "shift_rate_external_id": "abcd"
        ],
        "description": "sample description",
        "external_id": "shift_123456",
        "date_of_work": "2023-10-01"
      ]
    ],
    "contract_id": "3j5z2e6"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/time_tracking/shifts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```