View as Markdown

SDK reference · Node SDK

prov.mandate.grants

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

Methods

create

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

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

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

Fetch one mandate, including its online-only remainingBudget.

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

delegate

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

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

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

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

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

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

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

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

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

Add a trusted outside agent (an admin key).

Calls POST /v1/mandate/trusted_agents.

removeTrustedAgent

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Calls GET /v1/mandate/settings/limits.

setLimits

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

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

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

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

publishLimits

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

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

Revoke a mandate (idempotent).

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

heartbeatChallenge

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

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.

Was this page helpful? Send us feedback

LLM? Read llms.txt.