# Import or update timeshift 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" } ] } Endpoint: POST /v1/timeshifts/import/bulk Version: 0.0.4 Security: BearerAuth ## Header parameters: - `company-id` (string) Company MongoDB id used in auth context. Example: "65f4c840b6f1a10012ab34cd" ## Request fields (application/json): - `shifts` (array) Array of timeshift objects to create or update. - `shifts.resourceId` (string) Example: "62ee11a91d66269c365407b1" - `shifts.externalResourceId` (string) - `shifts.interval` (object) A time range with begin and end times. - `shifts.interval.begin` (string) Start time in HH:mm format. Example: "08:00" - `shifts.interval.end` (string) End time in HH:mm format. Example: "17:00" - `shifts.workingTimes` (array) - `shifts.bookingTimes` (array) - `shifts.denialTimes` (array) - `shifts.denialReason` (string) Enum: "VACATION", "SICK", "BLOCKER", "OTHER" - `url` (string) Url. Example: "https://example.com" - `secret` (string) Secret. Example: "example" - `skip_emitter` (string) Skip emitter. Example: "example" ## Response 201 fields (application/json): - `data` (object) Generic response data object for proxied GraphQL entities. Example: {"id":"65f4c840b6f1a10012ab34cd","externalId":"ext_1001","name":"Demo value"} - `status` (integer) Operation status flag. Example: 1 ## Response 400 fields (application/json): - `error` (string, required) Error message. Example: "Invalid request payload" - `name` (string) Error class name. Example: "BadRequestError" - `errorCode` (string) Application-specific error code. Example: 2 - `details` (object) Structured error details. Example: {"query":{"page":"invalid"}} - `extras` (object,null) Extra error metadata from downstream services. Example: {"code":"GRAPHQL_VALIDATION_FAILED"} ## Response 401 fields (application/json): - `error` (string, required) Error message. Example: "Invalid request payload" - `name` (string) Error class name. Example: "BadRequestError" - `errorCode` (string) Application-specific error code. Example: 2 - `details` (object) Structured error details. Example: {"query":{"page":"invalid"}} - `extras` (object,null) Extra error metadata from downstream services. Example: {"code":"GRAPHQL_VALIDATION_FAILED"} ## Response 404 fields (application/json): - `error` (string, required) Error message. Example: "Invalid request payload" - `name` (string) Error class name. Example: "BadRequestError" - `errorCode` (string) Application-specific error code. Example: 2 - `details` (object) Structured error details. Example: {"query":{"page":"invalid"}} - `extras` (object,null) Extra error metadata from downstream services. Example: {"code":"GRAPHQL_VALIDATION_FAILED"} ## Response 500 fields (application/json): - `error` (string, required) Error message. Example: "Invalid request payload" - `name` (string) Error class name. Example: "BadRequestError" - `errorCode` (string) Application-specific error code. Example: 2 - `details` (object) Structured error details. Example: {"query":{"page":"invalid"}} - `extras` (object,null) Extra error metadata from downstream services. Example: {"code":"GRAPHQL_VALIDATION_FAILED"}