Skip to content
POST{}LNbits200{}

API Reference

Complete REST API for managing LNbits wallets, payments, users, and extensions.

Interactive API Explorer

Every LNbits instance serves interactive API documentation:

  • Swagger UI - https://your-lnbits.com/docs
  • ReDoc - https://your-lnbits.com/redoc

These are auto-generated from the running instance and always match your version. Use them to test endpoints directly from your browser.

Base URL

https://your-lnbits.com/api/v1/

Replace your-lnbits.com with your instance domain. All endpoints below are relative to this base.

Authentication

Most endpoints require one of:

MethodHeaderScope
API KeyX-Api-Key: YOUR_KEYPer-wallet (Admin or Invoice key)
Bearer TokenAuthorization: Bearer TOKENPer-user (JWT from login)

See Authentication for the full guide, including ACL tokens and the permission matrix.

Quick Start

bash
# Check wallet balance
curl https://your-lnbits.com/api/v1/wallet \
  -H "X-Api-Key: YOUR_INVOICE_KEY"

# Create an invoice (receive sats)
curl -X POST https://your-lnbits.com/api/v1/payments \
  -H "X-Api-Key: YOUR_INVOICE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"out": false, "amount": 100, "memo": "test"}'

# Pay an invoice (send sats)
curl -X POST https://your-lnbits.com/api/v1/payments \
  -H "X-Api-Key: YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"out": true, "bolt11": "lnbc..."}'

Endpoint Groups

GroupBase PathAuthDescription
Wallets/api/v1/walletAPI KeyWallet CRUD, sharing
Payments/api/v1/paymentsAPI KeyInvoices, payments, history, hold invoices
Users & Accounts/api/v1/authBearerLogin, registration, profile, ACLs
Extensions/api/v1/extensionBearerInstall, activate, uninstall
LNURL/api/v1/lnurl*API KeyLNURL-pay, withdraw, auth
Fiat & Rates/api/v1/rateNoneExchange rates, conversion
TinyURL/api/v1/tinyurlAPI KeyURL shortening
WebSockets/api/v1/wsNoneReal-time payment events
Admin/api/v1/adminSuper UserServer configuration, user management

See the Quick Reference for every endpoint in a single scannable table.

Response Format

All responses are JSON. Successful responses return the resource directly:

json
{
  "id": "abc123",
  "name": "My Wallet",
  "balance": 50000
}

Error responses use standard HTTP status codes with a detail message:

json
{
  "detail": "Insufficient balance"
}

Status Codes

CodeMeaning
200Success
201Created
400Bad request - check parameters
401Unauthorized - invalid or missing API key
403Forbidden - insufficient permissions
404Not found
422Validation error - check required fields and types
429Rate limited
500Server error

Pagination

Paginated endpoints accept:

ParameterDefaultDescription
limit20Items per page (max 100)
offset0Items to skip

Paginated responses include a total count:

json
{
  "data": [...],
  "total": 150
}

Filtering

Many list endpoints support filtering via query parameters:

bash
# Filter payments by status
GET /api/v1/payments?status=success

# Search wallets by name
GET /api/v1/wallet/paginated?search=shop

Rate Limiting

Default: 200 requests per minute per IP. Configurable via environment variables:

bash
LNBITS_RATE_LIMIT_NO=200
LNBITS_RATE_LIMIT_UNIT=minute

News · Shop · SaaS · Telegram · Released under the MIT License.