Time off

Preview time off

POST
/v1/workspaces/{workspace_id}/timeoff/requests/preview

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.

Authorization

bearer
headerAuthorizationBearer <token>

An access token from /v1/auth/token, or a personal token: opaque, beginning s2a_.

Path Parameters

workspace_id*string

wsp_…, from GET /v1/me

Lengthlength <= 40

Request Body

application/json
  1. body
leave_type_id*string

lvt_…

start_date*string
Match^(?:(?:\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])))$
Formatdate
start_portion?string

morning when left out

Value in"morning""afternoon"
end_date*string
Match^(?:(?:\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])))$
Formatdate
end_portion?string

end_of_day when left out

Value in"lunchtime""end_of_day"
note?string
Lengthlength <= 1000
cover_person_id?string

per_…: who covers while you are away

Response Body

The preview

application/json
  1. response

The preview

leave_type*string
minutes*integer
Range-9007199254740991 <= value <= 9007199254740991
day_minutes*integer
Range-9007199254740991 <= value <= 9007199254740991
available_after?integer

Left in the allowance after this; left out for a type that doesn’t count

Range-9007199254740991 <= value <= 9007199254740991
approval*string
Value 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": []}