# Create timeshift 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" } ] } Endpoint: POST /v1/timeshifts Version: 0.0.4 Security: BearerAuth ## Header parameters: - `company-id` (string) Company MongoDB id used in auth context. Example: "65f4c840b6f1a10012ab34cd" ## Request fields (application/json): - `resource_id` (string) Resource id. Example: "65f4c840b6f1a10012ab34cd" - `external_resource_id` (string) External resource id. Example: "65f4c840b6f1a10012ab34cd" - `from` (string) Start date of the timeshift (YYYY-MM-DD). Example: "2026-03-10" - `to` (string) End date of the timeshift (YYYY-MM-DD, inclusive). Example: "2026-03-11" - `denial_times` (array) Denial times. - `denial_times.begin` (string) Start time in HH:mm format. Example: "08:00" - `denial_times.end` (string) End time in HH:mm format. Example: "17:00" - `working_times` (array) Working times. - `booking_times` (array) Booking times. - `denial_reason` (string) Reason for blocking the time (VACATION, SICK, BLOCKER, OTHER). Enum: "VACATION", "SICK", "BLOCKER", "OTHER" ## 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"}