Skip to content

REST API v2 Errors: Envelope and Error Code Catalog

Every failure from this API — including authentication failures and rate-limit responses — is returned in one consistent shape. Learn that shape first, then use the catalog by HTTP status to find the exact code, what it means, and the recommended next step.

One envelope for every error

All error responses share the same envelope structure. The JSON example shows an INSUFFICIENT_SCOPE failure with a request identifier and a details object listing requiredScopes.

Error fields

code
The stable identifier for programmatic handling. Branch on this field.
name
A human-readable label for the error.
description
A plain-language explanation of what went wrong.
resolution
Suggested next action for a human caller or an AI agent.
requestId
Identifies this request; include it when contacting support.
details
Optional extra context, for example validation fields or required scopes.

Decision rule: do not branch on name or description. They explain the failure, but code is the contract your logic should depend on.

Catalog by HTTP status

Start with the HTTP status, then match the code. The tables below give the full per-code Name, Description and Resolution for every status group, so you can move from a status code to the specific failure and its exact recommended fix without guessing from grouped summaries.

400 — Bad request: the request itself is malformed or fails basic validation. Check method, headers and body against the reference; send a valid JSON object with Content-Type application/json; send nextToken exactly as returned or omit it; fix fields listed in details.fields; use a public HTTPS webhook URL and at least one known event name.

401 — Authentication: the API key is missing, malformed, unrecognized, expired or revoked. Send the full key as a Bearer token in the Authorization header, or ask an admin to create or rotate a new key. For a revoked key, check details.reason first.

403 — Forbidden: the key is recognized but not allowed to do this, or the company plan does not permit it. Add the scopes in details.requiredScopes, check details.reason or details.revocationReason, use an admin-owned key where required, or ask an admin to upgrade the plan, renew the subscription, or buy the relevant add-on. For ON_BEHALF_OF_NOT_ALLOWED, add the users:act-on-behalf scope and make sure the key owner manages that user, or remove the X-On-Behalf-Of header.

404 — Not found: the resource, route, operation or delivery does not exist, has expired, or is outside what the key can access. Check the ID named in details.resource where present. Operations are kept for 90 days and webhook deliveries for 30 days, so expiry is a real possibility.

409 — Conflict: the request conflicts with current state or a uniqueness rule. Re-read the resource and retry with current values; wait and retry with the same Idempotency-Key when a request is in progress; for automation warnings, repeat the request with overrideAutomations listing every code in details.warnings, or change the dates.

422 — Unprocessable: the request is well-formed but violates a business rule, most often around leave, time off in lieu, or plan limits. For REQUEST_REJECTED, read details.message for the specific business reason. For a reused idempotency key, use a new key for a different payload or resend the original payload. For LEAVE_INVALID_HALF_DAY_DURATION, set the end time to the start time plus half of the user's working hours on that day, or plus 4 hours on a day without working hours; the end can be 24:00.

429 — Rate limit or quota: QUOTA_EXCEEDED means the key's request quota is used up — wait until it resets or contact support for a higher quota. RATE_LIMITED means too many requests in a short time — wait a few seconds and retry, reusing the same Idempotency-Key for writes.

500 — Server error: INTERNAL_ERROR means something went wrong on the server side. Retry later, and if it persists, contact support quoting the requestId.

Troubleshooting checklist

When you receive an error, work through this checklist in order:

  1. Read code first and branch on it, not on name or description.
  2. Read resolution for the recommended next step.
  3. Inspect details if present — requiredScopes, fields, reason, warnings, or message often contain the actionable specifics.
  4. Check the status group above for related codes and common fixes.
  5. For 401 and 403, verify the key, its scopes, its owner, and the company plan before changing request data.
  6. For 409, re-read the resource before retrying; for 422, adjust the business-rule inputs such as dates, balance, or policy settings.
  7. For 429, back off and retry; for 500, retry later.
  8. If the problem persists, contact support and include requestId.
Status at a glance
StatusWhat it usually meansFirst check
400Malformed or basically invalid requestMethod, headers, body, and details.fields
401Key missing, invalid, expired, or revokedAuthorization header and key status
403Recognized key not allowed, or plan restrictiondetails.requiredScopes, details.reason, plan
404Resource, route, or delivery not found or expiredID in details.resource; retention periods
409Conflict with current state or uniquenessRe-read resource; details.warnings
422Business rule violationdetails.message and rule-specific inputs
429Rate limit or quota exceededWait and retry; quota reset
500Internal server errorRetry later; quote requestId to support

