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

# Module: requests

> Reference for the bijection/requests entry point.

## Classes

* [RequestOutcomeUnknown](/api/classes/requests.RequestOutcomeUnknown)
* [RequestConflict](/api/classes/requests.RequestConflict)

## Interfaces

* [RequestStore](/api/interfaces/requests.RequestStore)
* [RequestTransport](/api/interfaces/requests.RequestTransport)
* [DecisionStore](/api/interfaces/requests.DecisionStore)
* [DecisionJournal](/api/interfaces/requests.DecisionJournal)

## Type Aliases

### RequestOperation

Ƭ **RequestOperation**\<`Args`, `Result`>: [`OperationReference`](/api/modules/server#operationreference)\<`"public"`, `Args`, `Result`> | \{ `operationId`: `string` ; `contractDigest`: `string` ; `functions?`: \{ `invoke`: `string` ; `recover`: `string`  } ; `_args?`: `Args` ; `_result?`: `Result`  }

#### Type parameters

| Name | Type |
| :- | :- |
| `Args` | extends `Record`\<`string`, [`Value`](/api/modules/values#value)> |
| `Result` | `Result` |

***

### RequestHandle

Ƭ **RequestHandle**\<`Result`>: `Object`

#### Type parameters

| Name | Type |
| :- | :- |
| `Result` | `unknown` |

#### Type declaration

| Name | Type |
| :- | :- |
| `requestId` | [`RequestId`](/api/modules/requests#requestid) |
| `envelope` | [`RequestEnvelope`](/api/modules/requests#requestenvelope) |
| `submit` | (`options?`: \{ `signal?`: `AbortSignal`  }) => `Promise`\<[`RequestView`](/api/modules/requests#requestview)\<`Result`>> |
| `inspect` | (`options?`: \{ `signal?`: `AbortSignal`  }) => `Promise`\<[`RequestInspection`](/api/modules/requests#requestinspection)\<`Result`>> |
| `continue` | (`options?`: \{ `signal?`: `AbortSignal`  }) => `Promise`\<[`RequestView`](/api/modules/requests#requestview)\<`Result`>> |
| `withdraw` | (`options?`: \{ `signal?`: `AbortSignal`  }) => `Promise`\<[`RequestView`](/api/modules/requests#requestview)\<`Result`>> |

***

### DecisionCheckpoint

Ƭ **DecisionCheckpoint**: `Readonly`\<\{ `key`: `string` ; `value`: `string`  }>

A host's immutable decision, committed before any of its tools run.
The value is an opaque, bounded serialization owned by the host adapter.
It contains no credentials. Business intentions remain RequestEnvelopes.

***

### RequestId

Ƭ **RequestId**: `string` & \{ `__requestId`: unique `symbol`  }

***

### EncodedInput

Ƭ **EncodedInput**: `ReturnType`\<typeof [`bijectionToJson`](/api/modules/values#bijectiontojson)>

Not exported: an exported type refers to it.

***

### RequestEnvelope

Ƭ **RequestEnvelope**: `Readonly`\<\{ `version`: typeof [`REQUEST_VERSION`](/api/modules/requests#request_version) ; `requestId`: [`RequestId`](/api/modules/requests#requestid) ; `requestOwnerId`: `string` ; `operationId`: `string` ; `contractDigest`: `string` ; `functions`: `Readonly`\<\{ `invoke`: `string` ; `recover`: `string`  }> ; `input`: [`EncodedInput`](/api/modules/requests#encodedinput)  }>

***

### Requirement

Ƭ **Requirement**: \{ `kind`: `"verification"` ; `verificationId`: `string`  } | \{ `kind`: `"confirmation"` ; `proposalId`: `string` ; `confirmationId`: `string`  } | \{ `kind`: `"approval"` ; `proposalId`: `string` ; `approvalId`: `string`  }

***

### Retained

Ƭ **Retained**\<`T`>: \{ `kind`: `"available"` ; `value`: `T`  } | \{ `kind`: `"omitted"` ; `reason`: `string`  } | \{ `kind`: `"expired"`  }

#### Type parameters

| Name |
| :- |
| `T` |

***

### RequestView

Ƭ **RequestView**\<`T`>: \{ `kind`: `"pending"` ; `requestId`: [`RequestId`](/api/modules/requests#requestid) ; `requirements`: readonly [`Requirement`](/api/modules/requests#requirement)\[] ; `proposal?`: [`Retained`](/api/modules/requests#retained)\<\{ `proposalId`: `string`  }> ; `input?`: \{ `kind`: `"expired"`  }  } | \{ `kind`: `"accepted"` ; `requestId`: [`RequestId`](/api/modules/requests#requestid) ; `receipt`: \{ `invocationId`: `string` | `null` ; `acceptedRevision`: `string` | `null` ; `result`: [`Retained`](/api/modules/requests#retained)\<`T`>  }  } | \{ `kind`: `"refused"` ; `requestId`: [`RequestId`](/api/modules/requests#requestid) ; `receipt`: [`Retained`](/api/modules/requests#retained)\<\{ `code`: `string` ; `message?`: `string`  }>  }

#### Type parameters

| Name | Type |
| :- | :- |
| `T` | `unknown` |

***

### RequestInspection

Ƭ **RequestInspection**\<`T`>: \{ `kind`: `"observed"` ; `request`: [`RequestView`](/api/modules/requests#requestview)\<`T`>  } | \{ `kind`: `"notObserved"` ; `requestId`: [`RequestId`](/api/modules/requests#requestid)  }

Absence is an observation at one read, never permission to mint another ID.

#### Type parameters

| Name | Type |
| :- | :- |
| `T` | `unknown` |

## Variables

### REQUEST\_VERSION

• `Const` **REQUEST\_VERSION**: `1`

## Functions

### createRequestClient

▸ **createRequestClient**(`options`): `Object`

One controller for browser, CLI, jobs and framework integrations.

#### Parameters

| Name | Type |
| :- | :- |
| `options` | `Object` |
| `options.transport` | [`RequestTransport`](/api/interfaces/requests.RequestTransport) |
| `options.store` | [`RequestStore`](/api/interfaces/requests.RequestStore) |

#### Returns

`Object`

| Name | Type |
| :- | :- |
| `create` | \<Args, Result>(`operation`: [`RequestOperation`](/api/modules/requests#requestoperation)\<`Args`, `Result`>, `input`: `Args`, `selection`: \{ `requestId`: `string`  }) => `Promise`\<[`RequestHandle`](/api/modules/requests#requesthandle)\<`Result`>> |
| `restore` | (`id`: `string`) => `Promise`\<[`RequestHandle`](/api/modules/requests#requesthandle)> |

***

### checkpointRequests

▸ **checkpointRequests**(`checkpoints`): [`RequestStore`](/api/interfaces/requests.RequestStore)

Keep immutable request envelopes beside the host's model decisions. The
shared controller still owns binding validation and request semantics.

#### Parameters

| Name | Type |
| :- | :- |
| `checkpoints` | [`DecisionStore`](/api/interfaces/requests.DecisionStore) |

#### Returns

[`RequestStore`](/api/interfaces/requests.RequestStore)

***

### httpRequestTransport

▸ **httpRequestTransport**(`options`): [`RequestTransport`](/api/interfaces/requests.RequestTransport)

The native operation transport. Recovery uses the retained address and
contract; it never describes an operation or loads today's tool catalog.

#### Parameters

| Name | Type |
| :- | :- |
| `options` | `Object` |
| `options.url` | `string` |
| `options.getToken` | (`signal?`: `AbortSignal`) => `string` \| `Promise`\<`string`> |
| `options.fetch?` | typeof `fetch` |

#### Returns

[`RequestTransport`](/api/interfaces/requests.RequestTransport)

***

### requestId

▸ **requestId**(`value`): [`RequestId`](/api/modules/requests#requestid)

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `string` |

#### Returns

[`RequestId`](/api/modules/requests#requestid)

***

### encodeInput

▸ **encodeInput**(`input`): [`EncodedInput`](/api/modules/requests#encodedinput)

The native value codec preserves int64, bytes and floating-point identity.

#### Parameters

| Name | Type |
| :- | :- |
| `input` | `Record`\<`string`, [`Value`](/api/modules/values#value)> |

#### Returns

[`EncodedInput`](/api/modules/requests#encodedinput)

***

### readEnvelope

▸ **readEnvelope**(`value`): [`RequestEnvelope`](/api/modules/requests#requestenvelope)

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `unknown` |

#### Returns

[`RequestEnvelope`](/api/modules/requests#requestenvelope)

***

### readRequestView

▸ **readRequestView**\<`Result`>(`value`, `id`): [`RequestView`](/api/modules/requests#requestview)\<`Result`>

Validate the decision independently of the current operation definition.

#### Type parameters

| Name | Type |
| :- | :- |
| `Result` | `unknown` |

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `unknown` |
| `id` | [`RequestId`](/api/modules/requests#requestid) |

#### Returns

[`RequestView`](/api/modules/requests#requestview)\<`Result`>

***

### requireSameRequest

▸ **requireSameRequest**(`expected`, `actual`): `void`

#### Parameters

| Name | Type |
| :- | :- |
| `expected` | [`RequestEnvelope`](/api/modules/requests#requestenvelope) |
| `actual` | [`RequestEnvelope`](/api/modules/requests#requestenvelope) |

#### Returns

`void`

***

### requestIdFor

▸ **requestIdFor**(`call`): `Promise`\<[`RequestId`](/api/modules/requests#requestid)>

A framework call is an integration identity, not part of business state.
Neither credentials, ownership nor catalog names participate.

#### Parameters

| Name | Type |
| :- | :- |
| `call` | `Object` |
| `call.hostId` | `string` |
| `call.scopeId` | `string` |
| `call.callId` | `string` |

#### Returns

`Promise`\<[`RequestId`](/api/modules/requests#requestid)>

***

### inspectRequest

▸ **inspectRequest**(`requestId`, `expected?`): `Promise`\<`any`>

Inspect native custody by identity, independently of the current catalog.
Current read authority and original source obligations still apply.

#### Parameters

| Name | Type |
| :- | :- |
| `requestId` | `string` |
| `expected?` | [`RequestEnvelope`](/api/modules/requests#requestenvelope) |

#### Returns

`Promise`\<`any`>

***

### continueRequest

▸ **continueRequest**(`ctx`, `requestId`, `expected?`): `Promise`\<`any`>

Continue the original intention through the ordinary native operation owner.
Current authority and requirements are rechecked.

#### Parameters

| Name | Type |
| :- | :- |
| `ctx` | `Object` |
| `ctx.runMutation` | (`reference`: `any`, `args`: `any`) => `Promise`\<`any`> |
| `requestId` | `string` |
| `expected?` | [`RequestEnvelope`](/api/modules/requests#requestenvelope) |

#### Returns

`Promise`\<`any`>

***

### withdrawRequest

▸ **withdrawRequest**(`ctx`, `requestId`, `expected?`): `Promise`\<`any`>

Withdraw the original request. A terminal decision wins the race.

#### Parameters

| Name | Type |
| :- | :- |
| `ctx` | `Object` |
| `ctx.runMutation` | (`reference`: `any`, `args`: `any`) => `Promise`\<`any`> |
| `requestId` | `string` |
| `expected?` | [`RequestEnvelope`](/api/modules/requests#requestenvelope) |

#### Returns

`Promise`\<`any`>

***

### statusRequest

▸ **statusRequest**(`requestId`): `Promise`\<`any`>

Read current execution facts from the original native request, including
component operations, under current disclosure authority.

#### Parameters

| Name | Type |
| :- | :- |
| `requestId` | `string` |

#### Returns

`Promise`\<`any`>


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