Wallgent
Guides

Delegations

Grant another organization controlled access to your wallet with scoped permissions.

Overview

Delegations let your organization grant another organization access to one of your wallets. The grantee can then operate on that wallet — within the permissions you specify — using their own API keys.

This is distinct from API keys, which operate within a single organization. Delegations are cross-organization: you own a wallet, and you authorize a separate org to act on it.

Common use cases:

  • Agency model: a marketing agency's AI agents spend from your wallet on your behalf
  • Multi-org setups: a parent org delegates spending authority to subsidiary orgs
  • Freelancer model: a contractor's agent receives payment access to a client wallet for the duration of a project
  • Revenue sharing: a partner org deposits earnings directly into your wallet

Creating a Delegation

POST /v1/delegations

Request Body

FieldTypeRequiredDescription
walletIdstringYesYour wallet to delegate access to
granteeOrgIdstringYesThe organization receiving the delegation
permissionsstring[]YesPermissions the grantee receives (at least one)
expiresAtstringNoISO 8601 expiry; delegation auto-revokes at this time
import Wallgent from '@wallgent/sdk'

const wg = new Wallgent({ apiKey: process.env.WALLGENT_API_KEY })

const delegation = await wg.delegations.create({
  walletId: 'wal_01J...',
  delegateApiKeyId: 'del_01J...',
  permissions: ['payments:write', 'wallets:read'],
  expiresAt: '2026-06-01T00:00:00Z',
})

console.log('Delegation ID:', delegation.id)

Available Permissions for Delegation

You can delegate any subset of permissions from your own key's permission set. You cannot grant more permissions than you hold.

PermissionWhat the Grantee Can Do
wallets:readView wallet balance and details
wallets:writeUpdate wallet metadata, freeze/unfreeze
payments:readList and view payments from the wallet
payments:writeSend payments from the wallet
policies:readView policies attached to the wallet
policies:writeCreate and update policies on the wallet
invoices:readView invoices associated with the wallet
invoices:writeCreate and manage invoices for the wallet

Listing Delegations

GET /v1/delegations

Returns all delegations your organization has created (delegations you have granted to others).

const { data } = await wg.delegations.list()

for (const d of data) {
  console.log(`Wallet ${d.walletId} → permissions: ${d.permissions.join(', ')} (expires: ${d.expiresAt ?? 'never'})`)
}

Filter Parameters

ParameterTypeDescription
walletIdstringFilter by wallet
limitnumberMax results per page
cursorstringPagination cursor

Revoking a Delegation

DELETE /v1/delegations/:id

Revocation is immediate. After revocation, the grantee's API keys lose access to the delegated wallet instantly.

await wg.delegations.delete('del_01J...')

Delegations vs API Keys

API KeysDelegations
ScopeWithin your organizationCross-organization
Who holds itYour own servicesAnother org's services
Wallet restrictionOptional (walletIds on key)Required (one wallet per delegation)
Use caseInternal agent access controlPartner/agency access
RevocationRevoke the keyRevoke the delegation

API Endpoints

MethodPathDescription
POST/v1/delegationsGrant a delegation
GET/v1/delegationsList delegations you have created
DELETE/v1/delegations/:idRevoke a delegation

Permissions

PermissionRequired For
delegations:writeCreate and revoke delegations
delegations:readList delegations

On this page