Skip to main content

API keys

For automation, create API keys instead of using the all-powerful sign-in JWT. Every key can use the ownership-scoped /v1/me surface for its account. Its permissions array grants only additional administrative endpoints, and each key can be revoked independently.

curl -X POST https://your-instance:3000/v1/me/api-keys \
-H 'Authorization: Bearer <jwt>' \
-H 'Content-Type: application/json' \
-d '{
"name": "payments-bot",
"permissions": [],
"expiry": 2592000
}'

name and permissions are required; description and expiry (seconds) are optional. API keys are account-scoped and can only receive administrative permissions that are a subset of the creator's. An empty permission list still permits /v1/me account-wallet operations. Wallet operations require the wallet ID in the request path. The full key value is returned only once on creation — store it securely, as it cannot be retrieved again.

The available permission scopes are:

ScopeAdditional administrative access
read:accountList and read account aggregates.
write:accountCreate, update, grant, and delete accounts.
read:walletRead wallets and balances across accounts.
write:walletCreate and manage wallets across accounts.
read:transactionList and read administrative invoices/payments.
write:transactionGenerate invoices and send administrative payments.
read:ln_addressRead administrative Lightning Address resources.
write:ln_addressManage administrative Lightning Address resources.
read:ln_nodeRead Lightning node information.
write:ln_nodePerform Lightning node operations.
read:btc_addressRead on-chain Bitcoin addresses.
write:btc_addressGenerate and delete on-chain Bitcoin addresses.
read:api_keyList and read API keys.
write:api_keyCreate and revoke API keys.

Present the key in the Api-Key header on each request:

curl https://your-instance:3000/v1/me/wallets/<wallet-id>/payments \
-H 'Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json'
tip

Always send request bodies as JSON with the Content-Type: application/json header. For more on API keys and building integrations, see the API Keys developer guide.