{"openapi":"3.0.3","info":{"title":"RGBits Prism API","description":"PhotonBolt Prism Server API (regtest/dev).","license":{"name":"MIT OR Apache-2.0"},"version":"0.1.0"},"paths":{"/.well-known/lnurlp/{username}":{"get":{"tags":["crate"],"operationId":"lnurlp_well_known","parameters":[{"name":"username","in":"path","description":"Lightning address username","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"LNURLp payRequest metadata","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}}}}},"/admin/audit":{"get":{"tags":["crate"],"operationId":"admin_audit_list","parameters":[{"name":"limit","in":"query","description":"Max items (default 50, max 200)","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"before","in":"query","description":"Cursor (id::text < before)","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Audit items","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/admin/me":{"get":{"tags":["crate"],"operationId":"admin_me","responses":{"200":{"description":"Admin identity","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/admin/node-health":{"get":{"tags":["crate"],"operationId":"admin_node_health","parameters":[{"name":"asset_id","in":"query","description":"Single asset id to query","required":false,"schema":{"type":"string","nullable":true}},{"name":"asset_ids","in":"query","description":"Comma-separated asset ids to query","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Node overview","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{}}}},"502":{"description":"Upstream error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/auth/api-keys":{"post":{"tags":["crate"],"operationId":"auth_api_keys_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"200":{"description":"API key created","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/auth/api-keys/{id}":{"delete":{"tags":["crate"],"operationId":"auth_api_keys_revoke","parameters":[{"name":"id","in":"path","description":"API key UUID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/auth/challenge":{"get":{"tags":["crate"],"operationId":"auth_challenge","parameters":[{"name":"pubkey","in":"query","description":"33-byte compressed secp256k1 pubkey hex","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Nonce issued","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}}}},"/auth/enroll":{"post":{"tags":["crate"],"operationId":"auth_enroll","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollRequest"}}},"required":true},"responses":{"200":{"description":"Enrolled","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"409":{"description":"Already enrolled","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}}}},"/auth/logout":{"post":{"tags":["crate"],"operationId":"auth_logout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequest"}}},"required":true},"responses":{"200":{"description":"Logged out","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"502":{"description":"Redis error","content":{"application/json":{"schema":{}}}}}}},"/auth/refresh":{"post":{"tags":["crate"],"operationId":"auth_refresh","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"New access token","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"Upstream/DB error","content":{"application/json":{"schema":{}}}}}}},"/auth/verify":{"post":{"tags":["crate"],"operationId":"auth_verify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Verify signature and issue tokens","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"Upstream/DB error","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["crate"],"operationId":"health","responses":{"200":{"description":"Health check","content":{"application/json":{"schema":{}}}}}}},"/lnurlp/{username}/callback":{"get":{"tags":["crate"],"operationId":"lnurlp_callback","parameters":[{"name":"username","in":"path","description":"Lightning address username","required":true,"schema":{"type":"string"}},{"name":"amount","in":"query","description":"Amount in millisatoshis","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"BOLT11 invoice response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}}}}},"/lnurlw/{username}":{"get":{"tags":["crate"],"operationId":"lnurlw_init","parameters":[{"name":"username","in":"path","description":"Lightning address username","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"LNURL-withdraw metadata","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}}}}},"/lnurlw/{username}/callback":{"get":{"tags":["crate"],"operationId":"lnurlw_callback","parameters":[{"name":"username","in":"path","description":"Lightning address username","required":true,"schema":{"type":"string"}},{"name":"k1","in":"query","description":"Challenge","required":false,"schema":{"type":"string","nullable":true}},{"name":"pr","in":"query","description":"BOLT11 invoice to pay","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"OK / ERROR","content":{"application/json":{"schema":{}}}}}}},"/me":{"get":{"tags":["crate"],"operationId":"me","responses":{"200":{"description":"Current user","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/payments/internal":{"post":{"tags":["crate"],"operationId":"payments_internal_transfer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalTransferRequest"}}},"required":true},"responses":{"200":{"description":"Internal transfer completed","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/payments/invoices":{"post":{"tags":["crate"],"operationId":"btc_create_invoice","parameters":[{"name":"x-photon-wallet-key","in":"header","description":"Wallet key (logical wallet identifier)","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBtcInvoiceRequest"}}},"required":true},"responses":{"200":{"description":"BOLT11 invoice created","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"Upstream/DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/payments/invoices/{hash}":{"get":{"tags":["crate"],"operationId":"btc_get_invoice_by_hash","parameters":[{"name":"hash","in":"path","description":"Payment hash","required":true,"schema":{"type":"string"}},{"name":"x-photon-wallet-key","in":"header","description":"Wallet key (logical wallet identifier)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payment record","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/payments/keysend":{"post":{"tags":["crate"],"operationId":"btc_keysend","parameters":[{"name":"x-photon-wallet-key","in":"header","description":"Wallet key (logical wallet identifier)","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeysendBtcRequest"}}},"required":true},"responses":{"200":{"description":"Keysend attempted","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"Upstream/DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/payments/pay":{"post":{"tags":["crate"],"operationId":"btc_pay_invoice","parameters":[{"name":"x-photon-wallet-key","in":"header","description":"Wallet key (logical wallet identifier)","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayBtcInvoiceRequest"}}},"required":true},"responses":{"200":{"description":"Payment attempted","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"Upstream/DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/payments/{id}":{"get":{"tags":["crate"],"operationId":"btc_get_payment_by_id","parameters":[{"name":"id","in":"path","description":"Payment UUID","required":true,"schema":{"type":"string"}},{"name":"x-photon-wallet-key","in":"header","description":"Wallet key (logical wallet identifier)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payment record","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/wallets":{"get":{"tags":["crate"],"operationId":"wallets_list","parameters":[{"name":"include_archived","in":"query","description":"Include archived wallets","required":false,"schema":{"type":"boolean","nullable":true}}],"responses":{"200":{"description":"Wallet list","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["crate"],"operationId":"wallets_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWalletRequest"}}},"required":true},"responses":{"200":{"description":"Wallet created","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"502":{"description":"DB error","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/wallets/{id}":{"get":{"tags":["crate"],"operationId":"wallets_get","parameters":[{"name":"id","in":"path","description":"Wallet UUID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Wallet detail","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["crate"],"operationId":"wallets_archive","parameters":[{"name":"id","in":"path","description":"Wallet UUID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Wallet archived","content":{"application/json":{"schema":{}}}},"400":{"description":"Cannot archive with non-zero balance","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]},"patch":{"tags":["crate"],"operationId":"wallets_patch","parameters":[{"name":"id","in":"path","description":"Wallet UUID","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWalletRequest"}}},"required":true},"responses":{"200":{"description":"Wallet updated","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}},"/wallets/{id}/transactions":{"get":{"tags":["crate"],"operationId":"wallets_transactions","parameters":[{"name":"id","in":"path","description":"Wallet UUID","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","description":"Cursor id::text < before","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Default 50, max 200","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"Transactions","content":{"application/json":{"schema":{}}}}},"security":[{"bearerAuth":[]}]}}},"components":{"schemas":{"AdminAuditQuery":{"type":"object","properties":{"before":{"type":"string","nullable":true},"limit":{"type":"integer","format":"int32","nullable":true,"minimum":0}}},"CreateApiKeyRequest":{"type":"object","required":["name"],"properties":{"expires_at":{"type":"string","description":"Optional RFC-3339 expiry datetime (e.g. \"2026-12-31T23:59:59Z\")","nullable":true},"name":{"type":"string"},"scope":{"type":"string","description":"One of \"read\", \"invoice\", \"full\" (default: \"full\")","nullable":true},"wallet_id":{"type":"string","description":"Optional wallet UUID to scope this key to a specific wallet","nullable":true}}},"CreateBtcInvoiceRequest":{"type":"object","required":["amount_msat"],"properties":{"amount_msat":{"type":"integer","format":"int64","minimum":0},"asset_amount":{"type":"integer","format":"int64","nullable":true,"minimum":0},"asset_id":{"type":"string","nullable":true},"expiry_sec":{"type":"integer","format":"int64","nullable":true,"minimum":0}}},"CreateWalletRequest":{"type":"object","required":["name"],"properties":{"metadata":{"nullable":true},"name":{"type":"string"}}},"EnrollRequest":{"type":"object","required":["pubkey","bitcoin_address"],"properties":{"bitcoin_address":{"type":"string"},"pubkey":{"type":"string"}}},"InternalTransferRequest":{"type":"object","required":["from_wallet_id","to_wallet_id","asset_kind"],"properties":{"amount_msat":{"type":"integer","format":"int64","nullable":true,"minimum":0},"asset_amount":{"type":"string","nullable":true},"asset_id":{"type":"string","nullable":true},"asset_kind":{"type":"string"},"from_wallet_id":{"type":"string"},"to_wallet_id":{"type":"string"}}},"KeysendBtcRequest":{"type":"object","required":["dest_pubkey","amount_msat"],"properties":{"amount_msat":{"type":"integer","format":"int64","minimum":0},"dest_pubkey":{"type":"string"}}},"LogoutRequest":{"type":"object","required":["refresh_token"],"properties":{"refresh_token":{"type":"string"}}},"PayBtcInvoiceRequest":{"type":"object","required":["invoice"],"properties":{"invoice":{"type":"string"}}},"RefreshRequest":{"type":"object","required":["refresh_token"],"properties":{"refresh_token":{"type":"string"}}},"UpdateWalletRequest":{"type":"object","properties":{"metadata":{"nullable":true},"name":{"type":"string","nullable":true}}},"VerifyRequest":{"type":"object","required":["pubkey","nonce","signature"],"properties":{"nonce":{"type":"string"},"pubkey":{"type":"string"},"signature":{"type":"string"}}}}},"security":[{"bearerAuth":[]}]}