Skip to content

Deel: Create shifts

Deel timeTrackingShifts.createTimeTrackingShifts: arguments, response, policy and SDK examples.

← Time tracking shifts operations · Get started

Operation deel.timetrackingshifts_createtimetrackingshifts

Provider route: POST /v2/time_tracking/shifts. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/deel with npm, or alter-sdk-deel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { DeelIntegration } from "@alter-ai/deel";
async function execute(input: Parameters<DeelIntegration["timeTrackingShifts"]["createTimeTrackingShifts"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new DeelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.timeTrackingShifts.createTimeTrackingShifts(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_deel import DeelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = DeelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.time_tracking_shifts.create_time_tracking_shifts(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyobjectOptional
body.dataModelRequired within parentExpand Create shifts — request body — body data

Referenced models: Create shifts — request body — body data

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create shifts — 201 response body

Referenced models: Create shifts — 201 response body

9 more schemas are linked from the tables above, on the schema pages.

Create shifts — 201 response body
FieldTypePresenceDescription and constraints
$objectRoot
dataarrayRequired within parent
data[]ModelEach itemExpand Create shifts — 201 response body — data item

Referenced models: Create shifts — 201 response body — data item

Create shifts — request body — body data
FieldTypePresenceDescription and constraints
$objectRoot
contract_idstringRequired within parentThe unique identifier of the employee contract.
shiftsarrayRequired within parent
shifts[]ModelEach itemExpand Create shifts — request body — body data shifts item

Referenced models: Create shifts — request body — body data shifts item

Create shifts — 201 response body — data item
FieldTypePresenceDescription and constraints
$objectRoot
contract_idstringRequired within parentAssociated contract ID for the shift
created_atstringRequired within parentDate when the shift was created
Format: date-time
date_of_workstringRequired within parentDate when the shift takes place, in YYYY-MM-DD format
descriptionstringRequired within parentDescription of the shift
external_idstringRequired within parentID specified by the client for uniquely identifying the shift
metaModelOptionalExpand Update a shift — 200 response body — data meta
payroll_cycle_refModelOptionalExpand Update a shift — 200 response body — data payroll cycle ref
Payroll cycle reference
shift_reference_idstringOptionalExternal ID of the original shift this one references (set on correction shifts).
Maximum length: 48
Minimum length: 8
shift_typestringRequired within parentType of the shift
Known values: REGULAR, CORRECTION_ABSOLUTE, CORRECTION_DELTA
summaryModelOptionalExpand Update a shift — 200 response body — data summary
updated_atstringRequired within parentDate when the shift was last updated
Format: date-time

Referenced models: Update a shift — 200 response body — data meta, Update a shift — 200 response body — data payroll cycle ref, Update a shift — 200 response body — data summary

Create shifts — request body — body data shifts item
FieldTypePresenceDescription and constraints
$JSONRoot
$ (oneOf 1)ModelAlternativeExpand Create shifts — request body — body / data / shifts / item / shift_type: REGULAR
$ (oneOf 2)ModelAlternativeExpand Create shifts — request body — body / data / shifts / item / shift_type: CORRECTION ABSOLUTE
$ (oneOf 3)ModelAlternativeExpand Create shifts — request body — body / data / shifts / item / shift_type: CORRECTION DELTA

Referenced models: Create shifts — request body — body / data / shifts / item / shift_type: REGULAR, Create shifts — request body — body / data / shifts / item / shift_type: CORRECTION ABSOLUTE, Create shifts — request body — body / data / shifts / item / shift_type: CORRECTION DELTA

Update a shift — 200 response body — data meta
FieldTypePresenceDescription and constraints
$objectRoot
approval_datestringOptionalApproval date for the shift, in ISO format
breaksarrayOptional
breaks[]ModelEach itemExpand Update a shift — 200 response body — data meta breaks item
endModelRequired within parentExpand Update a shift — 200 response body — data meta end
startModelRequired within parentExpand Update a shift — 200 response body — data meta start

Referenced models: Update a shift — 200 response body — data meta breaks item, Update a shift — 200 response body — data meta end, Update a shift — 200 response body — data meta start

Update a shift — 200 response body — data payroll cycle ref
FieldTypePresenceDescription and constraints
$objectRootPayroll cycle reference
datestringRequired within parentdate in ISO
Format: date-time
Update a shift — 200 response body — data summary
FieldTypePresenceDescription and constraints
$objectRoot
payable_break_hoursJSONOptional
payable_break_hours (anyOf 1)numberAlternativeBreak hours that are payable
Format: double
payable_break_hours (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
shift_duration_hoursJSONOptional
shift_duration_hours (anyOf 1)numberAlternativeTotal duration of the shift in hours
Format: double
shift_duration_hours (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
shift_rate_external_idstringRequired within parentExternal ID of the shift rate associated with this shift
time_amountJSONOptional
time_amount (anyOf 1)numberAlternativeThe amount of time for the shift
Format: double
Minimum: 0
time_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
time_unitstringOptionalThe unit of time for the shift (DAY, HOUR, MONTH, WEEK)
Known values: DAY, HOUR, MONTH, WEEK
total_break_hoursJSONOptional
total_break_hours (anyOf 1)numberAlternativeTotal break duration in hours
Format: double
total_break_hours (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
total_payable_hoursJSONOptional
total_payable_hours (anyOf 1)numberAlternativeTotal payable working hours after break deductions
Format: double
total_payable_hours (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Create shifts — request body — body / data / shifts / item / shift_type: REGULAR
FieldTypePresenceDescription and constraints
$objectRoot
date_of_workstringRequired within parentPattern: ^\d{4}-\d{2}-\d{2}$
descriptionstringRequired within parentDescription of the shift.
Maximum length: 30000
Minimum length: 1
external_idstringRequired within parentExternal ID of the shift.
Maximum length: 48
Minimum length: 8
payroll_cycle_refModelOptionalExpand Update a shift — 200 response body — data payroll cycle ref
Payroll cycle reference
shift_typestringOptionalType of the shift
Default: REGULAR
One of: REGULAR
summaryModelRequired within parentExpand Create shifts — request body — body / data / shifts / item / shift_type: REGULAR summary
Shift summary. The fields here form two mutually exclusive groups — hours-based (`shift_duration_hours`, `total_break_hours`, `payable_break_hours`, `total_payable_hours`) and unit-amount (`time_amount`, `time_unit`) — and the schema cannot express this as a strict either/or because which group is required depends on the shift rate (`shift_rate_external_id`) type, resolved server-side: PER_UNIT_FLAT_RATE requires the unit-amount group, PER_HOUR_FLAT_RATE requires the hours-based group, and MULTIPLIER_PERCENTAGE (or no shift rate) accepts either group but not a mix of both. Sending fields from both groups, or the wrong group for the rate type, is rejected.

Referenced models: Update a shift — 200 response body — data payroll cycle ref, Create shifts — request body — body / data / shifts / item / shift_type: REGULAR summary

Update a shift — 200 response body — data meta end
FieldTypePresenceDescription and constraints
$objectRoot
datestringRequired within parentShift end date
is_public_holidaybooleanRequired within parentIndicates if it is a public holiday
is_rest_daybooleanRequired within parentIndicates if it is a rest day
timestringRequired within parentShift end time in HH:mm format

SDK function policy ID: deel.timetrackingshifts_createtimetrackingshifts. Catalog operation: timetrackingshifts_createtimetrackingshifts. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["time-tracking:write"]

Pinned headers: {"X-Version": "2026-01-01"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.