{"openapi":"3.1.0","info":{"title":"Shiftly Partner API","version":"v1","description":"Read a business's rostering, time, leave and staff records in Shiftly, and change its rostering, time, leave and projects, with the permissions the business gave your app."},"servers":[{"url":"https://host.shiftly.au/v1","description":"Production"},{"url":"https://demo.shiftly.au/v1","description":"Sandbox"}],"tags":[{"name":"Connection","description":"The link between your app and one business. Every access credential belongs to exactly one.","x-group":"Connection"},{"name":"Business","description":"The business this connection is for.","x-group":"Business"},{"name":"Locations","description":"The places a business operates. A location owns the timezone for everything that happens there.","x-group":"Business"},{"name":"Positions","description":"The jobs people are rostered into at a location.","x-group":"Business"},{"name":"Public holidays","description":"The public holidays each location observes, worked out the way Shiftly pays them, including days the business added or removed.","x-group":"Business"},{"name":"Projects","description":"Jobs or cost centres that shifts and timesheets are recorded against. The business may call them something else in Shiftly. Archive a project by changing its status; projects are not deleted.","x-group":"Business"},{"name":"Employees","description":"The people who work at the business. A person is added in Shiftly, not through the API. Someone who has left is an archived employment; their own record is no longer shared with the business.","x-group":"People"},{"name":"Employments","description":"A person's job at the business: when it started, on what basis, and (with the pay permission) what they are paid. An employment is created and ended in Shiftly.","x-group":"People"},{"name":"Rosters","description":"One roster per location per week. Reading never creates one: a week nobody has rostered yet returns nothing. Rosters are published in Shiftly.","x-group":"Rostering"},{"name":"Shifts","description":"Rostered shifts. A shift your app creates is a draft until a manager publishes the roster in Shiftly. Any shift that has not started can be changed or deleted; a change to a published shift makes it a draft again until a manager republishes.","x-group":"Rostering"},{"name":"Who can cover a shift","description":"Staff at the shift's location who may work its position and are free: no overlapping shift, no approved or pending leave, and not unavailable. The list is not ranked.","x-group":"Rostering"},{"name":"Open-shift requests","description":"Staff asking to work a published shift nobody holds. Managers decide them in Shiftly. A request is removed, not kept, when the shift is deleted or the person is given an overlapping shift.","x-group":"Rostering"},{"name":"OnDemand shifts","description":"Shifts a venue offers to independent workers through Shiftly OnDemand. Your app can create, change and delete drafts. The venue sets the hourly rate and publishes each shift in Shiftly. Nothing about the worker is shared.","x-group":"OnDemand"},{"name":"Shift swaps","description":"Staff offering a shift to a named colleague, who accepts or declines in Shiftly. A cancelled offer is removed, not kept.","x-group":"Rostering"},{"name":"Timesheets","description":"Worked time. A timesheet your app creates is pending until a manager approves it in Shiftly. Pay is always worked out by Shiftly.","x-group":"Time"},{"name":"Who's on now","description":"Staff clocked in right now: one row per open timesheet started in the last 24 hours, earliest clock-in first. It says where a person is, so read it when you need it rather than polling it.","x-group":"Time"},{"name":"Timesheet totals","description":"Hours, counts and cost of timesheets started in a date range, split into approved and pending. Rejected timesheets and timesheets still open are left out, and a range with none returns no rows. Totals are rounded once, so they can differ by a few cents from adding up each timesheet.","x-group":"Time"},{"name":"Labour costs","description":"Rostered and actual hours and cost per calendar day and location, against the location's labour target. Rostered figures need rostering access and actual figures need timesheet access; costs need pay access. Days with no shifts or timesheets are left out. Sales are not included, so the labour percentage itself is yours to work out.","x-group":"Time"},{"name":"Leave requests","description":"Requests for leave. A request your app submits is pending until a manager decides it in Shiftly. Dates are calendar days at the business's first location.","x-group":"Leave"},{"name":"Leave blackout periods","description":"Periods when the business limits leave, such as a busy season. Dates are calendar days at the business's first location.","x-group":"Leave"},{"name":"Leave balances","description":"What leave a person has, by leave type. Worked out when you ask, so there is nothing to page through.","x-group":"Leave"},{"name":"Leave types","description":"The kinds of leave this business offers and how each builds up.","x-group":"Leave"},{"name":"Availability","description":"When people have said they can and cannot work. Each record is a rule that may repeat, not a list of days.","x-group":"Rostering"},{"name":"Awards","description":"The Fair Work awards this business pays under.","x-group":"Pay rules"}],"paths":{"/connection":{"get":{"operationId":"get_connection","tags":["Connection"],"summary":"Get this connection","x-required-permissions":[],"security":[{"accessCredential":[]},{"oauth2":[]}],"parameters":[],"responses":{"200":{"description":"Get this connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/business":{"get":{"operationId":"get_business","tags":["Business"],"summary":"Get the connected business","description":"Needs the settings:read permission.","x-required-permissions":["settings:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read"]}],"parameters":[],"responses":{"200":{"description":"Get the connected business","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Business"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/locations":{"get":{"operationId":"list_locations","tags":["Locations"],"summary":"List locations","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."}],"responses":{"200":{"description":"List locations","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/locations/{id}":{"get":{"operationId":"get_locations","tags":["Locations"],"summary":"Get one location","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one location","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Location"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/positions":{"get":{"operationId":"list_positions","tags":["Positions"],"summary":"List positions","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."}],"responses":{"200":{"description":"List positions","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/positions/{id}":{"get":{"operationId":"get_positions","tags":["Positions"],"summary":"Get one position","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one position","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Position"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/public-holidays":{"get":{"operationId":"list_public_holidays","tags":["Public holidays"],"summary":"List public holidays at each location in a date range","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 366 days."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."}],"responses":{"200":{"description":"List public holidays at each location in a date range","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicHoliday"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects":{"get":{"operationId":"list_projects","tags":["Projects"],"summary":"List projects","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]},"description":"Only records in this status."}],"responses":{"200":{"description":"List projects","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_projects","tags":["Projects"],"summary":"Create a project","description":"Needs the projects:write permission.","x-required-permissions":["projects:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["projects:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"code":{"type":"string","minLength":1,"maxLength":20},"colour":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"employee_ids":{"maxItems":500,"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{24}$"}}},"required":["name","code"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{id}":{"get":{"operationId":"get_projects","tags":["Projects"],"summary":"Get one project","description":"Needs any one of: settings:read, roster:read, timesheets:read, people:read, leave:read.","x-required-permissions":["settings:read","roster:read","timesheets:read","people:read","leave:read"],"security":[{"accessCredential":[]},{"oauth2":["settings:read","roster:read","timesheets:read","people:read","leave:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update_projects","tags":["Projects"],"summary":"Change or archive a project","description":"Needs the projects:write permission.","x-required-permissions":["projects:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"code":{"type":"string","minLength":1,"maxLength":20},"colour":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"employee_ids":{"maxItems":500,"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{24}$"}},"status":{"type":"string","enum":["active","archived"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Change or archive a project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/employees":{"get":{"operationId":"list_employees","tags":["Employees"],"summary":"List employees","description":"Needs the people:read permission.","x-required-permissions":["people:read"],"security":[{"accessCredential":[]},{"oauth2":["people:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."}],"responses":{"200":{"description":"List employees","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/employees/{id}":{"get":{"operationId":"get_employees","tags":["Employees"],"summary":"Get one employee","description":"Needs the people:read permission.","x-required-permissions":["people:read"],"security":[{"accessCredential":[]},{"oauth2":["people:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one employee","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employee"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update_employees","tags":["Employees"],"summary":"Not available: changing staff details","description":"Staff details are changed in Shiftly, not by partner apps.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"Staff details are changed in Shiftly, not by partner apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/employments":{"get":{"operationId":"list_employments","tags":["Employments"],"summary":"List employments","description":"Needs the people:read permission.","x-required-permissions":["people:read"],"security":[{"accessCredential":[]},{"oauth2":["people:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List employments","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Employment"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/employments/{id}":{"get":{"operationId":"get_employments","tags":["Employments"],"summary":"Get one employment","description":"Needs the people:read permission.","x-required-permissions":["people:read"],"security":[{"accessCredential":[]},{"oauth2":["people:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one employment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Employment"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update_employments","tags":["Employments"],"summary":"Not available: changing an employment","description":"Employments are changed in Shiftly, not by partner apps.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"Employments are changed in Shiftly, not by partner apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rosters":{"get":{"operationId":"list_rosters","tags":["Rosters"],"summary":"List rosters","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."}],"responses":{"200":{"description":"List rosters","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Roster"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rosters/{id}":{"get":{"operationId":"get_rosters","tags":["Rosters"],"summary":"Get one roster","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one roster","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Roster"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shifts":{"get":{"operationId":"list_shifts","tags":["Shifts"],"summary":"List shifts","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List shifts","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Shift"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_shifts","tags":["Shifts"],"summary":"Create one draft shift, or up to 100 in one all-or-nothing request","description":"Needs the roster:write permission.","x-required-permissions":["roster:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["roster:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"employee_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{24}$"},{"type":"null"}]},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"breaks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"offset_minutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"duration_minutes":{"type":"integer","minimum":1,"maximum":9007199254740991},"paid":{"type":"boolean"}},"required":["offset_minutes","duration_minutes","paid"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["location_id","position_id","start_time","end_time"],"additionalProperties":false},{"type":"object","properties":{"data":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"employee_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{24}$"},{"type":"null"}]},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"breaks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"offset_minutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"duration_minutes":{"type":"integer","minimum":1,"maximum":9007199254740991},"paid":{"type":"boolean"}},"required":["offset_minutes","duration_minutes","paid"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["location_id","position_id","start_time","end_time"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Create one draft shift, or up to 100 in one all-or-nothing request","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Shift"},{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Things Shiftly noticed and went ahead with anyway, such as a person's stated unavailability."}}}]},{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Shift"}},"warnings":{"type":"array","items":{"type":"string"},"description":"Things Shiftly noticed and went ahead with anyway, such as a person's stated unavailability."}}}]}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shifts/{id}":{"get":{"operationId":"get_shifts","tags":["Shifts"],"summary":"Get one shift","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one shift","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shift"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update_shifts","tags":["Shifts"],"summary":"Change a shift that has not started","description":"Needs the roster:write permission.","x-required-permissions":["roster:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["roster:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"employee_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{24}$"},{"type":"null"}]},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"breaks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"offset_minutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"duration_minutes":{"type":"integer","minimum":1,"maximum":9007199254740991},"paid":{"type":"boolean"}},"required":["offset_minutes","duration_minutes","paid"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Change a shift that has not started","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Shift"},{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Things Shiftly noticed and went ahead with anyway, such as a person's stated unavailability."}}}]}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, shift_started, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete_shifts","tags":["Shifts"],"summary":"Delete a shift that has not started","description":"Needs the roster:write permission.","x-required-permissions":["roster:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["roster:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"responses":{"200":{"description":"Delete a shift that has not started","content":{"application/json":{"schema":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"deleted":{"type":"boolean","const":true}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, shift_started, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shifts/{id}/publish":{"post":{"operationId":"publish_shifts","tags":["Shifts"],"summary":"Not available: publishing","description":"Rosters are published in Shiftly, not by partner apps.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"Rosters are published in Shiftly, not by partner apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shifts/{id}/covers":{"get":{"operationId":"list_shift_covers","tags":["Who can cover a shift"],"summary":"List who can cover a shift","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"List who can cover a shift","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShiftCover"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/open-shift-requests":{"get":{"operationId":"list_open_shift_requests","tags":["Open-shift requests"],"summary":"List open-shift requests","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","accepted","rejected"]},"description":"Only records in this status."},{"name":"shift_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List open-shift requests","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OpenShiftRequest"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/open-shift-requests/{id}":{"get":{"operationId":"get_open_shift_requests","tags":["Open-shift requests"],"summary":"Get one open-shift request","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one open-shift request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenShiftRequest"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/on-demand-shifts":{"get":{"operationId":"list_on_demand_shifts","tags":["OnDemand shifts"],"summary":"List OnDemand shifts","description":"Needs the ondemand:read permission.","x-required-permissions":["ondemand:read"],"security":[{"accessCredential":[]},{"oauth2":["ondemand:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","posted","filled","in_progress","completed","no_show","expired"]},"description":"Only records in this status."}],"responses":{"200":{"description":"List OnDemand shifts","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OnDemandShift"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_on_demand_shifts","tags":["OnDemand shifts"],"summary":"Create one draft OnDemand shift, or up to 100 in one all-or-nothing request","description":"Needs the ondemand:write permission.","x-required-permissions":["ondemand:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["ondemand:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["location_id","position_id","start_time","end_time"],"additionalProperties":false},{"type":"object","properties":{"data":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["location_id","position_id","start_time","end_time"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Create one draft OnDemand shift, or up to 100 in one all-or-nothing request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OnDemandShift"},{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OnDemandShift"}}}}]}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended, app_suspended or ondemand_unavailable. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/on-demand-shifts/{id}":{"get":{"operationId":"get_on_demand_shifts","tags":["OnDemand shifts"],"summary":"Get one OnDemand shift","description":"Needs the ondemand:read permission.","x-required-permissions":["ondemand:read"],"security":[{"accessCredential":[]},{"oauth2":["ondemand:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one OnDemand shift","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnDemandShift"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update_on_demand_shifts","tags":["OnDemand shifts"],"summary":"Change a draft OnDemand shift that has not started","description":"Needs the ondemand:write permission.","x-required-permissions":["ondemand:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["ondemand:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Change a draft OnDemand shift that has not started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnDemandShift"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended, app_suspended or ondemand_unavailable. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, shift_started, not_a_draft, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete_on_demand_shifts","tags":["OnDemand shifts"],"summary":"Delete a draft OnDemand shift","description":"Needs the ondemand:write permission.","x-required-permissions":["ondemand:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["ondemand:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"responses":{"200":{"description":"Delete a draft OnDemand shift","content":{"application/json":{"schema":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"deleted":{"type":"boolean","const":true}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended, app_suspended or ondemand_unavailable. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, shift_started, not_a_draft, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/on-demand-shifts/{id}/publish":{"post":{"operationId":"publish_on_demand_shifts","tags":["OnDemand shifts"],"summary":"Not available: publishing","description":"The venue sets the rate and publishes OnDemand shifts in Shiftly.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"The venue sets the rate and publishes OnDemand shifts in Shiftly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shift-swaps":{"get":{"operationId":"list_shift_swaps","tags":["Shift swaps"],"summary":"List shift swaps","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","accepted","rejected"]},"description":"Only records in this status."},{"name":"shift_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List shift swaps","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShiftSwap"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shift-swaps/{id}":{"get":{"operationId":"get_shift_swaps","tags":["Shift swaps"],"summary":"Get one shift swap","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one shift swap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftSwap"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/timesheets":{"get":{"operationId":"list_timesheets","tags":["Timesheets"],"summary":"List timesheets","description":"Needs the timesheets:read permission.","x-required-permissions":["timesheets:read"],"security":[{"accessCredential":[]},{"oauth2":["timesheets:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List timesheets","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Timesheet"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_timesheets","tags":["Timesheets"],"summary":"Create one pending timesheet, or up to 100 in one all-or-nothing request","description":"Needs the timesheets:write permission.","x-required-permissions":["timesheets:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["timesheets:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"shift_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"breaks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"paid":{"type":"boolean"}},"required":["start","end","paid"],"additionalProperties":false}},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["employee_id","location_id","position_id","start_time","end_time"],"additionalProperties":false},{"type":"object","properties":{"data":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"shift_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"breaks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"paid":{"type":"boolean"}},"required":["start","end","paid"],"additionalProperties":false}},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["employee_id","location_id","position_id","start_time","end_time"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Create one pending timesheet, or up to 100 in one all-or-nothing request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Timesheet"},{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Timesheet"}}}}]}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/timesheets/{id}":{"get":{"operationId":"get_timesheets","tags":["Timesheets"],"summary":"Get one timesheet","description":"Needs the timesheets:read permission.","x-required-permissions":["timesheets:read"],"security":[{"accessCredential":[]},{"oauth2":["timesheets:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one timesheet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Timesheet"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"update_timesheets","tags":["Timesheets"],"summary":"Correct a pending timesheet","description":"Needs the timesheets:write permission.","x-required-permissions":["timesheets:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["timesheets:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"breaks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"paid":{"type":"boolean"}},"required":["start","end","paid"],"additionalProperties":false}},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Correct a pending timesheet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Timesheet"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, timesheet_not_pending, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete_timesheets","tags":["Timesheets"],"summary":"Delete a pending timesheet","description":"Needs the timesheets:write permission.","x-required-permissions":["timesheets:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["timesheets:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"responses":{"200":{"description":"Delete a pending timesheet","content":{"application/json":{"schema":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"deleted":{"type":"boolean","const":true}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, timesheet_not_pending, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/timesheets/{id}/approve":{"post":{"operationId":"approve_timesheets","tags":["Timesheets"],"summary":"Not available: approving","description":"Timesheets are approved in Shiftly, not by partner apps.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"Timesheets are approved in Shiftly, not by partner apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/whos-on":{"get":{"operationId":"list_whos_on","tags":["Who's on now"],"summary":"List the staff clocked in now","description":"Needs the timesheets:read permission.","x-required-permissions":["timesheets:read"],"security":[{"accessCredential":[]},{"oauth2":["timesheets:read"]}],"parameters":[{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List the staff clocked in now","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClockedIn"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/timesheet-totals":{"get":{"operationId":"list_timesheet_totals","tags":["Timesheet totals"],"summary":"Total timesheets over a date range","description":"Needs the timesheets:read permission.","x-required-permissions":["timesheets:read"],"security":[{"accessCredential":[]},{"oauth2":["timesheets:read"]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["employee","location","day"]}}],"responses":{"200":{"description":"Total timesheets over a date range","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TimesheetTotals"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/labour-costs":{"get":{"operationId":"list_labour_costs","tags":["Labour costs"],"summary":"List rostered and actual labour by day and location","description":"Needs any one of: roster:read, timesheets:read.","x-required-permissions":["roster:read","timesheets:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read","timesheets:read"]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 31 days."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"location_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this location."},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["position"]}}],"responses":{"200":{"description":"List rostered and actual labour by day and location","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LabourCostDay"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-requests":{"get":{"operationId":"list_leave_requests","tags":["Leave requests"],"summary":"List leave requests","description":"Needs the leave:read permission.","x-required-permissions":["leave:read"],"security":[{"accessCredential":[]},{"oauth2":["leave:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","declined","cancelled"]},"description":"Only records in this status."}],"responses":{"200":{"description":"List leave requests","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaveRequest"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_leave_requests","tags":["Leave requests"],"summary":"Submit a pending leave request for a person","description":"Needs the leave:write permission.","x-required-permissions":["leave:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["leave:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$"},"leave_type":{"type":"string","minLength":1,"maxLength":100},"start_date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"end_date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["employee_id","leave_type","start_date","end_date"],"additionalProperties":false}}}},"responses":{"201":{"description":"Submit a pending leave request for a person","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveRequest"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-requests/{id}":{"get":{"operationId":"get_leave_requests","tags":["Leave requests"],"summary":"Get one leave request","description":"Needs the leave:read permission.","x-required-permissions":["leave:read"],"security":[{"accessCredential":[]},{"oauth2":["leave:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one leave request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveRequest"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-requests/{id}/cancel":{"post":{"operationId":"cancel_leave_requests","tags":["Leave requests"],"summary":"Cancel a pending leave request your app submitted","description":"Needs the leave:write permission.","x-required-permissions":["leave:write"],"x-idempotent-with-key":true,"security":[{"accessCredential":[]},{"oauth2":["leave:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes a retry safe. Kept for 24 hours for each connection."}],"responses":{"200":{"description":"Cancel a pending leave request your app submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveRequest"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The error's code is conflict, leave_not_pending, idempotency_key_reused or request_in_progress. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is wrong. The field property names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-requests/{id}/approve":{"post":{"operationId":"approve_leave_requests","tags":["Leave requests"],"summary":"Not available: approving","description":"Leave is approved and declined in Shiftly, not by partner apps.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"Leave is approved and declined in Shiftly, not by partner apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-requests/{id}/decline":{"post":{"operationId":"decline_leave_requests","tags":["Leave requests"],"summary":"Not available: declining","description":"Leave is approved and declined in Shiftly, not by partner apps.","deprecated":false,"x-not-available":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"403":{"description":"Leave is approved and declined in Shiftly, not by partner apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-blackouts":{"get":{"operationId":"list_leave_blackouts","tags":["Leave blackout periods"],"summary":"List leave blackout periods","description":"Needs the leave:read permission.","x-required-permissions":["leave:read"],"security":[{"accessCredential":[]},{"oauth2":["leave:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"How many records per page. Up to 200."},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The next_cursor from the previous page."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-]\\d{2}:\\d{2})))$"},"description":"Only records changed at or after this moment. Pair it with include_archived to see removals."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Include records that have been archived."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."}],"responses":{"200":{"description":"List leave blackout periods","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaveBlackout"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-blackouts/{id}":{"get":{"operationId":"get_leave_blackouts","tags":["Leave blackout periods"],"summary":"Get one leave blackout period","description":"Needs the leave:read permission.","x-required-permissions":["leave:read"],"security":[{"accessCredential":[]},{"oauth2":["leave:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Get one leave blackout period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveBlackout"}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-balances":{"get":{"operationId":"list_leave_balances","tags":["Leave balances"],"summary":"List one person's leave balances","description":"Needs the leave:read permission.","x-required-permissions":["leave:read"],"security":[{"accessCredential":[]},{"oauth2":["leave:read"]}],"parameters":[{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List one person's leave balances","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaveBalance"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leave-types":{"get":{"operationId":"list_leave_types","tags":["Leave types"],"summary":"List the leave types the business offers","description":"Needs the leave:read permission.","x-required-permissions":["leave:read"],"security":[{"accessCredential":[]},{"oauth2":["leave:read"]}],"parameters":[],"responses":{"200":{"description":"List the leave types the business offers","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaveType"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/availability":{"get":{"operationId":"list_availability","tags":["Availability"],"summary":"List availability rules that apply in a date range","description":"Needs the roster:read permission.","x-required-permissions":["roster:read"],"security":[{"accessCredential":[]},{"oauth2":["roster:read"]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The first day of the range, in the location's timezone. With to, at most 92 days."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"The last day of the range, inclusive."},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Only this person."}],"responses":{"200":{"description":"List availability rules that apply in a date range","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AvailabilityRule"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/awards":{"get":{"operationId":"list_awards","tags":["Awards"],"summary":"List the business's awards","description":"Needs the payrules:read permission.","x-required-permissions":["payrules:read"],"security":[{"accessCredential":[]},{"oauth2":["payrules:read"]}],"parameters":[],"responses":{"200":{"description":"List the business's awards","content":{"application/json":{"schema":{"type":"object","required":["data","has_more","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Award"}},"has_more":{"type":"boolean","description":"True when another page follows."},"next_cursor":{"type":["string","null"],"description":"Send this as after to read the next page. Null on the last page."}}}}}},"400":{"description":"The error's code is invalid_request or range_too_long. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The error's code is invalid_token or token_expired. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is nothing at this address, or no such record in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong at Shiftly. Quote the request id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This environment is not set up for partner apps yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"accessCredential":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Lasts 30 minutes and belongs to one connection."},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://host.shiftly.au/oauth/authorize","tokenUrl":"https://host.shiftly.au/oauth/token","refreshUrl":"https://host.shiftly.au/oauth/token","scopes":{"roster:read":"Rosters and shifts","timesheets:read":"Timesheets","leave:read":"Leave and balances","people:read":"Staff details","pay:read":"Pay and labour cost","settings:read":"Business details and locations","payrules:read":"Awards and pay rules","ondemand:read":"OnDemand shifts","roster:write":"Shifts that haven't started","timesheets:write":"Pending timesheets","leave:write":"Pending leave requests","projects:write":"Projects","ondemand:write":"OnDemand drafts","offline_access":"Stay connected without the person signing in again"}}}}},"schemas":{"Connection":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The connection."},"state":{"type":"string","enum":["active","reduced"],"description":"active, or reduced when the person who connected the app no longer holds everything it was given."},"business_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The connected business."},"business_name":{"type":"string","description":"The connected business's name."},"granted_permissions":{"type":"array","items":{"type":"string"},"description":"What the business allowed."},"effective_permissions":{"type":"array","items":{"type":"string"},"description":"What the app can use right now."},"connected_at":{"type":"string","format":"date-time","description":"When the business connected the app."}},"required":["id","state","business_id","business_name","granted_permissions","effective_permissions","connected_at"]},"Business":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The business."},"name":{"type":"string","description":"The business's name."},"abn":{"type":["string","null"],"description":"Australian Business Number."},"pay_week_start_day":{"type":["integer","null"],"description":"The day the pay week starts: 0 is Sunday, 6 is Saturday. A location can start its roster week on another day; see roster_week_start_day on locations."},"awards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The award."},"code":{"type":"string","description":"The Fair Work award code, such as MA000009."},"name":{"type":"string","description":"The award's name."}},"required":["id","code","name"]},"description":"The awards this business uses."},"created_at":{"type":"string","format":"date-time","description":"When the business was created."},"updated_at":{"type":"string","format":"date-time","description":"When the business last changed."}},"required":["id","name","abn","pay_week_start_day","awards","created_at","updated_at"]},"Location":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The location."},"name":{"type":"string","description":"The location's name."},"timezone":{"type":"string","description":"IANA timezone. Dates and day boundaries for records at this location use it."},"address":{"type":["object","null"],"properties":{"street":{"type":["string","null"],"description":"Street address."},"city":{"type":["string","null"],"description":"Suburb or city."},"state":{"type":["string","null"],"description":"State or territory."},"post_code":{"type":["string","null"],"description":"Postcode."},"country":{"type":["string","null"],"description":"Country."},"latitude":{"type":["number","null"],"description":"Latitude."},"longitude":{"type":["number","null"],"description":"Longitude."}},"required":["street","city","state","post_code","country","latitude","longitude"],"description":"Where the location is."},"opening_time":{"type":["string","null"],"description":"Opening time, HH:mm in the location's timezone."},"closing_time":{"type":["string","null"],"description":"Closing time, HH:mm in the location's timezone."},"default_shift_times":{"type":"object","properties":{"monday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Monday."},"tuesday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Tuesday."},"wednesday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Wednesday."},"thursday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Thursday."},"friday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Friday."},"saturday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Saturday."},"sunday":{"type":"object","properties":{"start":{"type":"string","description":"Default start, HH:mm in the location's timezone."},"end":{"type":"string","description":"Default end, HH:mm in the location's timezone."},"open":{"type":"boolean","description":"False when the location is closed that day."}},"required":["start","end","open"],"description":"Default shift times on Sunday."}},"required":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"The times a new shift starts with on each day of the week."},"roster_week_start_day":{"type":"integer","description":"The day this location's roster week starts: 0 is Sunday, 6 is Saturday."},"clock_in_radius_metres":{"type":"number","description":"How close to the location staff must be to clock in, in metres, unless remote clock-in is allowed."},"remote_clock_in_allowed":{"type":"boolean","description":"True when staff can clock in from anywhere."},"break_tracking_enabled":{"type":"boolean","description":"True when staff record their breaks when clocking."},"target_labour_percentage":{"type":["number","null"],"description":"The labour cost the business aims for, as a percentage of sales at this location. Returned only with settings:read.","x-requires-permission":"settings:read"},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","name","timezone","address","opening_time","closing_time","default_shift_times","roster_week_start_day","clock_in_radius_metres","remote_clock_in_allowed","break_tracking_enabled","archived","created_at","updated_at"]},"Position":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The position."},"name":{"type":"string","description":"The position's name."},"description":{"type":["string","null"],"description":"What the position does."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The location the position belongs to."},"award_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The award shifts in this position are paid under."},"group":{"type":["object","null"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The position group."},"name":{"type":"string","description":"The group's name."},"award_code":{"type":["string","null"],"description":"The award the group belongs to."}},"required":["id","name","award_code"],"description":"The position group."},"active":{"type":"boolean","description":"False when the position is switched off for rostering."},"rate_modifier":{"type":["number","null"],"description":"Dollars added to the hourly rate for this position. Returned only with pay:read.","x-requires-permission":"pay:read"},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","name","description","location_id","award_id","group","active","archived","created_at","updated_at"]},"PublicHoliday":{"type":"object","properties":{"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The location the holiday is observed at."},"date":{"type":"string","format":"date","description":"The day, in the location's timezone."},"name":{"type":["string","null"],"description":"The holiday's name."},"source":{"type":"string","enum":["standard","local"],"description":"standard for the State or national calendar, local when the business added or removed the day in Shiftly."},"applies":{"type":"boolean","description":"True when Shiftly pays work and leave on this day at public holiday rates at this location."},"from_time":{"type":["string","null"],"description":"For a part-day holiday, the time it starts (HH:mm). Shiftly does not pay part-day holidays at public holiday rates, so applies is false for them."}},"required":["location_id","date","name","source","applies","from_time"]},"Project":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The project."},"name":{"type":"string","description":"The project's name."},"code":{"type":"string","description":"A short code, unique in the business."},"colour":{"type":["string","null"],"description":"The colour Shiftly shows it in, as #RRGGBB."},"status":{"type":"string","enum":["active","archived"],"description":"active, or archived when it can no longer be picked for new work. Archived projects keep their history."},"employee_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Staff assigned to the project. A manager limited to some locations sees only their own staff here, and a change they make keeps the others."},"budget":{"type":["number","null"],"description":"The budget, in dollars. Set in Shiftly. Returned only with pay:read.","x-requires-permission":"pay:read"},"linked_to_payroll_tracking":{"type":"boolean","description":"True when the project is linked to a tracking category in the business's payroll."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","name","code","colour","status","employee_ids","linked_to_payroll_tracking","archived","created_at","updated_at"]},"Employee":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The person."},"first_name":{"type":"string","description":"First name."},"last_name":{"type":"string","description":"Last name."},"middle_names":{"type":["string","null"],"description":"Middle names."},"preferred_name":{"type":["string","null"],"description":"The name they go by."},"email":{"type":"string","description":"Sign-in email. Read only."},"phone_number":{"type":["string","null"],"description":"Australian phone number."},"date_of_birth":{"type":["string","null"],"format":"date","description":"Date of birth."},"gender":{"type":["string","null"],"enum":["M","F","I","N"],"description":"M, F, I (indeterminate) or N (not stated)."},"emergency_contact":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"description":"Who to contact."},"phone":{"type":["string","null"],"description":"Their phone number."},"relationship":{"type":["string","null"],"description":"How they know the person."}},"required":["name","phone","relationship"],"description":"Who to call in an emergency."},"address":{"type":["object","null"],"properties":{"street":{"type":["string","null"],"description":"Street address."},"city":{"type":["string","null"],"description":"Suburb or city."},"state":{"type":["string","null"],"description":"State or territory."},"post_code":{"type":["string","null"],"description":"Postcode."},"country":{"type":["string","null"],"description":"Country."}},"required":["street","city","state","post_code","country"],"description":"Home address."},"employment_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"Their employment at this business."},"excluded_position_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"Positions at this business the person may not be rostered to."},"location_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{24}$"},"description":"The locations the person is assigned to. Empty when they can be rostered at any location."},"created_at":{"type":"string","format":"date-time","description":"When the person's record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the person's own details last changed."}},"required":["id","first_name","last_name","middle_names","preferred_name","email","phone_number","date_of_birth","gender","emergency_contact","address","employment_id","excluded_position_ids","location_ids","created_at","updated_at"]},"Employment":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The employment."},"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The person employed."},"start_date":{"type":["string","null"],"format":"date","description":"The day the employment started."},"employment_basis":{"type":"string","enum":["fulltime","parttime","casual"],"description":"fulltime, parttime or casual."},"ordinary_hours_per_week":{"type":["number","null"],"description":"Ordinary hours a week."},"payroll_employee_number":{"type":["string","null"],"description":"The person's number in the payroll system."},"pay_basis":{"type":["string","null"],"description":"hourly or salary. Returned only with pay:read.","x-requires-permission":"pay:read"},"base_hourly_rate":{"type":["number","null"],"description":"Base rate in dollars an hour. Returned only with pay:read.","x-requires-permission":"pay:read"},"hourly_rate_multiplier":{"type":["number","null"],"description":"Percentage paid above the base rate. Returned only with pay:read.","x-requires-permission":"pay:read"},"annual_salary":{"type":["number","null"],"description":"Salary in dollars a year, for salaried staff. Returned only with pay:read.","x-requires-permission":"pay:read"},"salary_weekly_hours":{"type":["number","null"],"description":"Hours a week the salary covers. Returned only with pay:read.","x-requires-permission":"pay:read"},"classification_level":{"type":["string","null"],"description":"Award classification. Returned only with pay:read.","x-requires-permission":"pay:read"},"award_code":{"type":["string","null"],"description":"The award the person is paid under. Returned only with pay:read.","x-requires-permission":"pay:read"},"award_stream":{"type":["string","null"],"description":"The stream within the award. Returned only with pay:read.","x-requires-permission":"pay:read"},"rate_overrides":{"type":["object","null"],"description":"Rates set for this person in place of the award's, in dollars an hour, by rate category. Returned only with pay:read.","x-requires-permission":"pay:read"},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","employee_id","start_date","employment_basis","ordinary_hours_per_week","payroll_employee_number","archived","created_at","updated_at"]},"Roster":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The roster week."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The location the roster is for."},"start_date":{"type":"string","format":"date","description":"First day of the week, in the location's timezone."},"end_date":{"type":"string","format":"date","description":"Last day of the week, in the location's timezone."},"status":{"type":"string","enum":["draft","unpublished","published"],"description":"draft (never published), unpublished (changed since it was last published) or published."},"published_at":{"type":["string","null"],"format":"date-time","description":"When the roster was last published."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","location_id","start_date","end_date","status","published_at","archived","created_at","updated_at"]},"Shift":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The shift."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Where the shift is."},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The position being worked."},"employee_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"Who is rostered. Empty for an open shift."},"roster_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The roster week Shiftly placed the shift in."},"start_time":{"type":"string","format":"date-time","description":"When the shift starts."},"end_time":{"type":"string","format":"date-time","description":"When the shift ends."},"status":{"type":"string","enum":["unpublished","published","expired"],"description":"unpublished (a draft), published or expired. Only a manager in Shiftly publishes."},"breaks":{"type":"array","items":{"type":"object","properties":{"offset_minutes":{"type":"integer","description":"Minutes after the start that the break begins."},"duration_minutes":{"type":"integer","description":"How long the break is."},"paid":{"type":"boolean","description":"True when the break is paid."}},"required":["offset_minutes","duration_minutes","paid"]},"description":"Planned breaks. Left out on create, or when a change moves the start or end, Shiftly plans them from the award."},"notes":{"type":["string","null"],"description":"The note on the shift, where the connecting person may see it."},"project_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The project the shift is charged to, if any."},"paid_hours":{"type":["number","null"],"description":"Hours paid, after unpaid breaks."},"cost":{"type":"object","properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."},"breakdown":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","description":"The rate category, such as ordinary or saturday."},"hours":{"type":"number","description":"Hours paid in this category."},"rate":{"type":"number","description":"Dollars an hour."},"cost":{"type":"number","description":"Dollars."}},"required":["category","hours","rate","cost"]},"description":"Hours, rate and cost by rate category."}},"required":["total","subtotal","super","allowances","position_loading","breakdown"],"description":"Estimated labour cost in dollars. Zero for an open shift. Returned only with pay:read.","x-requires-permission":"pay:read"},"created_by_app":{"type":"boolean","description":"True when your app created this shift."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","location_id","position_id","employee_id","roster_id","start_time","end_time","status","breaks","notes","project_id","paid_hours","created_by_app","archived","created_at","updated_at"]},"ShiftCover":{"type":"object","properties":{"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Someone free to work the shift."},"employment_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Their employment."}},"required":["employee_id","employment_id"]},"OpenShiftRequest":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The request."},"shift_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The open shift asked for. Read it at /shifts/{id}."},"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Who asked for it."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Where the shift is."},"status":{"type":"string","enum":["pending","accepted","rejected"],"description":"pending until a manager decides it in Shiftly. accepted means the person was given the shift; rejected means it went to someone else or was turned down."},"requested_at":{"type":"string","format":"date-time","description":"When the person asked."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","shift_id","employee_id","location_id","status","requested_at","created_at","updated_at"]},"OnDemandShift":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The OnDemand shift."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Where the shift is."},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The position the worker fills."},"start_time":{"type":"string","format":"date-time","description":"When the shift starts."},"end_time":{"type":"string","format":"date-time","description":"When the shift ends."},"status":{"type":"string","enum":["draft","posted","filled","in_progress","completed","no_show","expired"],"description":"draft, posted, filled, in_progress, completed, no_show or expired. The venue publishes drafts in Shiftly."},"rate_set":{"type":"boolean","description":"True once the venue has set the hourly rate. A draft needs one before the venue can publish it."},"rate":{"type":["number","null"],"description":"The hourly rate the venue set, in dollars. Empty until the venue sets it. Returned only with pay:read.","x-requires-permission":"pay:read"},"paid_hours":{"type":["number","null"],"description":"Hours paid, after unpaid breaks."},"notes":{"type":["string","null"],"description":"The shift description the venue sees in Shiftly. The worker app doesn't show it yet."},"posted_at":{"type":["string","null"],"format":"date-time","description":"When the venue published the shift. Empty for a draft."},"created_by_app":{"type":"boolean","description":"True when your app created this shift."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","location_id","position_id","start_time","end_time","status","rate_set","paid_hours","notes","posted_at","created_by_app","archived","created_at","updated_at"]},"ShiftSwap":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The swap."},"shift_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The shift being handed over."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Where the shift is."},"from_employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Who offered the shift."},"to_employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Who was asked to work it."},"status":{"type":"string","enum":["pending","accepted","rejected"],"description":"The colleague's answer. Who works the shift is the shift's own employee_id, not this status."},"requested_at":{"type":"string","format":"date-time","description":"When the shift was offered."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","shift_id","location_id","from_employee_id","to_employee_id","status","requested_at","created_at","updated_at"]},"Timesheet":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The timesheet."},"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Who worked."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Where."},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The position worked."},"shift_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The rostered shift this timesheet is for, if any."},"start_time":{"type":"string","format":"date-time","description":"When work started. Stored to the whole minute."},"end_time":{"type":["string","null"],"format":"date-time","description":"When work ended. Stored to the whole minute."},"status":{"type":"string","enum":["pending","approved","rejected","active","posted","warning","skipped"],"description":"pending until a manager approves it in Shiftly."},"breaks":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"When the break started."},"end":{"type":["string","null"],"format":"date-time","description":"When the break ended."},"paid":{"type":"boolean","description":"True when the break is paid."}},"required":["start","end","paid"]},"description":"Breaks taken."},"note":{"type":["string","null"],"description":"A note on the timesheet."},"project_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The project the time is charged to, if any."},"clock_in_photo_taken":{"type":["boolean","null"],"description":"True when a photo was taken at clock-in, false when one was asked for and none was taken, null when none was asked for. The photo itself is never shared."},"clock_out_photo_taken":{"type":["boolean","null"],"description":"The same for clock-out. Null while the person is still clocked in."},"paid_hours":{"type":"number","description":"Hours paid, after unpaid breaks. Worked out by Shiftly."},"pay":{"type":"object","properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."},"breakdown":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","description":"The rate category, such as ordinary or saturday."},"hours":{"type":"number","description":"Hours paid in this category."},"rate":{"type":"number","description":"Dollars an hour."},"cost":{"type":"number","description":"Dollars."}},"required":["category","hours","rate","cost"]},"description":"Hours, rate and cost by rate category."}},"required":["total","subtotal","super","allowances","position_loading","breakdown"],"description":"What the timesheet costs, in dollars. Worked out by Shiftly. Returned only with pay:read.","x-requires-permission":"pay:read"},"created_by_app":{"type":"boolean","description":"True when your app created this timesheet."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","employee_id","location_id","position_id","shift_id","start_time","end_time","status","breaks","note","project_id","clock_in_photo_taken","clock_out_photo_taken","paid_hours","created_by_app","archived","created_at","updated_at"]},"ClockedIn":{"type":"object","properties":{"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Who is clocked in."},"timesheet_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Their open timesheet. Read it at /timesheets/{id}."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Where they clocked in."},"position_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The position they are working."},"shift_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The rostered shift. Empty when they clocked in without one."},"clocked_in_at":{"type":"string","format":"date-time","description":"When they clocked in."},"on_break":{"type":"boolean","description":"True while they are on a break."},"break_started_at":{"type":["string","null"],"format":"date-time","description":"When the current break started."},"scheduled_end_time":{"type":["string","null"],"format":"date-time","description":"When their rostered shift ends. Empty when they clocked in without one."}},"required":["employee_id","timesheet_id","location_id","position_id","shift_id","clocked_in_at","on_break","break_started_at","scheduled_end_time"]},"TimesheetTotals":{"type":"object","properties":{"employee_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The person, when grouped by employee."},"location_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The location, when grouped by location."},"date":{"type":["string","null"],"format":"date","description":"The day in the location's timezone, when grouped by day."},"approved_hours":{"type":"number","description":"Paid hours on approved timesheets."},"approved_count":{"type":"integer","description":"How many approved timesheets."},"approved_cost":{"type":["object","null"],"properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."}},"required":["total","subtotal","super","allowances","position_loading"],"description":"What the approved timesheets cost, including super and allowances. Returned only with pay:read.","x-requires-permission":"pay:read"},"pending_hours":{"type":"number","description":"Paid hours on pending timesheets."},"pending_count":{"type":"integer","description":"How many pending timesheets."},"pending_cost":{"type":["object","null"],"properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."}},"required":["total","subtotal","super","allowances","position_loading"],"description":"What the pending timesheets cost, including super and allowances. Returned only with pay:read.","x-requires-permission":"pay:read"}},"required":["employee_id","location_id","date","approved_hours","approved_count","pending_hours","pending_count"]},"LabourCostDay":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"The calendar day in the location's timezone."},"location_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The location."},"position_id":{"type":["string","null"],"pattern":"^[0-9a-f]{24}$","description":"The position, when grouped by position."},"target_labour_percentage":{"type":["number","null"],"description":"The location's labour cost target, as a percentage of sales. Returned only with settings:read.","x-requires-permission":"settings:read"},"rostered":{"type":"object","properties":{"published_shift_count":{"type":"integer","description":"How many published shifts."},"published_hours":{"type":"number","description":"Paid hours on published shifts."},"published_cost":{"type":["object","null"],"properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."}},"required":["total","subtotal","super","allowances","position_loading"],"description":"Estimated cost of the published shifts, including super and allowances. Each shift is priced on its own, so overtime from the rest of the person's week is not in it. Returned only with pay:read.","x-requires-permission":"pay:read"},"draft_shift_count":{"type":"integer","description":"How many draft shifts."},"draft_hours":{"type":"number","description":"Paid hours on draft shifts."},"draft_cost":{"type":["object","null"],"properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."}},"required":["total","subtotal","super","allowances","position_loading"],"description":"Estimated cost of the draft shifts, including super and allowances. Each shift is priced on its own, so overtime from the rest of the person's week is not in it. Returned only with pay:read.","x-requires-permission":"pay:read"},"open_shift_count":{"type":"integer","description":"Shifts nobody holds yet. They count hours but no cost."}},"required":["published_shift_count","published_hours","draft_shift_count","draft_hours","open_shift_count"],"description":"Shifts starting that day, published and draft. Returned only with roster:read.","x-requires-permission":"roster:read"},"actual":{"type":"object","properties":{"approved_hours":{"type":"number","description":"Paid hours on approved timesheets."},"approved_count":{"type":"integer","description":"How many approved timesheets."},"approved_cost":{"type":["object","null"],"properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."}},"required":["total","subtotal","super","allowances","position_loading"],"description":"What the approved timesheets cost, including super and allowances. Returned only with pay:read.","x-requires-permission":"pay:read"},"pending_hours":{"type":"number","description":"Paid hours on pending timesheets."},"pending_count":{"type":"integer","description":"How many pending timesheets."},"pending_cost":{"type":["object","null"],"properties":{"total":{"type":"number","description":"Everything below added together, in dollars. Includes super."},"subtotal":{"type":"number","description":"Wages before super and allowances."},"super":{"type":"number","description":"Superannuation."},"allowances":{"type":"number","description":"Allowances."},"position_loading":{"type":"number","description":"The position's hourly loading over the paid hours."}},"required":["total","subtotal","super","allowances","position_loading"],"description":"What the pending timesheets cost, including super and allowances. Returned only with pay:read.","x-requires-permission":"pay:read"}},"required":["approved_hours","approved_count","pending_hours","pending_count"],"description":"Timesheets starting that day, approved and pending. Rejected and still-open timesheets are left out. Returned only with timesheets:read.","x-requires-permission":"timesheets:read"}},"required":["date","location_id","position_id"]},"LeaveRequest":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The leave request."},"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Whose leave it is."},"employment_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Their employment."},"leave_type":{"type":"string","description":"The leave type's key, from the leave types list. Private kinds of leave, such as family and domestic violence leave, always show as PRIVATE."},"start_date":{"type":"string","format":"date","description":"First day of leave."},"end_date":{"type":"string","format":"date","description":"Last day of leave."},"start_time":{"type":["string","null"],"format":"date-time","description":"Start, for part-day leave."},"end_time":{"type":["string","null"],"format":"date-time","description":"End, for part-day leave."},"hours_per_day":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"The day."},"hours":{"type":"number","description":"Hours of leave on that day."}},"required":["date","hours"]},"description":"Hours of leave on each day. Worked out by Shiftly."},"total_hours":{"type":"number","description":"Total hours of leave."},"status":{"type":"string","enum":["pending","approved","declined","cancelled"],"description":"pending until a manager decides it in Shiftly."},"note":{"type":["string","null"],"description":"The note on the request. May contain personal information. Always empty for private kinds of leave."},"created_by_app":{"type":"boolean","description":"True when your app submitted this request."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","employee_id","employment_id","leave_type","start_date","end_date","start_time","end_time","hours_per_day","total_hours","status","note","created_by_app","archived","created_at","updated_at"]},"LeaveBlackout":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The blackout period."},"name":{"type":"string","description":"The period's name."},"start_date":{"type":"string","format":"date","description":"First day of the period."},"end_date":{"type":"string","format":"date","description":"Last day of the period."},"enforcement":{"type":"string","enum":["hard_block","soft_warn","informational"],"description":"hard_block stops staff asking for these kinds of leave in Shiftly, soft_warn warns them, informational only shows the period. None of them stops a manager in Shiftly, or your app, from submitting leave."},"leave_types":{"type":"array","items":{"type":"string"},"description":"The kinds of leave the period applies to, as keys from the leave types list."},"reason":{"type":["string","null"],"description":"Why the period is blocked out, as staff see it."},"archived":{"type":"boolean","description":"True when the record has been removed in Shiftly."},"created_at":{"type":"string","format":"date-time","description":"When the record was created."},"updated_at":{"type":"string","format":"date-time","description":"When the record last changed."}},"required":["id","name","start_date","end_date","enforcement","leave_types","reason","archived","created_at","updated_at"]},"LeaveBalance":{"type":"object","properties":{"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Whose balance it is."},"employment_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Their employment."},"leave_type":{"type":"string","description":"The leave type's key."},"balance_hours":{"type":["number","null"],"description":"Hours accrued and not yet taken. Empty when the balance is kept in the payroll system and could not be read, or has not been set up."},"available_hours":{"type":["number","null"],"description":"Hours the person can still request, after pending and approved leave."},"unlimited":{"type":"boolean","description":"True when the leave type has no limit."},"source":{"type":"string","description":"shiftly when Shiftly keeps the balance, otherwise the payroll system that does."},"as_at":{"type":"string","format":"date-time","description":"When the balance was worked out."}},"required":["employee_id","employment_id","leave_type","balance_hours","available_hours","unlimited","source","as_at"]},"LeaveType":{"type":"object","properties":{"leave_type":{"type":"string","description":"The key to send when submitting leave."},"label":{"type":["string","null"],"description":"The name staff see."},"paid":{"type":"boolean","description":"True when the leave is paid."},"enabled":{"type":"boolean","description":"False when the business has switched the leave type off."},"accrual_rate_type":{"type":["string","null"],"description":"How the leave builds up: fixed_per_year, per_hour_worked or unlimited."},"accrual_rate_hours":{"type":["number","null"],"description":"Hours a year, or hours per hour worked, depending on the rate type."},"gating_mode":{"type":["string","null"],"description":"strict_block when a request over the balance is refused, warn_only when it is allowed."}},"required":["leave_type","label","paid","enabled","accrual_rate_type","accrual_rate_hours","gating_mode"]},"AvailabilityRule":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The availability rule."},"employee_id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"Whose availability this is."},"polarity":{"type":"string","enum":["available","unavailable"],"description":"available or unavailable."},"all_day":{"type":"boolean","description":"True when the rule covers the whole day."},"start_minutes":{"type":["integer","null"],"description":"Minutes after midnight the rule starts, on the clock at whichever location a shift is at."},"end_minutes":{"type":["integer","null"],"description":"Minutes after midnight the rule ends."},"start_date":{"type":"string","format":"date","description":"First day the rule applies."},"end_date":{"type":["string","null"],"format":"date","description":"Last day the rule applies. Empty when it has no end."},"ended_on":{"type":["string","null"],"format":"date","description":"The day the rule was ended early."},"repeat":{"type":"string","enum":["none","weekly","fortnightly","monthly"],"description":"none, weekly, fortnightly or monthly."},"comment":{"type":["string","null"],"description":"What the person wrote, where the connecting person may see it."},"created_at":{"type":"string","format":"date-time","description":"When the rule was created."},"updated_at":{"type":"string","format":"date-time","description":"When the rule last changed."}},"required":["id","employee_id","polarity","all_day","start_minutes","end_minutes","start_date","end_date","ended_on","repeat","comment","created_at","updated_at"]},"Award":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"The award."},"code":{"type":"string","description":"The Fair Work award code, such as MA000009."},"name":{"type":"string","description":"The award's name."}},"required":["id","code","name"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"type":"string","description":"The field or parameter that is wrong."},"permission":{"type":"string","description":"The permission that is missing."},"reason":{"type":"string"},"errors":{"type":"array","description":"For a batch: each item that is wrong, by its position.","items":{"type":"object"}},"request_id":{"type":"string","description":"Quote this when you contact Shiftly."}}}}}}},"x-permissions":[{"permission":"roster:read","label":"Rosters and shifts","kind":"view","requires":"roster.view"},{"permission":"timesheets:read","label":"Timesheets","kind":"view","requires":"timesheets.view"},{"permission":"leave:read","label":"Leave and balances","kind":"view","requires":"leave.view"},{"permission":"people:read","label":"Staff details","kind":"view","requires":"people.view"},{"permission":"pay:read","label":"Pay and labour cost","kind":"view","requires":"pay.view"},{"permission":"settings:read","label":"Business details and locations","kind":"view","requires":"settings.view"},{"permission":"payrules:read","label":"Awards and pay rules","kind":"view","requires":"payrules.view"},{"permission":"ondemand:read","label":"OnDemand shifts","kind":"view","requires":"roster.view"},{"permission":"roster:write","label":"Shifts that haven't started","kind":"change","requires":"roster.edit"},{"permission":"timesheets:write","label":"Pending timesheets","kind":"change","requires":"timesheets.edit"},{"permission":"leave:write","label":"Pending leave requests","kind":"change","requires":"leave.edit"},{"permission":"projects:write","label":"Projects","kind":"change","requires":"pay.edit"},{"permission":"ondemand:write","label":"OnDemand drafts","kind":"change","requires":"roster.edit"}],"x-limits":{"page_size_default":50,"page_size_max":200,"date_range_days_max":92,"access_credential_minutes":30,"renewal_credential_days":60,"authorization_code_minutes":5},"x-error-codes":[{"status":400,"code":"invalid_request","description":"The request is malformed: bad JSON, an unknown query parameter or a bad cursor."},{"status":400,"code":"range_too_long","description":"The from and to dates span more days than this list allows. max_days says how many; ask for a shorter range."},{"status":401,"code":"invalid_token","description":"The access credential is missing or malformed."},{"status":401,"code":"token_expired","description":"The access credential has expired. Renew it with the refresh token."},{"status":403,"code":"origin_not_allowed","description":"The request carried an Origin header, as a web page in a browser sends. Call the API from your server."},{"status":403,"code":"permission_denied","description":"The permission was not given, the person who connected the app no longer holds it, or the connection is stopped."},{"status":403,"code":"not_available","description":"This operation is not open to partner apps: publishing, approving, deciding leave, changing staff details or pay, changing a record another app or a manager created, or using a feature the business has switched off."},{"status":403,"code":"connection_disconnected","description":"The business disconnected your app. Ask them to connect it again from your product."},{"status":403,"code":"connection_suspended","description":"The connection stopped: the connecting person left, it went unused for 60 days, or a credential was reused. The business has to connect your app again."},{"status":403,"code":"app_suspended","description":"Shiftly has paused your app for every business. Contact Shiftly."},{"status":403,"code":"ondemand_unavailable","description":"The business hasn't set up OnDemand, so your app can't add or change OnDemand shifts there."},{"status":404,"code":"not_found","description":"There is nothing at this address, or no such record in this business."},{"status":409,"code":"conflict","description":"The record's state refuses the change: an ended employment, an overlapping shift or leave request, or a project code already in use."},{"status":409,"code":"shift_started","description":"The shift has already started, so it can only be changed in Shiftly."},{"status":409,"code":"not_a_draft","description":"The OnDemand shift has been published, so it can only be changed in Shiftly."},{"status":409,"code":"timesheet_not_pending","description":"The timesheet has been approved, so it can only be changed in Shiftly."},{"status":409,"code":"leave_not_pending","description":"The leave request has been decided, so it can only be changed in Shiftly."},{"status":409,"code":"idempotency_key_reused","description":"This Idempotency-Key was already used with a different request body."},{"status":409,"code":"request_in_progress","description":"The first request with this Idempotency-Key is still running. Try again shortly."},{"status":422,"code":"validation_failed","description":"A field is wrong. The field property names it."},{"status":429,"code":"rate_limited","description":"Too many requests. Retry-After says when to try again."},{"status":500,"code":"internal_error","description":"Something went wrong at Shiftly. Quote the request id."},{"status":503,"code":"not_configured","description":"This environment is not set up for partner apps yet."}]}