Skip to content

Enable or replace a location leave policy

The PUT location leave-policy endpoint enables a leave type in a location or replaces an already active policy. It uses the leave-policies:write scope and performs a full replacement, not a merge.

What this endpoint does

A successful call either turns on a leave policy for a leave type in a specific location or overwrites the existing active policy. The acting user is the API key owner unless you supply an X-On-Behalf-Of header. The endpoint waits for the change and returns the policy with 200, or returns 202 Accepted with an operation to poll.

Full replacement, not a merge

Every PUT replaces the whole policy. The fields daysPerYear, maxRolloverDays, quotaUnit, isApprovalRequired, hasUnlimitedDays, hideLeaveType, isReasonRequired, shortestLeaveInterval, and toil.enabled are required. Optional fields you leave out are not carried over from the active policy. If you only want to change a few fields, use the PATCH endpoint instead.

Accrual rules

If you omit accrual, the policy does not accrue. When accrual.type is an accruing type, you must also send firstEarningDate, periodStart, allowAdvanceUsage, and pauseWhenUserDeactivated. When accrual.type is NONE, periodStart is not allowed.

One-time actions

Two flags trigger side effects that are never stored or returned. Setting resetUserOverrides to true clears every per-user override of this policy in the location. Setting broughtForwardExpiration.applyToPastYear to true applies the expiry to leave rolled over from the previous year.

Strict types

The body is validated strictly. A number sent as a string, an unknown field, or an invalid JSON body fails validation.

Authentication and headers

Send the API key as Authorization: Bearer vt_live_<secret>. The key needs the leave-policies:write scope. To perform the write for another user, add X-On-Behalf-Of with that user's ID; this also requires the users:act-on-behalf scope and the key owner must manage the target user. An Idempotency-Key header makes the write safe to retry: keys are retained for 24 hours per API key, and retrying with the same key and request replays the original response.

Request body field map

Required fields: quotaUnit ("days" or "hours"), daysPerYear (0–365), maxRolloverDays (0–365), hasUnlimitedDays, isApprovalRequired, isReasonRequired, hideLeaveType, shortestLeaveInterval ("FULL-DAY", "HALF-DAY", "ONE-HOUR", "HALF-HOUR", or "FIFTEEN-MINUTES"), and toil.enabled. Optional fields: hoursPerYear (0–2920), maxRolloverHours (0–2920), allowLeaveInPast, negativeBalanceAllowed, negativeBroughtForwardAllowed, accrual, broughtForwardExpiration, and resetUserOverrides. The accrual object accepts type, capRate (0 or 0.1–10), firstEarningDate, periodStart, allowAdvanceUsage, and pauseWhenUserDeactivated. The broughtForwardExpiration object accepts enabled, month, day, afterDays, and applyToPastYear.

Worked example: a 20-day fixed quota

The supplied fixedQuota example sends quotaUnit "days", daysPerYear 20, maxRolloverDays 5, isApprovalRequired true, hasUnlimitedDays false, hideLeaveType false, isReasonRequired false, shortestLeaveInterval "HALF-DAY", and toil.enabled false. A 200 response returns the policy with locationId, leaveTypeId, isActive true, and the same quota settings. The response also includes hoursPerYear, maxRolloverHours, allowLeaveInPast, negativeBalanceAllowed, negativeBroughtForwardAllowed, accrual, broughtForwardExpiration, and toil.

Reading the responses

