Admin API
Server administration API - manage settings, users, and extensions at the instance level.
The Admin API provides endpoints for managing the LNbits instance. These endpoints require elevated privileges.
Prerequisites
To use the Admin API:
- Enable the Admin UI - set
LNBITS_ADMIN_UI=truein your.envfile - Authenticate as an admin - you must be either:
- The Super User (defined by
SUPER_USERin.env) - A user listed in
LNBITS_ADMIN_USERS
- The Super User (defined by
WARNING
Some endpoints (settings, deleting users, installing extensions) require Super User access - admin users alone cannot perform these operations.
Authentication
Admin endpoints use the same Bearer token authentication as user endpoints. Log in and use the returned JWT:
bash
# Get a Bearer token
curl -X POST https://your-lnbits.com/api/v1/auth \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "your-password"}'
# Use it with admin endpoints
curl https://your-lnbits.com/api/v1/admin/settings \
-H "Authorization: Bearer YOUR_TOKEN"Endpoints
| Section | Auth Level | Description |
|---|---|---|
| Settings | Super User | Read and update server configuration |
| Users | Admin / Super User | List, create, update, delete users |
| Top-up | Super User | Add balance to any wallet |
| Extensions | Admin / Super User | Manage extensions server-wide |