Skip to main content

Leave

Requests, and the entitlement they draw on. Read a balance rather than deriving one: available_days accounts for accrual, and subtracting the raw columns over-reports every monthly-accrual policy. Policies and groups are read-only here — changing one retroactively changes what everyone is entitled to.

List leave types

GET/v1/leave_types

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size. Values above 100 are clamped.
starting_afterstringNoOpaque cursor from a previous response’s next_cursor.
updated_sincetimestampNoReturn records changed at or after this instant. Tracks the record itself, not its child collections.
is_activebooleanNoFilter by whether the record is in use.

Responses

StatusMeaning
200A page of leave types.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
429Rate limit exceeded. See the RateLimit-* headers.

Create a leave type

POST/v1/leave_types

Creates a leave type. code must be unique in the workspace.

A type on its own grants nothing — the entitlement lives on a policy, which is configured in the app.

Headers

NameTypeRequiredDescription
Idempotency-KeystringNoA unique value per logical request. Replaying it returns the original response with Idempotent-Replay: true.

Responses

StatusMeaning
201The resulting leave type.
400The request body failed validation.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
409A leave type with that code already exists.
429Rate limit exceeded. See the RateLimit-* headers.

Retrieve a leave type

GET/v1/leave_types/{id}

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The leave type.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave type in this workspace.
429Rate limit exceeded. See the RateLimit-* headers.

Update a leave type

PATCH/v1/leave_types/{id}

Only the fields present in the body are changed.

Retiring a type is is_active: false, and there is no DELETE. Allocations and applications reference a leave type for ever, so one is never removed — a DELETE here would answer 200 and leave the record in place, which is worse than not offering it.

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The updated leave type.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave type in this workspace.
429Rate limit exceeded. See the RateLimit-* headers.

List leave policies

GET/v1/leave_policies

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size. Values above 100 are clamped.
starting_afterstringNoOpaque cursor from a previous response’s next_cursor.
updated_sincetimestampNoReturn records changed at or after this instant. Tracks the record itself, not its child collections.
leave_type_idstringNoOnly records for this leave type.

Responses

StatusMeaning
200A page of leave policies.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
429Rate limit exceeded. See the RateLimit-* headers.

Retrieve a leave policy

GET/v1/leave_policies/{id}

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The leave policy.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave policy in this workspace.
429Rate limit exceeded. See the RateLimit-* headers.

List leave groups

GET/v1/leave_groups

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size. Values above 100 are clamped.
starting_afterstringNoOpaque cursor from a previous response’s next_cursor.
updated_sincetimestampNoReturn records changed at or after this instant. Tracks the record itself, not its child collections.
is_activebooleanNoFilter by whether the record is in use.

Responses

StatusMeaning
200A page of leave groups.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
429Rate limit exceeded. See the RateLimit-* headers.

Retrieve a leave group

GET/v1/leave_groups/{id}

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The leave group.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave group in this workspace.
429Rate limit exceeded. See the RateLimit-* headers.

List leave balances

GET/v1/leave_balances

Query parameters

NameTypeRequiredDescription
employee_idstringYesRequired. Balances are computed per employee.
fiscal_year_idstringNoDefaults to the workspace's current fiscal year.

Responses

StatusMeaning
200A page of leave balances.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
429Rate limit exceeded. See the RateLimit-* headers.

List leave applications

GET/v1/leave_applications

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size. Values above 100 are clamped.
starting_afterstringNoOpaque cursor from a previous response’s next_cursor.
updated_sincetimestampNoReturn records changed at or after this instant. Tracks the record itself, not its child collections.
employee_idstringNoOnly records belonging to this employee.
leave_type_idstringNoOnly records for this leave type.
statuspending · approved · rejected · cancelledNoOnly requests in this state.
from_datedateNoRequests OVERLAPPING this day or later. A request running 1–5 March matches a window starting on the 3rd.
to_datedateNoRequests overlapping this day or earlier.

Responses

StatusMeaning
200A page of leave applications.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
429Rate limit exceeded. See the RateLimit-* headers.

Apply for leave

POST/v1/leave_applications

Applies on an employee's behalf.

total_days is computed by the workspace, not taken from the span: rest days, holidays and the sandwich rule all bear on it, so a five-day range may consume three days or seven.

Refused when the employee is ineligible under the policy (gender, tenure or employment type), when the balance is insufficient and the policy forbids a deficit, or when the dates overlap an existing request.

Headers

NameTypeRequiredDescription
Idempotency-KeystringNoA unique value per logical request. Replaying it returns the original response with Idempotent-Replay: true.

Responses

StatusMeaning
201The resulting leave application.
400The request body failed validation.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
409An overlapping leave request already exists for these dates.
429Rate limit exceeded. See the RateLimit-* headers.

Retrieve a leave application

GET/v1/leave_applications/{id}

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The leave application.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave application in this workspace.
429Rate limit exceeded. See the RateLimit-* headers.

Approve a leave application

POST/v1/leave_applications/{id}/approve

Consumes the balance and marks every day of the request as on_leave on the employee’s attendance. Answers 409 if the request was already decided.

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The decided leave application.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave application in this workspace.
409This request has already been decided.
429Rate limit exceeded. See the RateLimit-* headers.

Reject a leave application

POST/v1/leave_applications/{id}/reject

Requires a reason in the body — it is the only thing the employee sees, and a rejection they cannot act on is not a decision. Answers 409 if the request was already decided.

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The decided leave application.
400The request body failed validation.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave application in this workspace.
409This request has already been decided.
429Rate limit exceeded. See the RateLimit-* headers.

Cancel a leave application

POST/v1/leave_applications/{id}/cancel

Withdraws a request. An approved one can only be cancelled before it starts; cancelling it releases the balance and clears the attendance marks. Requires a reason.

Path parameters

NameTypeRequiredDescription
idstringYesThe identifier returned as id on the object.

Responses

StatusMeaning
200The decided leave application.
400The request body failed validation.
401The API key is missing, malformed, revoked or expired.
403The key does not carry the required scopes.
404No such leave application in this workspace.
409This request has already been decided.
429Rate limit exceeded. See the RateLimit-* headers.