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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | object | Optional | |
body.data | Model | Required within parent | Expand Create shifts — request body — body data |
Referenced models: Create shifts — request body — body data
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create shifts — 201 response body |
Referenced models: Create shifts — 201 response body
Schemas
Section titled “Schemas”9 more schemas are linked from the tables above, on the schema pages.
Create shifts — 201 response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | array | Required within parent | |
data[] | Model | Each item | Expand Create shifts — 201 response body — data item |
Referenced models: Create shifts — 201 response body — data item
Create shifts — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
contract_id | string | Required within parent | The unique identifier of the employee contract. |
shifts | array | Required within parent | |
shifts[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
contract_id | string | Required within parent | Associated contract ID for the shift |
created_at | string | Required within parent | Date when the shift was created Format: date-time |
date_of_work | string | Required within parent | Date when the shift takes place, in YYYY-MM-DD format |
description | string | Required within parent | Description of the shift |
external_id | string | Required within parent | ID specified by the client for uniquely identifying the shift |
meta | Model | Optional | Expand Update a shift — 200 response body — data meta |
payroll_cycle_ref | Model | Optional | Expand Update a shift — 200 response body — data payroll cycle ref Payroll cycle reference |
shift_reference_id | string | Optional | External ID of the original shift this one references (set on correction shifts). Maximum length: 48 Minimum length: 8 |
shift_type | string | Required within parent | Type of the shift Known values: REGULAR, CORRECTION_ABSOLUTE, CORRECTION_DELTA |
summary | Model | Optional | Expand Update a shift — 200 response body — data summary |
updated_at | string | Required within parent | Date 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (oneOf 1) | Model | Alternative | Expand Create shifts — request body — body / data / shifts / item / shift_type: REGULAR |
$ (oneOf 2) | Model | Alternative | Expand Create shifts — request body — body / data / shifts / item / shift_type: CORRECTION ABSOLUTE |
$ (oneOf 3) | Model | Alternative | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
approval_date | string | Optional | Approval date for the shift, in ISO format |
breaks | array | Optional | |
breaks[] | Model | Each item | Expand Update a shift — 200 response body — data meta breaks item |
end | Model | Required within parent | Expand Update a shift — 200 response body — data meta end |
start | Model | Required within parent | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Payroll cycle reference |
date | string | Required within parent | date in ISO Format: date-time |
Update a shift — 200 response body — data summary
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
payable_break_hours | JSON | Optional | |
payable_break_hours (anyOf 1) | number | Alternative | Break hours that are payable Format: double |
payable_break_hours (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
shift_duration_hours | JSON | Optional | |
shift_duration_hours (anyOf 1) | number | Alternative | Total duration of the shift in hours Format: double |
shift_duration_hours (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
shift_rate_external_id | string | Required within parent | External ID of the shift rate associated with this shift |
time_amount | JSON | Optional | |
time_amount (anyOf 1) | number | Alternative | The amount of time for the shift Format: double Minimum: 0 |
time_amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
time_unit | string | Optional | The unit of time for the shift (DAY, HOUR, MONTH, WEEK) Known values: DAY, HOUR, MONTH, WEEK |
total_break_hours | JSON | Optional | |
total_break_hours (anyOf 1) | number | Alternative | Total break duration in hours Format: double |
total_break_hours (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
total_payable_hours | JSON | Optional | |
total_payable_hours (anyOf 1) | number | Alternative | Total payable working hours after break deductions Format: double |
total_payable_hours (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Create shifts — request body — body / data / shifts / item / shift_type: REGULAR
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
date_of_work | string | Required within parent | Pattern: ^\d{4}-\d{2}-\d{2}$ |
description | string | Required within parent | Description of the shift. Maximum length: 30000 Minimum length: 1 |
external_id | string | Required within parent | External ID of the shift. Maximum length: 48 Minimum length: 8 |
payroll_cycle_ref | Model | Optional | Expand Update a shift — 200 response body — data payroll cycle ref Payroll cycle reference |
shift_type | string | Optional | Type of the shift Default: REGULAR One of: REGULAR |
summary | Model | Required within parent | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
date | string | Required within parent | Shift end date |
is_public_holiday | boolean | Required within parent | Indicates if it is a public holiday |
is_rest_day | boolean | Required within parent | Indicates if it is a rest day |
time | string | Required within parent | Shift end time in HH:mm format |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}