Skip to main content

Overview

The grants sub-client provides operations on grant records: retrieving, listing, revoking, delegating to sub-agents, and verifying grant tokens online.

grants.get()

Retrieve a single grant by its ID.

Parameters

string
required
The grant ID to retrieve.

Response: Grant

string
Unique grant identifier.
string
The agent that holds this grant.
string
The agent’s decentralized identifier.
string
The user who authorized the grant.
string
The developer organization.
string[]
Granted scopes.
string
Grant status: 'active', 'revoked', or 'expired'.
string
ISO 8601 timestamp when the grant was issued.
string
ISO 8601 timestamp when the grant expires.
string
ISO 8601 timestamp when the grant was revoked (only present if status is 'revoked').

grants.list()

List grants with optional filters.

Parameters

string
Filter by agent ID.
string
Filter by principal (user) ID.
string
Filter by status: 'active', 'revoked', or 'expired'.
number
Page number (1-indexed).
number
Number of grants per page.

Response: ListGrantsResponse

Grant[]
Array of grant objects.
number
Total number of grants matching the filters.
number
Current page number.
number
Number of grants per page.

grants.revoke()

Revoke a grant by its ID. This immediately invalidates the grant and any associated tokens.

Parameters

string
required
The grant ID to revoke.

Response

Returns void.

grants.delegate()

Create a delegated grant for a sub-agent. This implements the delegation chain described in SPEC section 9. The parent agent passes its grant token, and the sub-agent receives a new grant token with scopes that are a subset of the parent’s.

Parameters

string
required
The parent agent’s grant token JWT.
string
required
The ID of the sub-agent to delegate to.
string[]
required
The scopes to delegate. Must be a subset of the parent grant’s scopes.
string
Duration for the delegated grant (e.g. '1h', '30m'). Cannot exceed the parent grant’s remaining lifetime.

Response

string
The delegated grant token (RS256 JWT) for the sub-agent.
string
The delegated grant’s record ID.
string[]
The delegated scopes.
string
ISO 8601 expiry timestamp.

grants.verify()

Verify a grant token online and return a VerifiedGrant with full claim details. The SDK uses the server-verified claims returned by POST /v1/grants/verify — it does not decode the caller-supplied token locally, so forged or tampered tokens are always rejected by the server before any claim is surfaced.

Parameters

string
required
The grant token JWT to verify.

Response: VerifiedGrant

Returns a VerifiedGrant object with all decoded claims. See Offline Verification for the full field reference.
Last modified on July 11, 2026