Summary only; use the status sections above for the complete code list.

400 errors
CodeNameDescriptionResolution
BAD_REQUESTBadRequestThe request is malformed and was rejected.Check the method, headers and body of the request against the API reference.
INVALID_IDEMPOTENCY_KEYInvalidIdempotencyKeyThe Idempotency-Key header is not 1 to 255 printable ASCII characters.Send an Idempotency-Key of 1 to 255 printable ASCII characters, such as a UUID.
INVALID_PAGINATION_TOKENInvalidPaginationTokenThe nextToken was not issued by this API.Send the nextToken exactly as the previous response returned it, or omit it to start from the first page.
INVALID_REQUEST_BODYInvalidRequestBodyThe request body is not valid JSON.Send a valid JSON object with the Content-Type header set to application/json.
NOTIFICATION_FREQUENCY_CHANGE_NOT_ALLOWEDNotificationFrequencyChangeNotAllowedA notification cannot be changed to or from the BIRTHDAY frequency.Delete the notification and create a new one with the frequency you need.
PRORATE_NOT_ALLOWEDProrateNotAllowedProrating is allowed only for the first quota period of the user.Remove prorate from the request, or send it only for the first quota period of the user.
QUOTA_PERIOD_NOT_AVAILABLEQuotaPeriodNotAvailableThe user has no next quota period for this leave type.Send period=current instead of period=next.
ROLE_SCOPE_MISMATCHRoleScopeMismatchThe scope of the role assignment does not match the scope type of the role.Send a scope of the type the role expects, or choose a role whose scope type matches the scope you send.
VALIDATION_ERRORValidationErrorA query parameter, body field or header failed validation.Fix the fields listed in details.fields and send the request again.
WEBHOOK_EVENTS_INVALIDWebhookEventsInvalidThe events list is empty or contains unknown event names.Send at least one event name from the list of webhook events in the API reference.
WEBHOOK_URL_INVALIDWebhookUrlInvalidThe webhook URL is not a valid public HTTPS URL.Send an absolute HTTPS URL that points to a publicly reachable host.

Complete 400 catalog from source table0001.

401 errors
CodeNameDescriptionResolution
API_KEY_EXPIREDApiKeyExpiredThe API key has expired.Ask a leave management app admin to create a new key or rotate this one.
API_KEY_INVALIDApiKeyInvalidThe API key is not recognized.Check that you copied the full key, or create a new key in the leave management app dashboard.
API_KEY_MISSINGApiKeyMissingThe request does not include an API key.Send your API key in the Authorization header as "Bearer vt_live_...".
API_KEY_REVOKEDApiKeyRevokedThe API key has been revoked.See details.reason for why it was revoked, then ask a leave management app admin to create a new key.
UNAUTHORIZEDUnauthorizedThe API key is missing, malformed or not recognized.Send a valid API key in the Authorization header as Bearer followed by the full vt_live_ key.

Complete 401 catalog from source table0002.

