# prov.mandate.grants

prov.mandate.grants in the Node SDK: 33 methods. `provenance.mandate.grants`.

## Methods

### [create](https://provenanceauth.com/docs/sdks/node/mandate-grants/create.md)

```ts
prov.mandate.grants.create(params: GrantMandateParams): Promise<GrantWithToken>
```

Grant a mandate; returns it plus the one-time `mandateToken` (Growth+).

Calls `POST /v1/mandate/grants`.

### [list](https://provenanceauth.com/docs/sdks/node/mandate-grants/list.md)

```ts
prov.mandate.grants.list(params?: { sort?: "created" | "-created" | "spent" | "-spent" | "ends" | "-ends" }): Promise<Grant[]>
```

List this account's mandates (each with current `remainingBudget`).

Calls `GET /v1/mandate/grants`.

### [get](https://provenanceauth.com/docs/sdks/node/mandate-grants/get.md)

```ts
prov.mandate.grants.get(mandateId: string): Promise<Grant>
```

Fetch one mandate, including its online-only `remainingBudget`.

Calls `GET /v1/mandate/grants/{id}`.

### [delegate](https://provenanceauth.com/docs/sdks/node/mandate-grants/delegate.md)

```ts
prov.mandate.grants.delegate(mandateId: string, params: DelegateMandateParams): Promise<GrantDelegation>
```

Mint a child mandate for a subagent from a mandate you hold.

Calls `POST /v1/mandate/grants/{id}/delegate`.

### [delegateAsHolder](https://provenanceauth.com/docs/sdks/node/mandate-grants/delegate-as-holder.md)

```ts
prov.mandate.grants.delegateAsHolder(mandateId: string, params: DelegateMandateParams & { parentToken: string }, signer: HolderProofSigner): Promise<GrantDelegation>
```

Delegate as the agent that holds the mandate, with no account key (holder proof).

### [handOff](https://provenanceauth.com/docs/sdks/node/mandate-grants/hand-off.md)

```ts
prov.mandate.grants.handOff(mandateId: string, params: HandOffParams): Promise<GrantDelegation | ExternalHandoff>
```

Hand a narrower grant to an agent outside the account, bound to its key.

Calls `POST /v1/mandate/grants/{id}/delegate`.

### [handOffAsHolder](https://provenanceauth.com/docs/sdks/node/mandate-grants/hand-off-as-holder.md)

```ts
prov.mandate.grants.handOffAsHolder(mandateId: string, params: HandOffParams & { parentToken: string }, signer: HolderProofSigner): Promise<GrantDelegation | ExternalHandoff>
```

As the agent that holds the mandate, with no account key (holder proof, as ).

### [externalHandoff](https://provenanceauth.com/docs/sdks/node/mandate-grants/external-handoff.md)

```ts
prov.mandate.grants.externalHandoff(handoffId: string): Promise<ExternalHandoff>
```