200 returns the enabled or replaced policy. 202 returns an operation object with id, status, and url; poll the URL until status is SUCCEEDED or FAILED. A status of UNKNOWN means no result arrived within 15 minutes, so read the resource to check whether the change was applied. 400 VALIDATION_ERROR lists the failing fields in details.fields. 403 ON_BEHALF_OF_NOT_ALLOWED means the key owner cannot act for that user. 403 FORBIDDEN means the key owner lacks permission. 403 FEATURE_NOT_IN_PLAN means the plan does not include an accruing accrual.type, toil.enabled true, or a ONE-HOUR, HALF-HOUR, or FIFTEEN-MINUTES shortestLeaveInterval; details.settings lists the unsupported settings, while settings the policy already has are accepted. 404 RESOURCE_NOT_FOUND means the location does not exist or is outside the key's data reach, or the leave type does not exist or was deleted; details.resource is location or leaveType. Idempotency-Key errors use 422 IDEMPOTENCY_KEY_REUSED, 409 IDEMPOTENCY_REQUEST_IN_PROGRESS, and 400 INVALID_IDEMPOTENCY_KEY.

PUT or PATCH: a quick decision checklist

Choose PUT when you are enabling the policy for the first time or replacing the entire policy. Choose PATCH when you only need to change a few fields and want the current accrual merged field by field. Before sending a PUT, confirm that every required field is present, that omitted optional fields are acceptable to lose, that any one-time flags are intentional, and that the plan supports the accrual, TOIL, and interval settings you are requesting.

Frequently asked questions

Should I use PUT or PATCH to change a leave policy?

Use PUT to enable a policy or replace it completely. Use PATCH when you only want to change some fields, because PATCH merges the accrual field by field with the current accrual.

What should I do when the endpoint returns 202?

Poll the operation URL until its status is SUCCEEDED or FAILED. If the status is UNKNOWN, read the resource to check whether the change was applied.

Can I safely retry a failed PUT?

Yes, if you send the same Idempotency-Key and the same request within 24 hours. The original response is replayed. Reusing the key with a different request returns 422 IDEMPOTENCY_KEY_REUSED.

Why does a valid policy still return 403 FEATURE_NOT_IN_PLAN?

The plan may not include the accruing accrual.type, toil.enabled true, or the requested ONE-HOUR, HALF-HOUR, or FIFTEEN-MINUTES shortestLeaveInterval. details.settings lists the unsupported settings. Settings the policy already has are accepted.