403 errors
CodeNameDescriptionResolution
ACCESS_DENIEDAccessDeniedThe request was rejected before it reached the API.Check the API key and the request, and contact leave management app support with the requestId if it keeps happening.
API_ADDON_INACTIVEApiAddonInactiveThe company is not on an active paid plan.Ask a leave management app admin to upgrade to a paid plan or renew the subscription.
AUTOMATION_ADDON_NOT_ACTIVEAutomationAddonNotActiveThe add-on for this automation is not active for this company.Ask a leave management app admin to buy the add-on in Settings, Add-ons, or contact leave management app support.
AUTOMATION_ADMIN_REQUIREDAutomationAdminRequiredThis automation action is allowed only for admins, or for the user who created the automation.Use an API key owned by an admin, or change only automations the key owner created.
FEATURE_NOT_IN_PLANFeatureNotInPlanThe company subscription plan does not include this feature.Remove the setting from the request, or ask a leave management app admin to upgrade the plan.
FORBIDDENForbiddenThe key owner is not allowed to perform this action.See details.reason, and ask a leave management app admin for the required permissions.
INSUFFICIENT_SCOPEInsufficientScopeThe API key does not have the scopes this request needs.Add the scopes listed in details.requiredScopes to the key in the leave management app dashboard.
KEY_EXPIREDKeyExpiredThe API key has passed its expiry date.Ask a leave management app admin to create a new key.
KEY_OWNER_INACTIVEKeyOwnerInactiveThe user who owns the API key has been deactivated or deleted.Ask a leave management app admin to create a new key owned by an active user.
KEY_REVOKEDKeyRevokedThe API key has been revoked.See details.revocationReason for why it was revoked, then ask a leave management app admin to create a new key.
KEY_SCOPES_EXCEED_ROLEKeyScopesExceedRoleThe role of the key owner no longer allows the scopes of this API key.Ask a leave management app admin to create a new key with scopes the owner role allows.
ON_BEHALF_OF_NOT_ALLOWEDOnBehalfOfNotAllowedThe API key cannot act on behalf of the user in the X-On-Behalf-Of header.Add the users:act-on-behalf scope to the key and make sure the key owner manages that user, or remove the X-On-Behalf-Of header.
PLAN_NOT_SUPPORTEDPlanNotSupportedThe company subscription plan does not include API access.Ask a leave management app admin to upgrade to a paid plan.
PUBLIC_API_NOT_ENABLEDPublicApiNotEnabledThe company is not on a paid plan.Ask a leave management app admin to upgrade to a paid plan.
SCHEDULED_REPORTS_NOT_AVAILABLEScheduledReportsNotAvailableScheduled reports are not included in the company subscription plan.Ask a leave management app admin to upgrade to the Complete plan.
SUBSCRIPTION_EXPIREDSubscriptionExpiredThe company subscription has expired.Ask a leave management app admin to renew the subscription.
SUBSCRIPTION_INACTIVESubscriptionInactiveThe company subscription has expired or was canceled.Ask a leave management app admin to renew the subscription.
WEBHOOK_EVENTS_NOT_ALLOWEDWebhookEventsNotAllowedThe webhook owner or the API key is not allowed to receive some of the requested events.Subscribe only to events that the owner role and the API key scopes allow, or ask a leave management app admin for more permissions.
WORK_HOURS_LIMIT_REACHEDWorkHoursLimitReachedThe work hours in the request exceed what the company subscription plan allows.Use the default work hours, or ask a leave management app admin to upgrade the plan.

Complete 403 catalog from source table0003.

404 errors
CodeNameDescriptionResolution
AUTOMATION_TYPE_NOT_FOUNDAutomationTypeNotFoundThe automation type in the path is not recognized.Use one of the automation types listed in the API reference.
OPERATION_NOT_FOUNDOperationNotFoundThe operation does not exist or has expired.Check the operation ID; operations are kept for 90 days.
RESOURCE_NOT_FOUNDResourceNotFoundThe requested resource does not exist or is outside the data this key can access.Check the ID of the resource named in details.resource and that the key owner can see it.
ROLE_NOT_FOUNDRoleNotFoundThe role does not exist in this company.Check the role ID and send a role that exists in the company.
ROUTE_NOT_FOUNDRouteNotFoundNo endpoint matches this method and path.Check the method and path against the API reference.
WEBHOOK_DELIVERY_NOT_FOUNDWebhookDeliveryNotFoundThe webhook delivery does not exist or has expired.Check the delivery ID; deliveries are kept for 30 days.
WEBHOOK_NOT_FOUNDWebhookNotFoundThe webhook does not exist or is not visible to the key owner.Check the webhook ID, and list the webhooks to see the ones the key owner can manage.

Complete 404 catalog from source table0004.

