Time off
Book time off
POST
Books it for you, as the web app does: who approves is worked out, and they are told. previewTimeOff says first what it would take. Send an Idempotency-Key: the same key returns the same answer for 24 hours.
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 <= 40idempotency-key*stringA UUID of your own (ADR 0071 §5)
Match
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Format
uuidapplication/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
Booked: one request, or one per leave year it crosses
application/json- response
Booked: one request, or one per leave year it crosses
ids*array<string>status*stringValue in
"pending""approved""declined""cancelled"curl -X POST 'https://api.sign2approve.com/v1/workspaces/string/timeoff/requests' \ -H 'idempotency-key: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{ "leave_type_id": "string", "start_date": "2019-08-24", "end_date": "2019-08-24"}'{ "ids": [ "req_01a16d3fd3507be78e41c4540aa20a3c" ], "status": "pending"}