curl -X PUT "$API_BASE_URL/v2/locations/string/leave-policies/string" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{
    "quotaUnit": "days",
    "daysPerYear": 20,
    "maxRolloverDays": 5,
    "isApprovalRequired": true,
    "hasUnlimitedDays": false,
    "hideLeaveType": false,
    "isReasonRequired": false,
    "shortestLeaveInterval": "HALF-DAY",
    "toil": {
      "enabled": false
    }
  }'
{
  "data": {
    "locationId": "location-79c77ac8-e5bf-479f-9488-648a58379ff1",
    "leaveTypeId": "leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615",
    "isActive": true,
    "quotaUnit": "days",
    "daysPerYear": 20,
    "hoursPerYear": 160,
    "maxRolloverDays": 5,
    "maxRolloverHours": 40,
    "hasUnlimitedDays": false,
    "isApprovalRequired": true,
    "isReasonRequired": false,
    "hideLeaveType": false,
    "allowLeaveInPast": false,
    "negativeBalanceAllowed": false,
    "shortestLeaveInterval": "HALF-DAY",
    "negativeBroughtForwardAllowed": false,
    "accrual": {
      "type": "MONTHLY",
      "capRate": 2,
      "firstEarningDate": "2026-01-01",
      "periodStart": "2026-01-01",
      "allowAdvanceUsage": false,
      "pauseWhenUserDeactivated": true
    },
    "broughtForwardExpiration": {
      "enabled": true,
      "month": 3,
      "day": 31
    },
    "toil": {
      "enabled": false
    }
  }
}
{
  "operation": {
    "id": "pa_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93",
    "status": "PENDING",
    "url": "/v2/operations/pa_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93"
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "name": "ValidationError",
    "description": "Example post details.",
    "resolution": "Fix the fields listed in details.fields and send the request again.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
    "details": {
      "fields": [
        {
          "path": "startDate",
          "message": "\"startDate\" is required"
        }
      ]
    }
  }
}
{
  "error": {
    "code": "UNAUTHORIZED",
    "name": "Unauthorized",
    "description": "Example post details.",
    "resolution": "Send a valid API key in the Authorization header as Bearer followed by the full vt_live_ key.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "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": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
    "details": {
      "requiredScopes": [
        "leaves:write"
      ]
    }
  }
}
{
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "name": "ResourceNotFound",
    "description": "Example post details.",
    "resolution": "Check the ID of the resource named in details.resource and that the key owner can see it.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "name": "Conflict",
    "description": "Example post details.",
    "resolution": "Read the resource again and retry with up-to-date values.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "LEAVE_NEGATIVE_BALANCE",
    "name": "LeaveNegativeBalance",
    "description": "Example post details.",
    "resolution": "Shorten the leave, use a different leave type, or ask an admin to adjust the quota.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "name": "RateLimited",
    "description": "Example post details.",
    "resolution": "Wait a few seconds and retry, using the same Idempotency-Key for writes.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "INTERNAL_ERROR",
    "name": "InternalError",
    "description": "Example post details.",
    "resolution": "Retry later, and if it keeps happening, contact OnlyLeave support and quote the requestId.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}

id

FieldTypeRequiredDescriptionConstraints
idstringYesresource ID.

leaveTypeId

FieldTypeRequiredDescriptionConstraints
leaveTypeIdstringYesleave type ID.

Idempotency-Key

FieldTypeRequiredDescriptionConstraints
Idempotency-KeystringNooptional key (1 to 255 printable ASCII characters) that makes a write request safe to retry. Keys are retained for 24 hours per API key. Retrying with the same key and the same request within those 24 hours replays the original response (with the Idempotent-Replayed header). Reusing the key with a different request returns 422 IDEMPOTENCY_KEY_REUSED ; retrying while the first request is still running returns 409 IDEMPOTENCY_REQUEST_IN_PROGRESS ; an invalid key returns 400 INVALID_IDEMPOTENCY_KEY .1 <= length <= 255

X-On-Behalf-Of

FieldTypeRequiredDescriptionConstraints
X-On-Behalf-OfstringNoID of the user the write is performed for. Requires the users:act-on-behalf scope, and the key owner must manage the target user; otherwise the request fails with 403 ON_BEHALF_OF_NOT_ALLOWED . Ignored on GET requests.

body

FieldTypeRequiredDescriptionConstraints
bodyobjectYesThe full policy. Types are strict (for example, a number sent as a string fails validation). Optional fields you omit are not carried over from an active policy.
body.quotaUnitstringYesthe unit the quota is set inAllowed values: "days" | "hours"
body.daysPerYearnumberYesthe yearly quota in days0 <= value <= 365
body.hoursPerYearnumberNothe yearly quota in hours0 <= value <= 2920
body.maxRolloverDaysnumberYesthe maximum number of unused days that roll over into the next leave year0 <= value <= 365
body.maxRolloverHoursnumberNothe maximum number of unused hours that roll over into the next leave year0 <= value <= 2920
body.hasUnlimitedDaysbooleanYeswhether the leave type grants unlimited leave in this location
body.isApprovalRequiredbooleanYeswhether leaves of this type need approval in this location
body.isReasonRequiredbooleanYeswhether a reason is required
body.hideLeaveTypebooleanYeswhether the leave type is hidden from users in this location when they request leave
body.allowLeaveInPastbooleanNowhether users can request leave for past dates
body.negativeBalanceAllowedbooleanNowhether a user's balance can go negative
body.negativeBroughtForwardAllowedbooleanNowhether a negative balance is brought forward into the next leave year
body.shortestLeaveIntervalstringYesthe smallest unit of leave a user can requestAllowed values: "FULL-DAY" | "HALF-DAY" | "ONE-HOUR" | "HALF-HOUR" | "FIFTEEN-MINUTES"
body.accrualobjectNoaccrual fields to change, merged field by field with the current accrual. The merged accrual must meet the same rules as in PUT; switching to NONE drops the stored periodStart.
body.accrual.typestringYesthe accrual type, for example NONE , WEEKLY or MONTHLY ; unknown values fail validation
body.accrual.capRateNothe accrual cap rate, 0 (no cap) or from 0.1 to 10
body.accrual.capRate[variant1]numberthe accrual cap rate, 0 (no cap) or from 0.1 to 10
body.accrual.capRate[variant2]numberthe accrual cap rate, 0 (no cap) or from 0.1 to 100.1 <= value <= 10
body.accrual.capRate[variant3]numberthe accrual cap rate, 0 (no cap) or from 0.1 to 100.1 <= value <= 10
body.accrual.capRate[variant4]numberthe accrual cap rate, 0 (no cap) or from 0.1 to 100.1 <= value <= 10
body.accrual.firstEarningDatestringNoa date in YYYY-MM-DD format^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
body.accrual.periodStartstringNoa date in YYYY-MM-DD format^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
body.accrual.allowAdvanceUsagebooleanNowhether users can use leave before it is accrued
body.accrual.pauseWhenUserDeactivatedbooleanNowhether accrual pauses while the user is deactivated
body.broughtForwardExpirationobjectNo
body.broughtForwardExpiration.enabledbooleanYeswhether rolled-over leave expires. Required in PUT when broughtForwardExpiration is sent.
body.broughtForwardExpiration.monthintegerNomonth rolled-over leave expires in, for a fixed expiry date1 <= value <= 12
body.broughtForwardExpiration.dayintegerNoday of the month rolled-over leave expires on, for a fixed expiry date1 <= value <= 31
body.broughtForwardExpiration.afterDaysintegerNonumber of days after the leave year starts that rolled-over leave expires, instead of a fixed date0 <= value <= 364
body.broughtForwardExpiration.applyToPastYearbooleanNoone-time action, never stored or returned. When true, the expiry settings also apply to leave rolled over from the previous year.
body.toilobjectYes
body.toil.enabledbooleanYeswhether users can request TOIL for this leave type in this location. Required in PUT. true needs a plan that includes TOIL.
body.toil.shortestIntervalstringNothe smallest unit of leave a user can request"FULL-DAY" | "HALF-DAY" | "ONE-HOUR" | "HALF-HOUR" | "FIFTEEN-MINUTES"
body.toil.requestsAllowedForUsersbooleanNowhether users can request TOIL themselves, not only approvers
body.toil.expirationbooleanNowhether earned TOIL expires
body.toil.expirationDatestringNothe date earned TOIL expires; an empty string means none
body.toil.expirationDate[variant1]stringa date in YYYY-MM-DD format^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
body.toil.expirationDate[variant2]stringa date in YYYY-MM-DD format^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
body.toil.expirationDate[variant3]stringthe date earned TOIL expires; an empty string means none^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
body.toil.expirationDate[variant4]unknownthe date earned TOIL expires; an empty string means none
body.toil.expirationMonthsintegerNothe number of months after which earned TOIL expires; 0 means none0 <= value <= 12
body.resetUserOverridesbooleanNoone-time action, never stored or returned. When true, clears every per-user override of this policy in this location.

response

FieldTypeRequiredDescriptionConstraints
responseobject
response.dataobjectYes
response.data.locationIdstringYesthe ID of the location this policy applies to
response.data.leaveTypeIdstringYesthe ID of the leave type this policy belongs to
response.data.isActivebooleanYesalways true, because only active policies are returned
response.data.quotaUnitstringYesthe unit the quota is set inAllowed values: "days" | "hours"
response.data.daysPerYearnumberYesthe yearly quota in days
response.data.hoursPerYearnumberNothe yearly quota in hours
response.data.maxRolloverDaysnumberYesthe maximum number of unused days that roll over into the next leave year
response.data.maxRolloverHoursnumberNothe maximum number of unused hours that roll over into the next leave year
response.data.hasUnlimitedDaysbooleanYeswhether the leave type grants unlimited leave in this location
response.data.isApprovalRequiredbooleanYeswhether leaves of this type need approval in this location
response.data.isReasonRequiredbooleanYeswhether a reason is required
response.data.hideLeaveTypebooleanYeswhether the leave type is hidden from users in this location when they request leave
response.data.allowLeaveInPastbooleanYeswhether users can request leave for past dates
response.data.negativeBalanceAllowedbooleanYeswhether a user's balance can go negative
response.data.shortestLeaveIntervalstringYesthe smallest unit of leave a user can requestAllowed values: "FULL-DAY" | "HALF-DAY" | "ONE-HOUR" | "HALF-HOUR" | "FIFTEEN-MINUTES"
response.data.negativeBroughtForwardAllowedbooleanYeswhether a negative balance is brought forward into the next leave year
response.data.accrualobjectYesaccrual settings. Fields that are not set are left out.
response.data.accrual.typestringYesthe accrual type, for example NONE , WEEKLY or MONTHLY . NONE means the full quota is available at the start of the leave year.
response.data.accrual.capRatenumberNothe accrual cap rate, from 0.1 to 10
response.data.accrual.firstEarningDatestringNothe date accrual startsFormat: date
response.data.accrual.periodStartstringNothe start of the first accrual perioddate
response.data.accrual.allowAdvanceUsagebooleanYeswhether users can use leave before it is accrued
response.data.accrual.pauseWhenUserDeactivatedbooleanYeswhether accrual pauses while the user is deactivated
response.data.broughtForwardExpirationobjectYeswhen rolled-over leave expires. A policy with no expiry of its own follows its location's; enabled true with neither a date nor afterDays means rolled-over leave expires at the end of the leave year.
response.data.broughtForwardExpiration.enabledbooleanYeswhether rolled-over (brought forward) leave expires
response.data.broughtForwardExpiration.monthintegerNomonth rolled-over leave expires in, for a fixed expiry date; present only when enabled
response.data.broughtForwardExpiration.dayintegerNoday of the month rolled-over leave expires on, for a fixed expiry date; present only when enabled
response.data.broughtForwardExpiration.afterDaysintegerNonumber of days after the leave year starts that rolled-over leave expires, instead of a fixed date; present only when enabled
response.data.toilobjectYesTOIL settings. Fields that are not set are left out.
response.data.toil.enabledbooleanYeswhether users can request TOIL (time off in lieu) for this leave type in this location
response.data.toil.shortestIntervalstringNothe smallest unit of leave a user can requestAllowed values: "FULL-DAY" | "HALF-DAY" | "ONE-HOUR" | "HALF-HOUR" | "FIFTEEN-MINUTES"
response.data.toil.requestsAllowedForUsersbooleanNowhether users can request TOIL themselves, not only approvers
response.data.toil.expirationbooleanNowhether earned TOIL expires
response.data.toil.expirationDatestringNothe date earned TOIL expiresdate
response.data.toil.expirationMonthsintegerNothe number of months after which earned TOIL expires

response

FieldTypeRequiredDescriptionConstraints
responseobjectReturned with HTTP 202 when a write operation is still running, or succeeded but its result could not be read back yet. The Location header carries the same URL as operation.url . Poll it until the status is SUCCEEDED or FAILED .
response.operationobjectYes
response.operation.idstringYes
response.operation.statusstringYesoperation status. UNKNOWN means no result arrived within 15 minutes; the change may or may not have been applied, so read the resource to check. A result that arrives later still changes it to SUCCEEDED or FAILED.Allowed values: "PENDING" | "SUCCEEDED" | "FAILED" | "UNKNOWN"
response.operation.urlstringYes

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo