A bunker link to use the custodied key in another app
POST /v1/auth/npub/bunker- who may call it
- A session
- the session of an account · with a second factor
- how fresh
- Never cached
- every answer carries the index's height and the node's
- MCP tool
- None
On this page
Needs aal 2. A one-time link, bunker://<pubkey>?relay=wss://relay.btcintel.io&secret=…, valid ten minutes, that Primal, Amethyst, Amber, nsec.app or any NIP-46 client connects with; the explorer shows it as a QR. name is what the account calls the app; perms are what the app may ask the signer for: sign_event:<kind> per kind, sign_event for every kind, nip44_encrypt, nip44_decrypt, nip04_encrypt, nip04_decrypt; the default is signing the Community kinds (0, 1, 1111, 1985, 5). One open link per key: a new one replaces the last. 409 when the account's key is its own; 501 when the signer runs without a relay; 503 signing_off while features.signing is false.
Parameters
| Name | Where | Type | Required | What it does |
|---|---|---|---|---|
name | body | string | optional | What the account calls the app, at most 80 characters. It shows in GET /v1/auth/npub/clients. |
perms | body | array | optional | What the app may ask the signer for: sign_event:<kind>, sign_event for every kind, nip44_encrypt, nip44_decrypt, nip04_encrypt, nip04_decrypt. The signer's defaults when left out. |
The body is application/json, and may be left out.
schema
namestring — What the account calls the app, at most 80 characters. It shows inGET /v1/auth/npub/clients. · at most 80 characterspermsarray of string — What the app may ask the signer for:sign_event:<kind>,sign_eventfor every kind,nip44_encrypt,nip44_decrypt,nip04_encrypt,nip04_decrypt. The signer's defaults when left out.
What it answers
201 · application/json
The link; the QR payload is bunker_url.
| Field | Type | What it carries |
|---|---|---|
bunker_url | string | The one-time link the app connects with: bunker://, the key's pubkey, the relay and a secret. It is the QR's payload too. |
pubkey | string | The custodied key's public key, 64 hex: the signer the app talks to. |
npub | string | That key as an npub. |
relay | string | The relay the app and the signer talk through. |
perms | array | What the app may ask for, sorted: the defaults when none were sent. |
expires_at | string | When the link lapses unless an app connects with it: ten minutes from now. |
schema
bunker_urlstring required — The one-time link the app connects with:bunker://, the key's pubkey, the relay and a secret. It is the QR's payload too.pubkeystring required — The custodied key's public key, 64 hex: the signer the app talks to.npubstring required — That key as an npub.relaystring required — The relay the app and the signer talk through.permsarray of string required — What the app may ask for, sorted: the defaults when none were sent.expires_atstring (date-time) required — When the link lapses unless an app connects with it: ten minutes from now.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 401 | unauthorized | unauthorized: the request does not say who makes it, or what it offers does not verify: no key or session where one is needed, or a password, a code, a passkey or a signed event that does not check. The message says what is missing. |
| 403 | forbidden | forbidden: the caller is known but may not do this: a key without the scope or the tier the action needs, a session without an npub, a second factor or a recent sign-in, an operator without the role or switched off, or a source that does not allow it. The message says which. |
| 404 | not_found | not_found: what the path names is not known: not in the index (for a transaction, not in the node's mempool either), or no such record. The message says which. |
| 409 | conflict | conflict: the state refuses the change, for example a dispute of this caller's already open, a dispute or a claim no longer open, an address that belongs to another account, or a thing done already. The message says which. |
| 501 | not_configured | not_configured: this deployment does not run what the route needs, for example the mempool engine, accounts, the intel store or watchlists. The message names it. |
| 503 | signing_off, unavailable | signing_off: the custodied signer is switched off (SIGNING_ENABLED), keys stay encrypted and exportable later; or unavailable: the signer service is not answering. |
Each comes in the one error envelope, and none is cached: an error carries Cache-Control: no-store.
Example
No snippet. This route takes a signed-in session (the cookie btcintel.io sets) or a NIP-98 signature from your Nostr signer, never a key, so no snippet can run it from a shell. See Identity.