409 errors
CodeNameDescriptionResolution
AUTOMATION_OVERRIDE_REQUIREDAutomationOverrideRequiredThe leave breaks one or more automation rules, listed in details.warnings.Repeat the request with overrideAutomations listing every code in details.warnings, or change the dates.
CONFLICTConflictThe request conflicts with the current state of the resource.Read the resource again and retry with up-to-date values.
DEFAULT_DEPARTMENT_DELETE_FORBIDDENDefaultDepartmentDeleteForbiddenThe default department cannot be deleted.Make another department the default first, then delete this one.
DEFAULT_DEPARTMENT_UNSET_FORBIDDENDefaultDepartmentUnsetForbiddenThe company must always have a default department.Make another department the default first instead of unsetting this one.
DEFAULT_LOCATION_DELETE_FORBIDDENDefaultLocationDeleteForbiddenThe default location cannot be deleted.Make another location the default first, then delete this one.
DEFAULT_LOCATION_UNSET_FORBIDDENDefaultLocationUnsetForbiddenThe company must always have a default location.Make another location the default first instead of unsetting this one.
DEPARTMENT_CIRCULAR_PARENTDepartmentCircularParentA department cannot have one of its own subdepartments as its parent.Choose a parent department that is not below this department.
DEPARTMENT_HAS_SUBDEPARTMENTSDepartmentHasSubdepartmentsA department with subdepartments cannot be deleted.Delete or move its subdepartments first, then delete the department.
DUPLICATE_NAMEDuplicateNameAnother item of the same kind already uses this name.Choose a different name, or update the existing item instead of creating a new one.
EMAIL_ALREADY_EXISTSEmailAlreadyExistsAnother user in the company already has this email address.Use a different email address, or update the existing user instead of creating a new one.
HOLIDAY_DATES_OVERLAPHolidayDatesOverlapThe holiday dates overlap another holiday in the same location.Choose dates that do not overlap an existing holiday, or change the other holiday first.
HOLIDAY_UPDATE_NOT_POSSIBLEHolidayUpdateNotPossibleThe holiday cannot be updated in its current state.Read the holiday again, or delete it and create a new one.
IDEMPOTENCY_REQUEST_IN_PROGRESSIdempotencyRequestInProgressA request with this Idempotency-Key is still being processed.Wait a few seconds and retry with the same Idempotency-Key.
LAST_ADMIN_CANNOT_BE_REMOVEDLastAdminCannotBeRemovedThe user is the only admin in the company, so the admin role cannot be removed.Make another user an admin first, then remove the admin role from this user.
USER_SEAT_LIMIT_REACHEDUserSeatLimitReachedThe company has no free user seats left in its subscription.Deactivate another user, or ask a leave management app admin to add seats to the subscription, then retry.
WEBHOOK_REVOKEDWebhookRevokedThe webhook has been revoked and can no longer be changed or used.See revocationReason on the webhook for why it was revoked, then create a new webhook.

Complete 409 catalog from source table0005.

