Time off
Preview time off
POST
What booking it would take, as the web app shows before you book: what it uses, what is left after, who approves, what to know, and why it can’t be booked, if it can’t. Nothing is booked.
bearerheader
AuthorizationBearer <token>An access token from /v1/auth/token, or a personal token: opaque, beginning s2a_.
workspace_id*stringwsp_…, from GET /v1/me
Length
length <= 40application/json- body
leave_type_id*stringlvt_…
start_date*stringMatch
^(?:(?:\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])))$Format
datestart_portion?stringmorning when left out
Value in
"morning""afternoon"end_date*stringMatch
^(?:(?:\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])))$Format
dateend_portion?stringend_of_day when left out
Value in
"lunchtime""end_of_day"note?stringLength
length <= 1000cover_person_id?stringper_…: who covers while you are away
The preview
application/json- response
The preview
leave_type*stringminutes*integerRange
-9007199254740991 <= value <= 9007199254740991day_minutes*integerRange
-9007199254740991 <= value <= 9007199254740991available_after?integerLeft in the allowance after this; left out for a type that doesn’t count
Range
-9007199254740991 <= value <= 9007199254740991approval*stringValue in
"required""auto"approvers*array<string>Who will be asked, by name
warnings*array<>What to know, though it can be booked
refusals*array<string>Why it can’t be booked, in words; empty when it can
curl -X POST 'https://api.sign2approve.com/v1/workspaces/string/timeoff/requests/preview' \ -H 'Content-Type: application/json' \ -d '{ "leave_type_id": "string", "start_date": "2019-08-24", "end_date": "2019-08-24"}'{ "leave_type": "Holiday", "minutes": 2250, "day_minutes": 450, "available_after": 4950, "approval": "required", "approvers": [ "Morgan Manager" ], "warnings": [ { "code": "min_notice", "message": "Holiday needs 14 days' notice" } ], "refusals": []}