An external hand-off as the account reads it (pending, minted with the grant's id, or declined).

Calls `GET /v1/mandate/external_handoffs/{id}`.

### [listIncomingGrants](https://provenanceauth.com/docs/sdks/node/mandate-grants/list-incoming-grants.md)

```ts
prov.mandate.grants.listIncomingGrants(params?: { agentId?: string; limit?: number; cursor?: string }): Promise<ListResponse<IncomingGrant>>
```

Grants other accounts handed to your registered agents, newest first (`agentId` narrows to one agent).

Calls `GET /v1/mandate/incoming_grants`.

### [incomingGrant](https://provenanceauth.com/docs/sdks/node/mandate-grants/incoming-grant.md)

```ts
prov.mandate.grants.incomingGrant(incomingGrantId: string): Promise<IncomingGrant>
```

One incoming grant, with the grant's live status.

Calls `GET /v1/mandate/incoming_grants/{id}`.

### [listTrustedAgents](https://provenanceauth.com/docs/sdks/node/mandate-grants/list-trusted-agents.md)

```ts
prov.mandate.grants.listTrustedAgents(params?: { limit?: number; cursor?: string }): Promise<ListResponse<TrustedAgent>>
```

The company's trusted outside agents.

Calls `GET /v1/mandate/trusted_agents`.

### [addTrustedAgent](https://provenanceauth.com/docs/sdks/node/mandate-grants/add-trusted-agent.md)

```ts
prov.mandate.grants.addTrustedAgent(params: AddTrustedAgentParams): Promise<TrustedAgent>
```

Add a trusted outside agent (an admin key).

Calls `POST /v1/mandate/trusted_agents`.

### [removeTrustedAgent](https://provenanceauth.com/docs/sdks/node/mandate-grants/remove-trusted-agent.md)

```ts
prov.mandate.grants.removeTrustedAgent(trustedAgentId: string): Promise<{ id: string; object: "trusted_agent"; deleted: true }>
```

Take an agent off the company's list (an admin key).

Calls `DELETE /v1/mandate/trusted_agents/{id}`.

### [listHolderBindings](https://provenanceauth.com/docs/sdks/node/mandate-grants/list-holder-bindings.md)

```ts
prov.mandate.grants.listHolderBindings(params?: { limit?: number; cursor?: string }): Promise<ListResponse<HolderBinding>>
```

The company's per-agent holder-binding settings.

Calls `GET /v1/mandate/holder_bindings`.

### [setHolderBinding](https://provenanceauth.com/docs/sdks/node/mandate-grants/set-holder-binding.md)

```ts
prov.mandate.grants.setHolderBinding(agentId: string, holderBinding: "required" | "not_required"): Promise<HolderBinding>
```

`required` (grants to your own agent carry `holderKey`) or `not_required` (an outside agent may get a bearer hand-off).

Calls `PUT /v1/mandate/holder_bindings/{agent_id}`.

### [clearHolderBinding](https://provenanceauth.com/docs/sdks/node/mandate-grants/clear-holder-binding.md)

```ts
prov.mandate.grants.clearHolderBinding(agentId: string): Promise<{ id: string; object: "holder_binding"; deleted: true }>
```

Put an agent back on the default holder binding.

Calls `DELETE /v1/mandate/holder_bindings/{agent_id}`.

### [propose](https://provenanceauth.com/docs/sdks/node/mandate-grants/propose.md)

```ts
prov.mandate.grants.propose(mandateId: string, params: ProposeDelegationParams): Promise<DelegationProposalCreated>
```

Propose a delegation structure under a mandate you hold.

Calls `POST /v1/mandate/grants/{id}/delegation_proposals`.

### [proposeAsHolder](https://provenanceauth.com/docs/sdks/node/mandate-grants/propose-as-holder.md)

```ts
prov.mandate.grants.proposeAsHolder(mandateId: string, params: ProposeDelegationParams & { parentToken: string }, signer: HolderProofSigner): Promise<DelegationProposalCreated>
```

As the agent that holds the mandate, with no account key (holder proof, as ).

### [getProposal](https://provenanceauth.com/docs/sdks/node/mandate-grants/get-proposal.md)

```ts
prov.mandate.grants.getProposal(proposalId: string): Promise<DelegationProposal>
```

A proposal, with the approved structure, the person's edits and the minted children (their tokens to an API key).

Calls `GET /v1/mandate/delegation_proposals/{id}`.

### [listProposals](https://provenanceauth.com/docs/sdks/node/mandate-grants/list-proposals.md)

```ts
prov.mandate.grants.listProposals(params?: { status?: DelegationProposal["status"]; parentGrantId?: string; limit?: number; cursor?: string }): Promise<ListResponse<DelegationProposal>>
```

This account's proposals, newest first.

Calls `GET /v1/mandate/delegation_proposals`.

### [spend](https://provenanceauth.com/docs/sdks/node/mandate-grants/spend.md)

```ts
prov.mandate.grants.spend(mandateId: string, params?: { includeDescendants?: boolean; limit?: number; cursor?: string }): Promise<ListResponse<GrantSpendEntry>>
```

What the mandate spent, newest first: one entry per debit (a verify pass, a cart it covered at a store), with what caused it.

Calls `GET /v1/mandate/grants/{id}/spend`.

### [spendSummary](https://provenanceauth.com/docs/sdks/node/mandate-grants/spend-summary.md)

```ts
prov.mandate.grants.spendSummary(params?: { groupBy?: "category" | "agent"; window?: "7d" | "30d" | "90d"; currency?: string }): Promise<SpendSummary>
```

What your agents spent under their grants in a window, per day and per group: by category of spend (the default) or by agent.

Calls `GET /v1/mandate/spend_summary`.

### [usualSpend](https://provenanceauth.com/docs/sdks/node/mandate-grants/usual-spend.md)

```ts
prov.mandate.grants.usualSpend(mandateId: string): Promise<UsualSpend>
```

The usual spend of the person who gave this grant, per category of spend: the median of their purchases over the last 90 days and whether it is a baseline (five or more).

Calls `GET /v1/mandate/grants/{id}/usual_spend`.

### [overLimitSettings](https://provenanceauth.com/docs/sdks/node/mandate-grants/over-limit-settings.md)

```ts
prov.mandate.grants.overLimitSettings(): Promise<DelegationSetting>
```

The account's over-limit settings: what each lock does when a purchase goes past it (ask a person, or refuse past a margin that is a percentage of the limit), whether a yes must come from the grant's person, and whether verify follows them (`atVerify`).

Calls `GET /v1/mandate/settings/delegation`.

### [setOverLimitSettings](https://provenanceauth.com/docs/sdks/node/mandate-grants/set-over-limit-settings.md)

```ts
prov.mandate.grants.setOverLimitSettings(params: { overLimit?: OverLimitSettings; requireSamePerson?: boolean; atVerify?: "settings" | "refuse"; /** #147: an account key can't delegate; the agent holding a mandate delegates with its own grant. */ requireHolderProof?: boolean; /** #158: ask the grantor before a hand-off outside the account (`ask`), or refuse every one. */ external?: "ask" | "refuse"; /** #158: the budget at or under which a hand-off that doesn't say allows offline checks. */ externalOnlineAbove?: number; }): Promise<DelegationSetting>
```

Change the settings for the locks given (an admin key).

Calls `PUT /v1/mandate/settings/delegation`.

### [limits](https://provenanceauth.com/docs/sdks/node/mandate-grants/limits.md)

```ts
prov.mandate.grants.limits(opts?: { raw?: boolean }): Promise<MandateLimits | Record<string, unknown>>
```

Calls `GET /v1/mandate/settings/limits`.

### [setLimits](https://provenanceauth.com/docs/sdks/node/mandate-grants/set-limits.md)

```ts
prov.mandate.grants.setLimits(document: MandateLimitsDocument, params?: { note?: string }): Promise<MandateLimitsVersion>
```

Slice 11: save the mandate limits as a new live version (a key with the `mandate` scope).

Calls `PUT /v1/mandate/settings/limits`.

### [limitVersions](https://provenanceauth.com/docs/sdks/node/mandate-grants/limit-versions.md)

```ts
prov.mandate.grants.limitVersions(params?: { draftGroup?: string; limit?: number; cursor?: string }): Promise<ListResponse<MandateLimitsVersion>>
```

Slice 11: the mandate limits' versions, newest first (a sandbox draft group's drafts with `draftGroup`).

