> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endstate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# endstate.vaultRequests.get

> One vault request with its current state; read it again to follow an unvault through `availableAt`, `hold`, `readyToShip` and `dispatchedAt`.

```ts theme={null}
get(unitId: string, requestId: string, options?: RequestOptions): Promise<VaultRequest>
```

| | |
| - | - |
| Endpoint | [`GET /v1/units/{unit_id}/vault-requests/{request_id}`](https://docs.endstate.io/api-reference/vaults/get-a-vault-request) |
| Credential | Secret key (`end_sk_...`) |
| Retry class | `read` |

Retried on network failure, timeout, `429`, and `5xx`.

## Example

```ts theme={null}
const result = await endstate.vaultRequests.get(unit.id, request.id);
```

## Parameters

**unit\_id** `string` *required*

Unit id.

**request\_id** `string` *required*

Vault request id.

## Returns

`200` - `VaultRequest`.

**id** `string` *required*

Vault request id.

**unit\_id** `string` *required*

The unit the request is for.

**vault** `object` *required*

The vault the request names.

**status** `'pending' | 'submitted' | 'active' | 'unvault_waiting' | 'unvaulting' | 'unvaulted' | 'cancelled' | 'expired' | 'rejected' | 'failed'` *required*

Where the request is now. `pending`: the owner approved and the vault has not decided. `submitted`: the vault confirmed it has the item and Endstate is recording it. `active`: the item is vaulted. `unvault_waiting`: the owner asked for the item back and the waiting period runs, or the item is ready to ship. `unvaulting`: the vault dispatched the item and Endstate is completing the unvault. `unvaulted`: the unvault is complete. `cancelled`, `expired` and `rejected` end a request that never vaulted the item, and never change again. `failed`: the item was not recorded as vaulted; the request becomes `active` if the item is later recorded as vaulted after all. A status can move back. A cancel of the unvault, once recorded, returns `unvault_waiting` to `active`, and `unvaulting` too in the rare case one is recorded after the dispatch. Rarely, the network revises its latest records, which can return `unvaulted` to `unvaulting` or `active`, `unvault_waiting` or `unvaulting` to `active`, and `active` to `failed`. Read the status as the request's current state, not as a one-way log.

**notes** `string | null` *required*

Free text the vault's staff left when they confirmed or rejected the request. Null when they left none.

**rejection\_reason** `string | null` *required*

Why the request was rejected: the vault's reason, or `owner_changed` when the unit changed hands after its owner approved.

**decided\_at** `string | null` *required*

When the vault confirmed or rejected the request, or Endstate rejected it; null until then.

**available\_at** `string | null` *required*

When the unvault's waiting period ends. Null until the owner's request to unvault is recorded, and again if the owner cancels it. A hold stops the clock, and lifting it moves this later by the time the hold lasted.

**hold** `object | null` *required*

The hold on a waiting unvault, or null. `by` says who placed it, the vault or the brand, and `reason` is their text. While it stands the item is not ready to ship.

**ready\_to\_ship** `boolean` *required*

Whether the item is ready to ship: its waiting period has ended and nothing holds it. The vault records dispatch with a tap of the item from then on.

**dispatched\_at** `string | null` *required*

When the vault's tap recorded the item's dispatch. Endstate then completes the unvault; the vault hands the item over once the request reads `unvaulted`.

**expires\_at** `string | null` *required*

When a pending request expires; null once it has moved on.

## Errors

Branch on `error.code`, never on the HTTP status - several codes share one.

| Code | HTTP | Retry |
| - | - | - |
| `auth.forbidden` | 403 | Do not retry |
| `auth.unauthorized` | 401 | Do not retry |
| `internal.error` | 500 | Safe to retry |
| `not_found.resource` | 404 | Do not retry |
| `rate_limit.exceeded` | 429 | Safe to retry |
| `unit.not_found` | 404 | Do not retry |
| `validation.failed` | 400 | Do not retry |
| `vault.request_not_found` | 404 | Do not retry |

See [Errors and retries](https://docs.endstate.io/sdks/core/errors-and-retries.md) for the error types and how to narrow them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.