422 errors
CodeNameDescriptionResolution
HOLIDAY_INVALID_DATESHolidayInvalidDatesThe holiday dates are not valid.Send a start and end in the same year, with the start not after the end, and a start year from 2020 to next year.
IDEMPOTENCY_KEY_REUSEDIdempotencyKeyReusedThis Idempotency-Key was already used with a different request payload.Use a new Idempotency-Key for a different request, or resend the original payload.
LEAVE_BLACKOUT_PERIODLeaveBlackoutPeriodThe leave falls within a blackout period.Choose dates outside the blackout period, or ask an admin to change it.
LEAVE_DURATION_LIMITLeaveDurationLimitThe leave is longer than this leave type allows.Shorten the leave or split it into several requests.
LEAVE_INVALID_DATE_RANGELeaveInvalidDateRangeThe leave end date is before its start date.Send an end date that is the same as or after the start date.
LEAVE_INVALID_DURATIONLeaveInvalidDurationThe leave duration is not allowed for this leave type.Check whether the leave type allows half days or hourly leaves, and adjust the request.
LEAVE_INVALID_HALF_DAY_DURATIONLeaveInvalidHalfDayDurationThe leave type is booked in half days, and the requested times are not exactly half of the user's working hours on that day.Set the end time to the start time plus half of the user's working hours on that day, or plus 4 hours on a day without working hours. The end can be 24:00.
LEAVE_MAXIMUM_USERS_AWAYLeaveMaximumUsersAwayToo many users are already away on these dates.Choose other dates, or ask an admin to change the maximum users away setting.
LEAVE_NEGATIVE_BALANCELeaveNegativeBalanceThe user does not have enough balance for this leave.Shorten the leave, use a different leave type, or ask an admin to adjust the quota.
LEAVE_NOTICE_PERIODLeaveNoticePeriodThe leave does not respect the required notice period.Choose a later start date that meets the notice period.
LEAVE_NO_WORKING_DAYSLeaveNoWorkingDaysThe selected dates contain no working days.Choose dates that include at least one working day for the user.
LEAVE_OVERLAPLeaveOverlapThe leave overlaps with another leave of the same user.Choose dates that do not overlap an existing leave, or cancel the other leave first.
LEAVE_POLICY_MISSINGLeavePolicyMissingThe leave type is not enabled for the user location.Use a leave type enabled for the user location, or ask an admin to enable it there.
LEAVE_PROBATION_PERIODLeaveProbationPeriodThe user is still in a probation period for this leave type.Choose dates after the probation period ends, or use a different leave type.
LEAVE_REASON_REQUIREDLeaveReasonRequiredThis leave type requires a reason.Add a reason to the request.
LEAVE_REQUEST_NOT_EDITABLELeaveRequestNotEditableThe leave can no longer be changed.Read the leave to see its current status, or cancel it and create a new one.
LEAVE_REQUEST_NOT_OPENLeaveRequestNotOpenThe leave request is no longer open for approval or denial.Read the leave to see its current status before taking another action.
LEAVE_START_DATE_IN_PASTLeaveStartDateInPastThe leave starts in the past, which this leave type does not allow.Choose a start date that is today or later.
LEAVE_TYPE_INACTIVELeaveTypeInactiveThe leave type is not active.Use an active leave type, or ask an admin to activate this one.
PLAN_LIMIT_REACHEDPlanLimitReachedThe company has reached a limit of its subscription plan.Ask a leave management app admin to upgrade the plan or remove unused items.
REQUEST_REJECTEDRequestRejectedThe request was rejected by a business rule.See details.message for the reason, adjust the request, and try again.
TOIL_INVALID_REQUESTToilInvalidRequestThe dates, hours or duration of the time off in lieu request are not valid.Check that the end is after the start and that the duration matches what the leave type allows, then send the request again.
TOIL_NOT_ALLOWEDToilNotAllowedTime off in lieu is not enabled for this user or leave type.Ask an admin to enable time off in lieu for the leave type in the user location.
TOIL_OVERLAPToilOverlapThe time off in lieu request overlaps with another request of the same user.Choose dates that do not overlap an existing request, or cancel the other request first.
TOIL_REASON_REQUIREDToilReasonRequiredThis leave type requires a reason for time off in lieu requests.Add a reason to the request.
TOIL_REQUEST_NOT_OPENToilRequestNotOpenThe time off in lieu request is no longer open for this action.Read the request to see its current status before taking another action.
UNKNOWN_USER_IDSUnknownUserIdsSome user IDs in userIds or approvers do not belong to active users of the company.Remove the unknown user IDs from userIds and approvers and send the request again.
USER_NOT_EMPLOYED_ON_DATESUserNotEmployedOnDatesThe user is not employed on some of the selected dates.Choose dates between the user employment start and end dates.

Complete 422 catalog from source table0006.

429 errors
CodeNameDescriptionResolution
QUOTA_EXCEEDEDQuotaExceededThe request quota for this API key has been used up.Wait until the quota resets, or contact leave management app support for a higher quota.
RATE_LIMITEDRateLimitedToo many requests were sent in a short time.Wait a few seconds and retry, using the same Idempotency-Key for writes.

Complete 429 catalog from source table0007.

500 errors
CodeNameDescriptionResolution
INTERNAL_ERRORInternalErrorSomething went wrong on our side.Retry later, and if it keeps happening, contact leave management app support and quote the requestId.

Complete 500 catalog from source table0008.

Frequently asked questions

Should code handle errors by code, name, or description?

Branch on code. It is stable for programmatic handling, while name and description are explanatory and may be less suitable as control logic.

What should be included when contacting support about an error?

Include requestId when contacting support. It identifies the specific request.

Is details always present in an error response?

details is optional. When present it carries extra context, such as fields that failed validation or required scopes.

{
  "error": {
    "code": "INSUFFICIENT_SCOPE",
    "name": "InsufficientScope",
    "description": "Example post details.",
    "resolution": "Add the scopes listed in details.requiredScopes to the key in the OnlyLeave dashboard.",
    "requestId": "8d59b5c4-e711-463a-9575-bed7f40fbe6a",
    "details": { "requiredScopes": ["users:read"] }
  }
}