Skip to content

Authentication ​

All authenticated endpoints require an API key in the header.

API Keys ​

LNbits provides two types of keys:

KeyHeaderAccess Level
Admin KeyX-Api-Key: {admin_key}Full access (create, update, delete)
Invoice KeyX-Api-Key: {invoice_key}Read-only access
Subscriber TokenX-Subscriber-Token: {token}Subscriber portal (self-service)

Finding Your Keys ​

  1. Open LNbits
  2. Click on your wallet
  3. Click "API Info" (key icon)
  4. Copy the key you need

Using the Key ​

Include the key in every request:

bash
curl -X GET \
  "https://your-lnbits.com/subscriptions_manager/api/v1/plans" \
  -H "X-Api-Key: YOUR_API_KEY"

Which Key to Use? ​

OperationKey Required
List plansInvoice Key
Create planAdmin Key
Update planAdmin Key
Delete planAdmin Key
List subscriptionsInvoice Key
Cancel subscriptionAdmin Key
⚠️

Never expose your Admin Key in client-side code. Use it only in server-to-server requests.

Subscriber Portal ​

The subscriber portal endpoints use a dedicated X-Subscriber-Token header. Each subscriber receives a unique access token when their subscription is created.

bash
curl -X GET \
  "https://your-lnbits.com/subscriptions_manager/api/v1/public/manage/subscriptions" \
  -H "X-Subscriber-Token: SUBSCRIBER_ACCESS_TOKEN"
OperationEndpoint
List subscriptionsGET /public/manage/subscriptions
Cancel subscriptionPOST /public/manage/subscription/{id}/cancel
List connected walletsGET /public/manage/wallets
Disconnect walletDELETE /public/manage/wallets/{id}

Public Endpoints ​

Some endpoints don't require any authentication:

  • GET /public/plan/{id} — Get plan info for checkout
  • POST /public/subscribe — Create a subscription
  • GET /public/payment/{id}/status — Check payment status
  • POST /public/nwc/validate — Validate NWC connection
  • POST /public/subscribe/nwc — Create NWC subscription

These are designed for subscriber-facing integrations.