# inspectDelivery

> **inspectDelivery**(`bearer`, `bytes`, `options?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`InspectedDelivery`](/reference/filoz/keysmith/interfaces/inspecteddelivery/)\>

Defined in: [packages/keysmith/src/claims.ts:905](https://github.com/FilOzone/synapse-sdk/blob/09891325d324c1cbb9d5751bd40c66d91ba9f2d2/packages/keysmith/src/claims.ts#L905)

Inspect a delivery for `bearer` before the piece's envelope labels are
available: decode strictly, verify every signature, `maxDepth`, every
narrowing step decidable without labels, the final bearer, and that the
wrapped grant names the final claim, without unwrapping any key or returning
a [VerifiedClaim](/reference/filoz/keysmith/interfaces/verifiedclaim/).

When a link narrows to a piece and needs the piece's labels to verify, its
index is recorded in `uncheckedLinks` and checking continues across all
remaining links. The returned `owner` is a verified claim chain lookup hint
(for locating providers before download), not proof that the delivery
applies to a specific envelope: call [openDelivery](/reference/filoz/keysmith/functions/opendelivery/) with the piece's
labels to finish deferred chain and unauthenticated label checks, then pass
the returned key and grant to [keyResolver](/reference/filoz/keysmith/functions/keyresolver/) for authenticated FEE
decryption.

As with [openDelivery](/reference/filoz/keysmith/functions/opendelivery/), an expired delivery still inspects and reports
`expired: true`.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `bearer` | `` `0x${string}` `` |
| `bytes` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) |
| `options?` | [`InspectDeliveryOptions`](/reference/filoz/keysmith/interfaces/inspectdeliveryoptions/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`InspectedDelivery`](/reference/filoz/keysmith/interfaces/inspecteddelivery/)\>

## Throws

With the reason the delivery is refused.