Skip to main content
POST
Create a leave type (policy)

Authorizations

Authorization
string
header
required

Issue keys in Settings → API. Send them as Authorization: Bearer ont_… (an X-Api-Key: ont_… header is also accepted). Session-cookie routes are used by the OnTime web apps and are shown for completeness.

Body

application/json
code
string
required
name
string
required
annualQuota
number | null
accrualMethod
enum<string>
Available options:
Monthly,
Annual,
CompOff,
None
accrualRate
number
carryForwardCap
integer
Required range: -9007199254740991 <= x <= 9007199254740991
allowHalfDay
boolean
requiresHrApproval
boolean
colorTone
enum<string>
Available options:
neutral,
accent,
ok,
warn,
bad,
info
order
integer
Required range: -9007199254740991 <= x <= 9007199254740991

Response

200 - application/json

Success

id
string<uuid>
required
Pattern: ^([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)$
orgId
string<uuid>
required
Pattern: ^([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)$
code
string
required
name
string
required
annualQuota
number | null
required
accrualMethod
enum<string>
required
Available options:
Monthly,
Annual,
CompOff,
None
accrualRate
number
required
carryForwardCap
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
allowHalfDay
boolean
required
requiresHrApproval
boolean
required
colorTone
enum<string>
required
Available options:
neutral,
accent,
ok,
warn,
bad,
info
order
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991