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

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.

Public Endpoints

Some endpoints don't require authentication:

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

These are designed for subscriber-facing integrations.