Skip to content

Deel: Update a shift

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

← Time tracking shifts operations · Get started

Operation deel.timetrackingshifts_updatetimetrackingshiftbyexternalid

Provider route: PATCH /time_tracking/shifts/{external_id}. 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"]["updateTimeTrackingShiftByExternalId"]>[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.updateTimeTrackingShiftByExternalId(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.update_time_tracking_shift_by_external_id(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.external_idstringRequired within parent
bodyobjectOptional
body.dataModelRequired within parentExpand Update a shift — request body — body data

Referenced models: Update a shift — 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 Update a shift — 200 response body

Referenced models: Update a shift — 200 response body

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

Update a shift — 200 response body
FieldTypePresenceDescription and constraints
$objectRootShift response wrapper
dataModelRequired within parentExpand Update a shift — 200 response body — data

Referenced models: Update a shift — 200 response body — data

Update a shift — request body — body data
FieldTypePresenceDescription and constraints
$objectRoot
date_of_workstringOptionalThe updated date of the shift, in YYYY-MM-DD format.
Pattern: ^\d{4}-\d{2}-\d{2}$
descriptionstringOptionalThe updated description of the shift.
Maximum length: 30000
Minimum length: 1
payroll_cycle_refModelOptionalExpand Update a shift — 200 response body — data payroll cycle ref
Payroll cycle reference
summaryModelOptionalExpand Update a shift — request body — body data summary

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

Update a shift — 200 response body — data
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, TIME_OFF_QUALIFYING
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

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 — request body — body data summary
FieldTypePresenceDescription and constraints
$objectRoot
payable_break_hoursnumberOptionalBreak hours that are payable. Part of the hours-based summary group (see `shift_duration_hours`).
Greater than: 0
Format: double
shift_duration_hoursnumberOptionalTotal duration of the shift in hours. Part of the hours-based summary group, used when the shift rate is PER_HOUR_FLAT_RATE (or MULTIPLIER_PERCENTAGE/omitted, where either group is accepted). Mutually exclusive with `time_amount`/`time_unit` — do not send both groups.
Greater than: 0
Format: double
shift_rate_external_idstringOptionalExternal ID of the shift rate associated with this shift. Its type (PER_UNIT_FLAT_RATE, PER_HOUR_FLAT_RATE, or MULTIPLIER_PERCENTAGE) determines which of the two field groups below is required — see the group descriptions.
Maximum length: 48
Minimum length: 8
time_amountnumberOptionalThe amount of time for the shift. Part of the unit-amount summary group, required when the shift rate is PER_UNIT_FLAT_RATE (or MULTIPLIER_PERCENTAGE/omitted, where either group is accepted). Mutually exclusive with `shift_duration_hours`/`total_break_hours`/`payable_break_hours`/`total_payable_hours` — do not send both groups.
Greater than: 0
Format: double
total_break_hoursnumberOptionalTotal break duration in hours. Part of the hours-based summary group (see `shift_duration_hours`).
Greater than: 0
Format: double
total_payable_hoursnumberOptionalTotal payable working hours after break deductions. Part of the hours-based summary group (see `shift_duration_hours`).
Greater than: 0
Format: double
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 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]+)?$
Update a shift — 200 response body — data meta breaks item
FieldTypePresenceDescription and constraints
$objectRoot
endModelRequired within parentExpand Update a shift — 200 response body — data meta breaks item end
is_paidbooleanOptionalIndicates if the break is paid
startModelRequired within parentExpand Update a shift — 200 response body — data meta breaks item start

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

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
Update a shift — 200 response body — data meta breaks item end
FieldTypePresenceDescription and constraints
$objectRoot
datestringRequired within parentBreak end date
timestringRequired within parentBreak end time in HH:mm format

SDK function policy ID: deel.timetrackingshifts_updatetimetrackingshiftbyexternalid. Catalog operation: timetrackingshifts_updatetimetrackingshiftbyexternalid. 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.