Check an asynchronous operation status
Use this endpoint after a write returns 202 Accepted to follow that work to a clear outcome. It reports whether the operation succeeded, failed, is still pending, or has become UNKNOWN, and identifies the affected resource when that information is available.
Request
Send a GET request for the operation identifier supplied as operation.id in the 202 response, or taken from the Location header. The path parameter id is a required string. Authenticate with Authorization: Bearer followed by the full vt_live_ key. No scope is required, but ownership still matters: a key can read only operations it created. The X-On-Behalf-Of header is ignored here.
Reading the operation response
A 200 response wraps the operation in data. Its required fields are id, status, action, and createdAt. CompletedAt is set once the operation reaches SUCCEEDED or FAILED. ActingAsUserId, when present, identifies the user the operation was performed as, either the key owner or the X-On-Behalf-Of user from the original write. Resource, when known, contains type, id, and url for the affected item. Error is present on a failed operation and carries the catalog code for the write failure.
Status checklist
PENDING means the work has not finished, so poll again. SUCCEEDED is a terminal success. FAILED is a terminal failure; inspect the included error code before retrying or changing the request. UNKNOWN is different from both: no result arrived within 15 minutes, so the change may or may not have been applied. In that state, read the affected resource to check its actual condition rather than assuming success or failure. A result arriving later can still update the status to SUCCEEDED or FAILED.
How to act on the result
Use this decision sequence: first confirm you are using the same key that created the operation, because another key produces 404 RESOURCE_NOT_FOUND. Then check status. If PENDING, continue polling. If SUCCEEDED, follow resource.url when you need the affected item. If FAILED, act on the error code. If UNKNOWN, verify the resource directly. For transport-level failures, use the standard error envelope: 401 for a missing, malformed, or unrecognized key; 403 for scope or permission problems; 404 when the operation does not exist or belongs to another key; 429 when rate limited; and 500 for a server-side problem. Error bodies include code, name, description, resolution, and requestId, with optional details.
Frequently asked questions
Does checking an operation require a scope?
No scope is needed for this lookup. Authentication is still required, and the key can only retrieve operations that same key created. An operation created by a different key returns 404 RESOURCE_NOT_FOUND.
When should polling stop, and what does UNKNOWN mean?
Keep polling until the status reaches SUCCEEDED or FAILED. If it becomes UNKNOWN, no result had arrived within 15 minutes and the change may or may not have been applied, so inspect the affected resource. A later result can still move it to SUCCEEDED or FAILED.
Where is the failure reason and affected resource?
A FAILED operation includes an error carrying the catalog code for the failed write. When the affected resource is known, resource.url points to it.
Does X-On-Behalf-Of affect this endpoint?
X-On-Behalf-Of is ignored for this endpoint, so it does not change which operations the key can read.
curl -X GET "$API_BASE_URL/v2/operations/pa_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93" \
-H "Authorization: Bearer "{
"data": {
"id": "pa_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93",
"status": "SUCCEEDED",
"action": "leaves.approve",
"createdAt": "2026-09-23T10:00:00.000Z",
"completedAt": "2026-09-23T10:00:02.000Z",
"actingAsUserId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14",
"resource": {
"type": "leave",
"id": "leaveRequest-cfe5d39b-f1f0-45aa-85cd-ce93e637a262",
"url": "/v2/leaves/leaveRequest-cfe5d39b-f1f0-45aa-85cd-ce93e637a262"
}
}
}{
"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": "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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | string | Yes | operation ID, as returned in the operation.id field of a 202 response. |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | object | No | ||
| response.data.id | string | Yes | operation ID | |
| response.data.status | string | Yes | operation 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.data.action | string | Yes | the public action the operation performs | |
| response.data.createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data.completedAt | string | No | a timestamp in the ISO 8601 format, set when the operation is SUCCEEDED or FAILED | Format: date-time |
| response.data.actingAsUserId | string | No | the ID of the user the operation was performed as (the key owner or the X-On-Behalf-Of user) | |
| response.data.resource | object | No | the resource affected by the operation, when known | |
| response.data.resource.type | string | No | ||
| response.data.resource.id | string | No | ||
| response.data.resource.url | string | No | ||
| response.data.error | object | No | ||
| response.data.error.code | string | Yes | stable machine-readable error code | |
| response.data.error.name | string | Yes | short human-readable error name | |
| response.data.error.description | string | Yes | what went wrong | |
| response.data.error.resolution | string | Yes | how to fix the problem | |
| response.data.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.data.error.details | object | No | optional additional information specific to the error code | |
| response.data.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |