# Timeshifts Endpoints from `timeshifts` routes module. ## List timeshifts - [GET /v1/timeshifts](https://timify-dev-api.redocly.app/apis/openapi/timeshifts/getv1timeshifts.md): Filter timeshifts: - By resource ids or external ids - For a specific time interval use _from_ and _to_ parameters - For specific days use _day[]_ parameter, day format is YYYY-MM-DD These filters are mutually exclusive and cannot be used at the same time, if fields _from_ and _to_ are sent, _day[]_ will be ignored ## Create timeshift - [POST /v1/timeshifts](https://timify-dev-api.redocly.app/apis/openapi/timeshifts/postv1timeshifts.md): This endpoint creates shifts for a resource on a selected date. It enables the user to create work and booking shifts. There is also an option to create non-workable shifts, for example "VACATION", "SICK" or "BLOCKER" shifts If you select the "BLOCKER" as the _denial_reason_, parameters _working_times_ and _booking_times_ will be ignored Examples: - Work shift: { "from": "2023-10-02", "to": "2023-10-02", "resource_id": "64759027a6f9909999a59431", "working_times": [ { "begin": "08:00", "end": "14:40" }, { "begin": "15:00", "end": "18:00" } ], "booking_times": [ { "begin": "08:00", "end": "14:40" }, { "begin": "15:00", "end": "18:00" } ] } - Vacation: { "denial_reason": "VACATION", "from": "2020-10-20", "to": "2020-10-22", "resource_id": "5f61c6381a34817e5c7fa220", "denial_times": [ { "begin": "00:00", "end": "24:00" } ] } - Sick: { "denial_reason": "SICK", "from": "2020-10-20", "to": "2020-10-22", "resource_id": "5f61c6381a34817e5c7fa220", "denial_times": [ { "begin": "00:00", "end": "24:00" } ] } - Blocker: _working_times_ and _booking_times_ parameters are ignored { "denial_reason": "BLOCKER", "from": "2020-10-20", "to": "2020-10-22", "resource_id": "5f61c6381a34817e5c7fa220", "denial_times": [ { "begin": "00:00", "end": "24:00" } ] } ## Import or update timeshift - [POST /v1/timeshifts/import/bulk](https://timify-dev-api.redocly.app/apis/openapi/timeshifts/postv1timeshiftsimportbulk.md): This endpoint bulk imports shifts for users. It enables the user to create work and booking shifts. There is also an option to create non-workable shifts, for example "VACATION", "SICK" or "BLOCKER" shifts If you select the "BLOCKER" as the _denialReason_, parameters _workingTimes_ and _bookingTimes_ will be ignored. You have to be very careful because the variables here are sent in camelCase. Since all records from this method are not added live, but belatedly we give you the ability to receive progress information via a webhook. You will receive information at the address specified by you as soon as some of the chunks have been processed. To make it easier for you to follow what is happening for each record, you have the option of adding an additional field importShiftAllowanceId or importShiftDenialId. Shift examples: - Work shift: { "interval": { "begin": "2023-10-02", "end": "2023-10-02" }, "resourceId": "64759027a6f9909999a59431", "workingTimes": [ { "begin": "08:00", "end": "14:40" }, { "begin": "15:00", "end": "18:00" } ], "bookingTimes": [ { "begin": "08:00", "end": "14:40" }, { "begin": "15:00", "end": "18:00" } ] } - Vacation: { "denialReason": "VACATION", "interval": { "begin": "2023-10-20", "end": "2023-10-22" }, "resourceId": "5f61c6381a34817e5c7fa220", "denialTimes": [ { "begin": "00:00", "end": "24:00" } ] } - Sick: { "denialReason": "SICK", "interval": { "begin": "2023-10-20", "end": "2023-10-22" }, "resourceId": "5f61c6381a34817e5c7fa220", "denialTimes": [ { "begin": "00:00", "end": "24:00" } ] } - Blocker: _workingTimes_ and _bookingTimes_ parameters are ignored { "denialReason": "BLOCKER", "interval": { "begin": "2023-10-20", "end": "2023-10-22" }, "resourceId": "5f61c6381a34817e5c7fa220", "denialTimes": [ { "begin": "00:00", "end": "24:00" } ] } ## Deletes timeshift - [DELETE /v1/timeshifts/{timeshiftId}](https://timify-dev-api.redocly.app/apis/openapi/timeshifts/deletev1timeshiftsbytimeshiftid.md): Delete a timeshift entry by its ID. ## Fetch timeshift - [GET /v1/timeshifts/{timeshiftId}](https://timify-dev-api.redocly.app/apis/openapi/timeshifts/getv1timeshiftsbytimeshiftid.md): Retrieve a single timeshift entry by its ID. ## Updates timeshift - [PATCH /v1/timeshifts/{timeshiftId}](https://timify-dev-api.redocly.app/apis/openapi/timeshifts/patchv1timeshiftsbytimeshiftid.md): You can find more examples in the _POST /timeshift_ Endpoint