Calls `GET /v1/mandate/settings/limits/versions`.

### [limitVersion](https://provenanceauth.com/docs/sdks/node/mandate-grants/limit-version.md)

```ts
prov.mandate.grants.limitVersion(version: number, opts?: { raw?: boolean }): Promise<MandateLimitsVersion | Record<string, unknown>>
```

Calls `GET /v1/mandate/settings/limits/versions/{version}`.

### [publishLimits](https://provenanceauth.com/docs/sdks/node/mandate-grants/publish-limits.md)

```ts
prov.mandate.grants.publishLimits(version: number): Promise<MandateLimitsVersion>
```

Slice 11: make a waiting draft of the mandate limits live (a rules embed session's, say).

Calls `POST /v1/mandate/settings/limits/versions/{version}/publish`.

### [revoke](https://provenanceauth.com/docs/sdks/node/mandate-grants/revoke.md)

```ts
prov.mandate.grants.revoke(mandateId: string): Promise<Grant>
```

Revoke a mandate (idempotent).

Calls `POST /v1/mandate/grants/{id}/revoke`.

### [heartbeatChallenge](https://provenanceauth.com/docs/sdks/node/mandate-grants/heartbeat-challenge.md)

```ts
prov.mandate.grants.heartbeatChallenge(mandateId: string): Promise<{ challenge: string }>
```

The deterministic WebAuthn challenge for this period's heartbeat check-in.

Calls `GET /v1/mandate/grants/{id}/heartbeat/challenge`.

### [heartbeat](https://provenanceauth.com/docs/sdks/node/mandate-grants/heartbeat.md)

```ts
prov.mandate.grants.heartbeat(mandateId: string, params: { biometricAssertion: { authenticatorData: string; clientDataJSON: string; signature: string } }): Promise<{ grantId: string; status: string; event: "checkin" | "reactivate"; lastCheckinAt: string; nextCheckinDue: string }>
```

Check in to keep a standing mandate alive (the dead-man switch).

Calls `POST /v1/mandate/grants/{id}/heartbeat`.
