Skip to content

Commit 4d4c667

Browse files
committed
fixes API keys
1 parent a44fdbc commit 4d4c667

2 files changed

Lines changed: 42 additions & 5 deletions

File tree

docs/api/core/wallets.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,31 @@
88

99
**Auth:** Invoice key or Admin key
1010

11-
Get details of the wallet associated with the provided API key.
11+
Get details of the wallet associated with the provided API key. The response shape depends on which key you authenticate with - the Invoice key returns a minimal, public-safe view; the Admin key returns the full wallet object including both API keys.
1212

1313
#### Parameters
1414

1515
None - the wallet is identified by the API key.
1616

17-
#### Response `200`
17+
#### Response `200` - with Invoice/read key
18+
19+
| Field | Type | Description |
20+
|-------|------|-------------|
21+
| `name` | string | Wallet name |
22+
| `balance` | integer | Balance in **millisatoshis** (divide by 1000 for sats) |
23+
24+
```json
25+
{
26+
"name": "My Wallet",
27+
"balance": 50000
28+
}
29+
```
30+
31+
::: warning
32+
The Invoice key **cannot** retrieve the Admin key or the wallet ID. To read those, authenticate with the Admin key (or use the **API info panel** in the LNbits UI).
33+
:::
34+
35+
#### Response `200` - with Admin key
1836

1937
| Field | Type | Description |
2038
|-------|------|-------------|

docs/guide/core/wallets-and-accounts.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,31 @@ The API info panel also shows your **Wallet ID** and the **API base URL** of you
4848
| Managing wallet settings | Admin key |
4949
| Client-side JavaScript | Invoice/read key only - **never** ship the Admin key to a browser |
5050

51-
### Fetching keys via the API
51+
### Inspecting your wallet via the API
5252

53-
If you already have a key and want to verify or inspect it programmatically:
53+
`GET /api/v1/wallet` returns different fields depending on which key you authenticate with.
54+
55+
**With the Invoice/read key** - minimal, public-safe view:
5456

5557
```bash
5658
curl https://your-lnbits.com/api/v1/wallet \
5759
-H "X-Api-Key: YOUR_INVOICE_KEY"
5860
```
5961

60-
Response:
62+
```json
63+
{
64+
"name": "My Wallet",
65+
"balance": 50000
66+
}
67+
```
68+
69+
**With the Admin key** - full wallet object, including both keys:
70+
71+
```bash
72+
curl https://your-lnbits.com/api/v1/wallet \
73+
-H "X-Api-Key: YOUR_ADMIN_KEY"
74+
```
75+
6176
```json
6277
{
6378
"id": "wallet-uuid",
@@ -68,6 +83,10 @@ Response:
6883
}
6984
```
7085

86+
::: warning
87+
The Invoice key **cannot** retrieve the Admin key. The two keys are issued together in the LNbits UI (**API info panel**) - that is the only place to read them.
88+
:::
89+
7190
For a deeper explanation of each key's scope, see the [API Keys page](/guide/core/api-keys).
7291

7392
## Shared wallets

0 commit comments

Comments
 (0)