Endpoints
HTTP routes this app exposes.
HTTP endpoints (Next.js route handlers)
Endpoint: GET /.well-known/nostr.json
- Purpose: Proxies NIP-05
nostr.jsonfrom the api onto the site apex. CORS*. - Errors: Upstream 502/503.
- Used by: Damus verification.
- Auth: none.
Endpoint: GET /.well-known/lnurlp/[username]
- Purpose: Proxies LUD-16 payRequest from the api onto the site apex so wallets can pay
username@21.gifts. CORS*. Once the member's in-app wallet is verified the api answers with the callbackGET /lnurlp/[username]/invoice, so payments to that address settle in the member's own in-app wallet. While the account has an open shop payment the api answers an OpenCryptoPay pay request instead (quote.payment,transferAmounts); the query string is forwarded. - Errors: Upstream 404/502.
- Used by: Lightning wallets;
fetchShopPayLinkforPayLinkScreen(an open till, the check after Continue, the re-read while the opened payment waits, and the quote refetch). - Auth: none.
Endpoint: GET /pay/[username]
- Purpose: Proxies the public pay-link card (
name,username,minSats,maxSats, andcharge, the shop's pending charge ornull) from the api. - Errors: Upstream 404 when the person cannot be paid, 502 when the payee's wallet cannot be resolved.
- Used by:
PayLinkScreen,fetchShopChargeInvoice. - Auth: none.
Endpoint: GET /pay/[username]/charges/[id]
- Purpose: Proxies the public shop-charge receipt. The body is the charge id, status, times, and the stored currency figures. It does not include the account id or a Spark invoice.
- Errors: Upstream 404 when the charge is missing, 502 when the api cannot be reached.
- Used by:
fetchShopChargeReceiptwhen the paid Lightning address has a local part. - Auth: none.
Endpoint: GET /pay/charges/[id]
- Purpose: Proxies the same public shop-charge receipt when the payment has no Lightning address. The body is the charge id, status, times, and the stored currency figures. It does not include the account id or a Spark invoice.
- Errors: Upstream 404 when the charge is missing, 502 when the api cannot be reached.
- Used by:
fetchShopChargeReceiptwhen the username is null. - Auth: none.
Endpoint: POST /pay/[username]/invoice
- Purpose: Proxies one exact-amount BOLT11 mint. Body
{ amountSats, comment? }. Response{ pr, amountSats, sparkInvoice }. With a pending charge,sparkInvoiceis a Spark invoice for that charge whenamountSatsis its amount. Without one, it is a Spark invoice for exactlyamountSatsto the member's verified wallet, carrying the message when one is sent. It isnullwhen the api issues no Spark invoice. - Errors: Upstream 400 for a bad amount, 404 when the person cannot be paid, 502 when the invoice cannot be created.
- Used by:
PayLinkScreenafter Continue whenPOST /pay/[username]/paymentanswers 503stablecoin_unavailableor a readable 4xx other than 409payment_openon the first answer (a 409 whose body cannot be read is an unknown outcome), or, after an unknown outcome, when such an answer comes back and the pay link read 20 s after the end of the most recent unknown call is the plain Lightning request; and for an open till whose pay link is the plain Lightning request;fetchShopChargeInvoiceandfetchMemberSparkInvoicefor the in-app wallet. - Auth: none.
Endpoint: POST /pay/[username]/payment
- Purpose: Proxies the opening of one shop payment for an amount the payer entered on
/pl. Body{ amountSats }. Response{ payment, expiresAt }: the shop payment id, which the pay link then names asquote.payment, and the end of its five-minute window. A new payer amount replaces an open payer payment. - Errors: Upstream
{ error, code }bodies: 404 when the person cannot be paid, 502 when the wallet or the mint fails, 400 for a bad amount, 409payment_openwhile a till charge is pending, 503stablecoin_unavailablewhen this shop has no stablecoin payment or it is switched off or rate limited. A username that is not one path segment answers 404 here without calling the api. The incoming request's abort signal is passed upstream (proxyApiRequestwithforwardAbort), so a page that gives up on the call after 15 s or leaves disconnects the api request too. - Used by:
openShopPaymentfromPayLinkScreenafter Continue. - Auth: none.
Endpoint: OPTIONS /.well-known/lnurlp/[username]
- Purpose: CORS preflight for LUD-16.
- Errors: none.
- Used by: Browsers and wallets.
- Auth: none.
Endpoint: OPTIONS /.well-known/nostr.json
- Purpose: CORS preflight for NIP-05.
- Errors: none.
- Used by: Browsers.
- Auth: none.
Endpoint: GET /healthz
- Purpose: Liveness JSON
{ status: 'ok' }fromsrc/app/healthz/route.ts. - Errors: None if the process is up (always 200).
- Used by: Container probes and Playwright smoke.
- Auth: Public.
Endpoint: POST /auth/passkey/authenticate/begin
- Purpose: Same-origin proxy of api
POST /auth/passkey/authenticate/begin. - Errors: Upstream status, or 502 if the api is unreachable. The browser's
X-App-Buildis passed through unchanged. 403{ error, code: 'app_outdated' }when the api requires another build. - Used by:
startPasskeyAuthentication. - Auth: Public.
Endpoint: POST /auth/passkey/authenticate/finish
- Purpose: Same-origin proxy of api
POST /auth/passkey/authenticate/finish. - Errors: Upstream status, or 502 if the api is unreachable. The browser's
X-App-Buildis passed through unchanged. 403{ error, code: 'app_outdated' }when the api requires another build; 503{ error, code: 'logins_closed' }while operators closed logins; 409{ error: 'Recovery is not finished', code: 'recovery_pending' }when the passkey belongs to a social recovery that is not finished yet (the app never reports that passkey to the authenticator as unknown). - Used by:
finishPasskeyAuthentication. - Auth: Public.
Endpoint: POST /diagnostics
- Purpose: Same-origin proxy of api
POST /diagnostics. Body is an allowlisted client event. The api stores it and returns 204. - Errors: Upstream 400 for a bad body, 429 when the caller is over the limit, 500 when the log cannot be written, or 502 if the api is unreachable.
- Used by:
reportDiagnostic. - Auth: Public. No session.
Endpoint: POST /monitoring
- Purpose: Same-origin tunnel for browser error reports and sampled performance transactions (
forwardSentryEnvelope). Forwards the envelope to the project ofNEXT_PUBLIC_SENTRY_DSN, and to nothing else. - Errors: 404 while error reporting is off (no DSN), 413 above 1 MiB, 400 when the envelope names another host or project, its header is missing or broken, it has no item, an item header is broken (also a
lengththat is not a whole number of bytes inside the envelope, or that does not end at a newline or at the end of the envelope), or an item is anything but an error or a transaction; 502 when the Sentry server cannot be reached; otherwise the upstream status. - Used by: The browser SDK (
sentryOptions('browser')). - Auth: Public. No session; the visitor's IP address, cookies, and headers are not forwarded.
Endpoint: POST /monitoring/csp
- Purpose: Same-origin endpoint for Content-Security-Policy violation reports (
forwardCspReport), named byreport-uriand by thecspgroup ofReporting-Endpoints. Forwards each violation to the security endpoint of theNEXT_PUBLIC_SENTRY_DSNproject, reduced to the directive, the blocked origin or keyword (inline,eval,data, …), the page's origin and first path segment when it is a route ofsrc/app, the script's origin, the disposition (reportorenforce), and line, column, and status numbers, then passed through the privacy scrubber. - Inputs: The legacy
{ "csp-report": {…} }body (application/csp-report) or a Reporting API array (application/reports+json) whosecsp-violationentries count. At most ten violations per request. - Errors: 404 while error reporting is off (no DSN), 413 above 64 KiB, 400 when the body is not JSON or holds no violation with a directive and an http(s) page, 502 when the Sentry server cannot be reached; otherwise 204.
- Used by: Browsers, for the policy the middleware sends (
buildCsp). - Auth: Public. No session; the visitor's IP address, cookies, headers, query strings, fragments, member paths, script samples, and referrers are not forwarded.
Endpoint: POST /auth/passkey/register/begin
- Purpose: Same-origin proxy of api
POST /auth/passkey/register/begin. A new account posts JSON{ name }.{ viewKey }(64 hex) claims an existing public profile and sends noname. The empty body remains the old unnamed path; the new-account path of this app does not use it. - Errors: Upstream status (including 404 / 409 with
{ error }), or 502 if the api is unreachable. The browser'sX-App-Buildis passed through unchanged. 403{ error, code: 'app_outdated' }when the api requires another build; 503{ error, code: 'logins_closed' }while operators closed logins. - Used by:
startPasskeyRegistration. - Auth: Public.
Endpoint: POST /auth/passkey/register/finish
- Purpose: Same-origin proxy of api
POST /auth/passkey/register/finish. - Errors: Upstream status, or 502 if the api is unreachable. The browser's
X-App-Buildis passed through unchanged. 403{ error, code: 'app_outdated' }when the api requires another build; 503{ error, code: 'logins_closed' }while operators closed logins. - Used by:
finishPasskeyRegistration. - Auth: Public.
Endpoint: POST /auth/passkey/replace/begin
- Purpose: Same-origin proxy of api
POST /auth/passkey/replace/begin. - Errors: Upstream 401/400, or 502 if the api is unreachable.
- Used by:
proxyAuthPasskeyReplaceBeginPost. - Auth: Bearer.
Endpoint: POST /auth/passkey/replace/finish
- Purpose: Same-origin proxy of api
POST /auth/passkey/replace/finish. - Errors: Upstream 401/400, or 502 if the api is unreachable.
- Used by:
proxyAuthPasskeyReplaceFinishPost. - Auth: Bearer.
Endpoint: POST /auth/passkey/seed/begin
- Purpose: Same-origin proxy of api
POST /auth/passkey/seed/begin. Bearer session, empty body. Adds a recovery-phrase passkey without replacing the login passkey. - Errors: Upstream 401, 409
{ error }when the account already has a seed, other non-2xx, or 502 if the api is unreachable. - Used by:
startPasskeySeed. - Auth: Bearer.
Endpoint: POST /auth/passkey/seed/finish
- Purpose: Same-origin proxy of api
POST /auth/passkey/seed/finish. Bearer plus JSON{ challengeId, credential }. 200 is the owner account, or that account under oneaccountkey.accountonly holds when it is the only top-level field; a further field is not an account.finishPasskeySeedreads either shape. IncludespasskeyCredentialIdof the new seed passkey. No new token. Not the login call. - Errors: Upstream 401, 409
{ error }when the account already has a seed, 400, or 502 if the api is unreachable. - Used by:
finishPasskeySeed. - Auth: Bearer.
Endpoint: POST /auth/passkey/recovery/begin
- Purpose: Same-origin proxy of api
POST /auth/passkey/recovery/begin. Starts a social recovery on a phone without the account's passkey. JSON{ sparkPubkey, lookup: { signature, timestamp } }: the old wallet's identity key and its own signed address lookup (lowercase DER hex, timestamp in seconds), which the api forwards to the address server. 200 is{ challengeId, options, accountId, username }, the creation options for the new passkey and the account the old wallet belongs to. - Errors: Upstream status, or 502 if the api is unreachable. The browser's
X-App-Buildis passed through unchanged. 400 for a bad body; 403{ error, code: 'app_outdated' }when the api requires another build; 404 when the old wallet holds no account; 409coderecovery_done(already recovered, sign in with the new passkey) orrecovery_operator(only an operator can recover it); 429; 503 while the address service is unavailable or a forwarded recovery is still settling, or{ error, code: 'logins_closed' }while operators closed logins. - Used by:
startPasskeyRecovery. - Auth: Public. Signed by the old wallet.
Endpoint: POST /auth/passkey/recovery/finish
- Purpose: Same-origin proxy of api
POST /auth/passkey/recovery/finish. JSON{ challengeId, credential, newSparkPubkey, signature: { pubkey, signature } }: the new passkey's attestation, the new wallet's key, and the old wallet's signature over the recovery message. 200{ status: 'pending' }stores the pending recovery; the account moves only once the address moved. A repeat of the same finish after a lost answer is 200 again and changes nothing. - Errors: Upstream status, or 502 if the api is unreachable. The browser's
X-App-BuildandOriginare passed through unchanged. 400 for a bad body, origin, passkey, or signature, andUnknown or expired challenge,Challenge expired, orChallenge already usedwhen the account did not move; 403{ error, code: 'app_outdated' }; 409A recovery is already pendingorWallet key is already in use; 429; 503, or{ error, code: 'logins_closed' }while operators closed logins. - Used by:
finishPasskeyRecovery. - Auth: Public. Signed by the old wallet.
Endpoint: GET /gifts
- Purpose: Same-origin proxy of api
GET /gifts?day=YYYY-MM-DD(individual outbound gifts that UTC day). - Errors: Upstream 400/503, or 502 if the api is unreachable.
- Used by:
fetchGiftDayon/stats/[day]. - Auth: Public.
Endpoint: GET /messages/stats
- Purpose: Same-origin proxy of api
GET /messages/stats(living notes and replies counted together, by UTC day). - Auth: Public.
- Inputs: None.
- Outputs:
{ postCount, postsOverTime }from the api. - Errors: Forwards the upstream status.
- Used by:
StatsLoaderon/stats.
Endpoint: GET /gifts/stats
- Purpose: Same-origin proxy of api
GET /gifts/stats(aggregated outbound gift totals; optionalrecipientquery forwarded). - Errors: Upstream 503, or 502 if the api is unreachable.
- Used by:
fetchGiftStatson/statsand the people-count chart on/statistics(every visitor, including signed-out, no goal). Historical amounts there stay on each day's rate; live amounts useGET /fx/spot. - Auth: Public.
Endpoint: GET /wallets/stats
- Purpose: Same-origin proxy of api
GET /wallets/stats(self-reported member-wallet totals and the gap-free UTC-day balance series). - Inputs: None.
- Outputs:
{ walletCount, fundedWalletCount, totalSats, totalBtc, asOf, balanceOverTime }from the api.walletCountcounts wallets that ever reported a balance;fundedWalletCountcounts those with a current balance above zero. Empty data is zeros,asOf: null, andbalanceOverTime: []. - Errors: The proxy forwards the upstream status, including 503
{ error: "Wallet stats are unavailable" }, or answers 502 if the api is unreachable. - Used by:
fetchWalletStatson/statsand on/stats/wallet(the wallets-per-day chart). A failed fetch omits the Wallets section on/stats, and on/stats/walletonly hides that chart. - Auth: Public.
Endpoint: GET /wallets/usage
- Purpose: Same-origin proxy of api
GET /wallets/usage(aggregate wallet payments since the production release: totals, days, flows, amount buckets, hours, forum, and shop charges). No person, account, or payment id is in the body. - Inputs: None.
- Outputs:
WalletUsage:releasedAt,asOf,totals,days,flows,amountBuckets,hours(24 UTC hours),forum, andshopCharges. The client schema strips unknown extra fields and rejects a missing required field. - Errors: The proxy forwards the upstream status, or answers 502 if the api is unreachable. The page shows one quiet line Could not load wallet usage. Please try again. and does not offer Try again.
- Used by:
fetchWalletUsageon/stats/wallet. - Auth: Public.
Endpoint: GET /habits
- Purpose: Same-origin proxy of api
GET /habits(public habit list, review week, and comments). ForwardsAuthorizationwhen the browser sent it, so the owner can receive internal notes. - Errors: The proxy forwards the upstream status, or 502 if the api is unreachable.
- Used by:
fetchMemberHabitson/habit-tracker. - Auth: Public. A bearer is optional and is forwarded, not added.
Endpoint: POST /habits
- Purpose: Same-origin proxy of api
POST /habits(add, edit, archive, log, comment, delete a comment, or request a Lightning invoice). ForwardsAuthorizationandTime-Zone. Does not pay the invoice. - Errors: The proxy forwards the upstream status. Expected upstream errors include 401 without a bearer, 400 for a bad body, 403
{ error: 'SUNDAY_REST' }when a comment, a comment deletion, or an invoice request falls on the device's local Sunday, 409 when the period is closed or no wallet can be invoiced, or 502 if the api is unreachable. A missing, blank, or invalid time zone does not refuse a comment, a comment deletion, or an invoice request. Add, edit, log, and archive do not rest on Sunday. - Used by:
postMemberHabiton/habit-tracker. - Auth: Bearer. The client sends
Authorization; this proxy does not add it.
Endpoint: GET /fx/spot
- Purpose: Same-origin proxy of api
GET /fx/spot: the current price of 1 BTC in USD, CHF, EUR, and PHP withasOfandsource. A code the api could not price is left out ofrates. Without any quote the body is{ "asOf": null, "source": null, "rates": {} }; the route has no error status of its own. - Errors: The proxy forwards the upstream status, or 502 if this proxy cannot reach the api.
- Used by:
fetchFxSpotthroughuseSpotRate, on every screen that enters or converts an amount live (the amount field,/pos, gift and reaction amounts, the wallet, the payment fiat suffixes, the/statswallet totals and point tooltips, and the/stats/walletvolume and Tondo fund balance). - Auth: Public. No bearer.
Endpoint: GET /shops/activity
- Purpose: Same-origin proxy of api
GET /shops/activity(shop-use counts, 30 UTC days). - Errors: The proxy forwards the upstream status. Expected upstream errors are 503 when shop activity is unavailable, or 502 if this proxy cannot reach the api.
- Used by:
fetchShopActivityon/statistics. - Auth: No bearer. StatisticsScreen calls it for every visitor.
Endpoint: GET /funding/places
- Purpose: Same-origin proxy of the public api
GET /funding/places: the current grant round, its places, how many are admitted, how many are left, and the active-shop goal that opens the next round. - Errors: The proxy forwards the upstream status. Expected upstream error is 503 when funding is unavailable, or 502 if this proxy cannot reach the api.
- Used by:
fetchGrantPlacesinGrantPlacesPanelon/grantsand/grants/goals. - Auth: No bearer. Every visitor can read the free places.
Endpoint: GET /shops/list
- Purpose: Same-origin proxy of api
GET /shops(public shop directory). Forwardslimitandcursor. - Errors: The proxy forwards the upstream status (400 invalid limit or cursor, 503 shops unavailable) or 502 when the api cannot be reached.
- Used by:
fetchListedShopson/shops. - Auth: No bearer.
Endpoint: GET /funding/goal
- Purpose: Same-origin proxy of api
GET /funding/goal(7 UTC days of shop till-charge counts, plus how many shops had a charge on 5 of those days). Not the public 30-day shop series. - Errors: The proxy forwards the upstream status. Expected upstream errors are 401 without a bearer session and 503 when the goal is unavailable, or 502 if this proxy cannot reach the api.
- Used by:
fetchGrantContinuationon/grants/goals. - Auth: Bearer. The client sends
Authorization; this proxy does not add it.
Endpoint: POST /me/name
- Purpose: Same-origin proxy to set or replace the display name.
- Errors: Upstream 400, or 502 if the api is unreachable.
- Used by:
setName. - Auth: Bearer.
Endpoint: POST /me/username
- Purpose: Same-origin proxy to set the unique
@21.giftsusername (LUD-16 / NIP-05 local-part). - Errors: Upstream 400/409, or 502 if the api is unreachable.
- Used by:
setUsername. - Auth: Bearer.
Endpoint: POST /me/location
- Purpose: Same-origin proxy to set, replace, or clear the free-text profile location (
{ location }; empty string clears). - Errors: Upstream 400 (
Location must be at most 80 characters), 401, or 502 if the api is unreachable. - Used by:
setLocation/LocationForm. - Auth: Bearer.
Endpoint: PUT /me/about
- Purpose: Same-origin proxy of api
PUT /me/about(set or replace the signed-in About me note). JSON{ text, photo? }:photoomitted keeps a stored image,nullclears it,{ contentType, data }sets a JPEG/PNG/WebP like a forum post. - Errors: Upstream 400/401/409, or 502 if the api is unreachable.
- Used by:
putAboutMe. - Auth: Bearer.
Endpoint: GET /pictures/me
- Purpose: Same-origin Bearer proxy of api
GET /pictures/me(raw bytes of the signed-in profile photo). Not the wide image and not the About me note photo. - Errors: Upstream 401/404, or 502 if the api is unreachable.
- Used by:
fetchProfilePhoto. - Auth: Bearer.
Endpoint: PUT /pictures/me
- Purpose: Same-origin Bearer proxy of api
PUT /pictures/me. Body{ photo }sets the profile photo ornullclears it. Does not change the wide image or the About me note. - Errors: Upstream 400/401, or 502 if the api is unreachable.
- Used by:
putProfilePhoto. - Auth: Bearer.
Endpoint: GET /banners/me
- Purpose: Same-origin Bearer proxy of api
GET /banners/me(raw bytes of the signed-in wide profile image). Not the About me photo. - Errors: Upstream 401/404, or 502 if the api is unreachable.
- Used by:
fetchWideBanner. - Auth: Bearer.
Endpoint: PUT /banners/me
- Purpose: Same-origin Bearer proxy of api
PUT /banners/me. Body{ photo }sets a wide image ornullclears it. Does not change the About me photo. - Errors: Upstream 400/401, or 502 if the api is unreachable.
- Used by:
putWideBanner. - Auth: Bearer.
Endpoint: GET /pictures/[accountId]
- Purpose: Same-origin public proxy of the round profile photo for that account. Tries api
GET /pictures/{accountId}.jpg, then.png, then.webp. No bearer. Not the wide image and not the About me note photo. - Errors: 404 when the id is not a public file id or none of the three files is an image. 502 if the api is unreachable.
- Used by:
MemberProfileScreenvisitor header. - Auth: None.
Endpoint: GET /banners/[accountId]
- Purpose: Same-origin public proxy of the wide profile image for that account. Tries api
GET /banners/{accountId}.jpg, then.png, then.webp. No bearer. Not the profile photo and not the About me note photo. - Errors: 404 when the id is not a public file id or none of the three files is an image. 502 if the api is unreachable.
- Used by:
MemberProfileScreenvisitor header. - Auth: None.
Endpoint: GET /me/about/photo
- Purpose: Same-origin Bearer proxy of api
GET /me/about/photo(raw JPEG/PNG/WebP bytes for the signed-in About me note). Always render via blob URLs — not bare<img src>. - Errors: Upstream 401/404, or 502 if the api is unreachable.
- Used by:
fetchAboutMePhoto. - Auth: Bearer.
Endpoint: GET /view-key/[viewKey]/about/photo
- Purpose: Same-origin public proxy of api
GET /view/:viewKey/about/photo(raw JPEG/PNG/WebP bytes for the view-key About me note). Always render via blob URLs — not bare<img src>. - Errors: Upstream 404, or 502 if the api is unreachable.
- Used by:
fetchViewAboutMePhoto. - Auth: none.
Endpoint: POST /me/wallet-backup-seen
- Purpose: Same-origin proxy of api
POST /me/wallet-backup-seen. Records that the recovery phrase was shown. - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
postWalletBackupSeen. - Auth: Bearer.
Endpoint: POST /me/wallet/report
- Purpose: Same-origin proxy of api
POST /me/wallet/report. While the member is signed in, sends the wallet's balance (balanceSats,syncedAt) and the payments the api has not acknowledged yet (payments, at most 200 per request, each withid,direction,status,amountSats,feeSats,timestamp,method,paymentHash,invoice,destination,description,lnurlComment). Never a recovery phrase, private key, PRF output, or preimage. - Returns: Upstream
{ acknowledgedIds }. - Errors: Upstream 400, 401, 413, 429, or 502 if the api is unreachable.
- Used by:
postWalletReport(fromreportWallet). - Auth: Bearer.
Endpoint: POST /me/wallet/counterparties
- Purpose: Same-origin proxy of api
POST /me/wallet/counterparties(21gifts/api#605). Resolves the member on the other side of a completed payment: the sender for incoming (in) payments or the recipient for outgoing (out) payments. The api names that member only from the completed plain Spark transfer its own read of the caller's wallet observed, and only after the caller's own report carried the payment as completed. It reads wallets about once a minute, so a payment it has not read yet has no name and may get one on a later request; a Lightning swap, an on-chain payment, and a payment whose other side is not a member wallet never get one. - Inputs: Bearer session and a
paymentsarray of 1–32{ id, direction }rows, within/outdirections; each id is trimmed and must then be 1–256 characters; at most 16384 bytes. - Returns: The upstream
200 { counterparties: [{ id, accountId, username }] }(the trimmed id; a payment without a name is left out), or its error status: 401Unauthorized, 400Invalid counterparty lookup, 413Request body is too large, 429Too many requestsafter 60 lookups per account and minute, 503Counterparty lookup is unavailable. - Used by:
fetchPaymentCounterpartieson the payment details screen, throughusePaymentCounterparty(at most five lookups per opened screen).
Endpoint: POST /me/wallet/hearts
- Purpose: Same-origin proxy of api
POST /me/wallet/hearts. Looks up the forum posts attached to 1–32 lowercase Spark payment hashes for the signed-in member, and the credit notes of the ones that are loan repayments. - Returns: Upstream
{ hearts, repayments }. Heart rows containpaymentHash,messageId,authorName,text, anddeleted. Repayment rows containpaymentHash,messageId(the credit note),dayIndex(zero-based day of the term),termDays(ornull),role(borrowerwhen the member paid it,giverwhen the member is being repaid),authorName(the borrower, may be empty),text(clipped, may be empty), anddeleted. A hash is in at most one of the two arrays; hashes that are neither are absent. An api withoutrepaymentsis read as no repayments, so those rows render as before. - Errors: Upstream 400, 401, 413, or 502 if the api is unreachable. The wallet UI keeps its ordinary gift title when the lookup fails or has a bad body.
- Used by:
fetchHeartPosts(fromuseHeartContext). - Auth: Bearer.
Endpoint: POST /me/events
- Purpose: Same-origin proxy of api
POST /me/events. Sends a batch of at most 50 interaction events of the signed-in member, each{ name, at, path, props }. - Returns: The upstream status.
- Errors: Upstream 400, 401, 413, 429, or 502 if the api is unreachable.
- Used by:
flushInteractionsandlogLogout(the logout event in a request of its own). - Auth: Bearer.
Endpoint: PUT /me/wallet
- Purpose: Same-origin proxy of api
PUT /me/wallet. Claims the in-app wallet's identity public key for the account. Write-once after the wallet is verified. - Errors: Upstream 400, 401, 404 (feature off), 409 (wallet already verified), or 502 if the api is unreachable.
- Used by:
putWallet. - Auth: Bearer.
Endpoint: PUT /me/recovery-share
- Purpose: Same-origin proxy of api
PUT /me/recovery-share. Stores 21.gifts' share of the owner's social recovery for the account's verified wallet. JSON{ sparkPubkey, share }: the verified wallet key and the raw share with index 2 (20 lowercase words). 200 is the owner account withsocialRecoverySetUp: true. - Errors: Upstream 400 for a bad body, 401, 404 (feature off), 409
Wallet is not connectedorWallet changed, 503Social recovery is unavailable, or 502 if the api is unreachable. - Used by:
putRecoveryShare. - Auth: Bearer.
Endpoint: GET /me/previous-wallets
- Purpose: Same-origin proxy of api
GET /me/previous-wallets. Lists the wallets the account used before a social recovery:{ wallets: [{ sparkPubkey, sparkAddress, replacedAt, balanceSats }] }.balanceSatsis the public explorer balance the api read, ornullwhen unknown; it is information only. - Errors: Upstream 401, 404 (feature off), 503
Wallet data is unavailable, or 502 if the api is unreachable. - Used by:
fetchPreviousWallets. - Auth: Bearer.
Endpoint: DELETE /me/previous-wallets/[sparkPubkey]
- Purpose: Same-origin proxy of api
DELETE /me/previous-wallets/:sparkPubkey. Drops one previous wallet of the account, together with the 21.gifts share stored for it. 204 with no body. - Errors: Upstream 401, 404
Not found(not a previous wallet of the account, also on a repeat, or feature off), 503Wallet data is unavailable, or 502 if the api is unreachable. - Used by:
deletePreviousWallet, which takes 404 as already removed: it asks only for a key the page found listed. - Auth: Bearer.
Endpoint: GET /me/held-shares
- Purpose: Same-origin proxy of api
GET /me/held-shares. Lists the caller's own share boxes, oldest first:{ boxes: [{ id, ciphertext, updatedAt }] }. The ciphertext is opaque to the api; the owner's id and name exist only inside it. - Errors: Upstream 401, 429, or 502 if the api is unreachable.
- Used by:
fetchHeldShareBoxes. - Auth: Bearer.
Endpoint: PUT /me/held-shares/[id]
- Purpose: Same-origin proxy of api
PUT /me/held-shares/:id. Creates (201) or replaces (200) one box of the caller. JSON{ ciphertext }: base64url without padding of 29 to 1024 bytes whose first byte is0x01.idis 32 lower-case hex digits drawn by the app. - Errors: Upstream 400 for a bad id or body, 401, 409
Box id in use(the id belongs to another account) orToo many held shares(more than 50 on create), 429, or 502 if the api is unreachable. - Used by:
putHeldShareBox. - Auth: Bearer.
Endpoint: DELETE /me/held-shares/[id]
- Purpose: Same-origin proxy of api
DELETE /me/held-shares/:id. Deletes one box of the caller. 204 with no body, also for an id that is gone or belongs to another account (which changes nothing). - Errors: Upstream 401, 429, or 502 if the api is unreachable.
- Used by:
deleteHeldShareBox. - Auth: Bearer.
Endpoint: POST /lnurlpay/[pubkey]
- Purpose: Same-origin proxy of api
POST /lnurlpay/:pubkey. The in-app wallet registers the account's username as its address on the app's own host; success marks the wallet verified. - Errors: Upstream 404 (feature off or not the account's own username and key), 409, other 4xx from the address server, 503, or 502 if the api is unreachable.
- Used by: The in-app wallet (
registerWalletAddress). - Auth: Signed by the wallet (
X-Breez-Signature,X-Breez-Timestampforwarded).
Endpoint: POST /lnurlpay/[pubkey]/recover
- Purpose: Same-origin proxy of api
POST /lnurlpay/:pubkey/recover. The in-app wallet looks up the address it registered. - Errors: Upstream 404 or 503, or 502 if the api is unreachable.
- Used by: The in-app wallet.
- Auth: Signed by the wallet.
Endpoint: POST /lnurlpay/[pubkey]/transfer
- Purpose: Same-origin proxy of api
POST /lnurlpay/:pubkey/transfer. During a social recovery the new in-app wallet (path key) claims the account's address that the old wallet authorized for it. The body is the wallet's own{ username, description, from_pubkey, from_signature, to_signature, timestamp }, signed by both wallets. - Errors: Upstream 2xx and 4xx of the address server passed through, 404 (feature off, or no pending recovery admits the claim), 409 when the registration could not be confirmed, 413, 429, 503, or 502 if the api is unreachable.
- Used by: The new in-app wallet during a social recovery; no app
fetchcalls it. - Auth: Signed by both wallets.
Endpoint: GET /lnurlpay/[pubkey]/metadata
- Purpose: Same-origin proxy of api
GET /lnurlpay/:pubkey/metadata. The in-app wallet reads the notes payers left on received payments. - Errors: Upstream 404 or 503, or 502 if the api is unreachable.
- Used by: The in-app wallet.
- Auth: Signed by the wallet.
Endpoint: GET /lnurlp/[username]/invoice
- Purpose: Same-origin proxy of api
GET /lnurlp/:username/invoice. A payer's wallet asks for a payment request to a member's verified in-app wallet. CORS*. - Errors: Upstream 404 or 503, or 502 if the api is unreachable.
- Used by: Payers' wallets, after
GET /.well-known/lnurlp/[username]. - Auth: none.
Endpoint: GET /verify/[paymentHash]
- Purpose: Same-origin proxy of api
GET /verify/:paymentHash. A payer's wallet checks whether a payment to a member's in-app wallet settled. CORS*. - Errors: Upstream 404 or 503, or 502 if the api is unreachable.
- Used by: Payers' wallets.
- Auth: none.
Endpoint: POST /me/passkey-renew/report
- Purpose: Same-origin proxy of api
POST /me/passkey-renew/report. Stores a browser ceremony failure or cancel. The body is the six safe fields plus optional public authenticator facts and browser capability names. - Errors: Upstream 401 or 400, or 502 if the api is unreachable.
- Used by:
postPasskeyRenewReport. - Auth: Bearer.
Endpoint: POST /me/passkey-renew/ack
- Purpose: Same-origin proxy of api
POST /me/passkey-renew/ack. Acknowledges the failure notice so it is not shown again. - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
postPasskeyRenewAck. - Auth: Bearer.
Endpoint: POST /me/setup/skip
- Purpose: Same-origin proxy to skip the name onboarding step (
{ step: 'name' }). Rules and username cannot be skipped. - Errors: Upstream 400/401, or 502 if the api is unreachable.
- Used by:
skipSetup. - Auth: Bearer.
Endpoint: GET /forum/members/[accountId]
- Purpose: Same-origin proxy of api
GET /members/:accountIdfor signed-in member profiles. - Errors: Upstream 401/404/409
missing_requirements, or 502 if the api is unreachable. - Used by:
fetchMemberviaMemberProfileLoader. - Auth: Bearer.
Endpoint: GET /forum/members/[accountId]/activity
- Purpose: Same-origin Bearer proxy of api
GET /members/:accountId/activityfor a member's given and received series. - Errors: Upstream 401/404/409
missing_requirements, 503{ error: "Gift stats are unavailable" }, or 502 if the api is unreachable. - Used by:
fetchMemberActivityviaMemberProfileLoader. - Auth: Bearer.
Endpoint: GET /forum/members/[accountId]/posts
- Purpose: Same-origin proxy of api
GET /members/:accountId/postsfor a signed-in member's top-level forum posts. - Errors: Upstream 401/404/409
missing_requirements, or 502 if the api is unreachable. - Used by:
fetchMemberPostsviaMemberProfileScreen. - Auth: Bearer.
Endpoint: GET /forum/members/[accountId]/shops
- Purpose: Same-origin proxy of api
GET /members/:accountId/shopsfor a signed-in member's top-level forum shop notes. - Errors: Upstream 401/404/409
missing_requirements, or 502 if the api is unreachable. - Used by:
fetchMemberShopsviaMemberProfileScreen. - Auth: Bearer.
Endpoint: GET /forum/members/[accountId]/credits
- Purpose: Same-origin proxy of api
GET /members/:accountId/creditsfor a signed-in member's top-level forum credit notes. - Errors: Upstream 401/404/409
missing_requirements, or 502 if the api is unreachable. - Used by:
fetchMemberCreditsviaMemberProfileScreen. - Auth: Bearer.
Endpoint: GET /forum/members/[accountId]/replies
- Purpose: Same-origin proxy of api
GET /members/:accountId/repliesfor a signed-in member's forum replies. - Errors: Upstream 401/404/409
missing_requirements, or 502 if the api is unreachable. - Used by:
fetchMemberRepliesviaMemberProfileScreen. - Auth: Bearer.
Endpoint: POST /me/forum-laws-dismissed
- Purpose: Same-origin proxy to permanently dismiss the welcome-forum living-room laws hint (
forumLawsDismissed: trueon the account). - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
dismissForumLaws. - Auth: Bearer.
Endpoint: POST /me/wallet-intro-seen
- Purpose: Same-origin proxy that records that the member finished or skipped the one-time wallet tour on
/welcome(walletIntroSeen: trueon the account), so it is not shown again on any device. No body; idempotent. - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
markWalletIntroSeen. - Auth: Bearer.
Endpoint: POST /me/notification-level
- Purpose: Same-origin Bearer proxy of api POST
/me/notification-level. JSON body{ level: "all"|"active"|"mentions"|"none" }returns the owner Account. - Errors: Upstream 401, 400 invalid level, or 502 if the api is unreachable.
- Used by:
postNotificationLevel. - Auth: Bearer.
Endpoint: POST /me/heart-notifications
- Purpose: Same-origin Bearer proxy of api POST
/me/heart-notifications. JSON body{ enabled: boolean }returns the owner Account (notifyHearts). - Errors: Upstream 401, 400 invalid body, or 502 if the api is unreachable.
- Used by:
postHeartNotifications. - Auth: Bearer.
Endpoint: POST /me/amount-unit
- Purpose: Same-origin Bearer proxy of api POST
/me/amount-unit. JSON body{ unit: "btc"|"fiat" }returns the owner Account. The same unit again is still 200. - Errors: Upstream 401, 400 invalid unit, or 502 if the api is unreachable.
- Used by:
setAmountUnit. - Auth: Bearer.
Endpoint: POST /me/heart-sats
- Purpose: Same-origin Bearer proxy of api POST
/me/heart-sats. JSON body{ sats }with a whole number from 1 through 10,000,000 returns the owner Account withheartSats. - Errors: Upstream 401, 400 for a missing, empty, zero, fractional, negative, or too-large value, or 502 if the api is unreachable.
- Used by:
saveHeartSatsthroughsetHeartSats. - Auth: Bearer.
Endpoint: POST /me/locale
- Purpose: Same-origin Bearer proxy of api POST
/me/locale. JSON body{ locale, onlyIfUnset }returns the owner Account.onlyIfUnset: truedoes not overwrite a stored locale. - Errors: 401 when the bearer is missing or blank, before the proxy. Upstream 401, 400 invalid body, or 502 if the api is unreachable.
- Used by:
setAccountLocale. - Auth: Bearer; Owner-Account.
Endpoint: POST /me/fiat
- Purpose: Same-origin Bearer proxy of api POST
/me/fiat. JSON body{ fiat, onlyIfUnset }returns the owner Account.onlyIfUnset: truedoes not overwrite a stored fiat value. - Errors: 401 when the bearer is missing or blank, before the proxy. Upstream 401, 400 invalid body, or 502 if the api is unreachable.
- Used by:
setAccountFiat. - Auth: Bearer; Owner-Account.
Endpoint: POST /me/rules-agreement
- Purpose: Same-origin proxy to record living-room rules agreement on the signed-in account (
rulesAgreedAt). - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
agreeToRules. - Auth: Bearer.
Endpoint: GET /pos/charge
- Purpose: Same-origin proxy of api
GET /pos. Returnscharge(the pending charge, or one paid within the last minute, elsenull),history(including paid rows), andreceived: the payments the member's own wallets received without a till charge in the last 24 hours, at most 20, newest first, each{ id, amountSats, receivedAt, kind }withkindlightningorsparkand no fiat figure (an api that does not send it yet is read as none). Each charge hasstatuspending,paid,cancelled, orexpired, andpaidAt(ISO string ornull). The till reads it on open, right before each create, on Try again after a failed load, when the session or the language changes, once when the open charge runs out, when the tab becomes visible again, after every read of this tab's wallet (a received payment, each wallet sync, and the five-minute wallet refresh; quiet once the till has an answer), after Cancel, once after a create or cancel whose answer was lost, once after a create the api refuses because a payment is already open (another tab's charge then shows), once after a payment that names a charge no read listed (quiet once the till has an answer; it shows whether another tab or device opened the charge the payment names), while a Lightning payment that names no charge could be the open charge's (its amount, made from the second the charge was created to one minute after its end) at once and thenPAY_POLL_MS(2 s) after each ask settled, one ask at a time for a payment as every pay poll does (a newer such payment asks at once, also while an ask of the one before is still on its way), each ask a read of its own that cuts no other read off (answers are ordered byapplyRead, a failed ask is quiet), until a read shows the charge paid, cancelled or gone before its end, and at most until one minute after that payment, and after the paid confirmation is closed.GET /posreturns no payment hash of the charge's BOLT11 invoices, so the till confirms a Lightning payment of the charge by thepaidstatus this endpoint returns; amount and time alone never pay a charge. - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
fetchPosState(PosTill,PosAmount). - Auth: Bearer.
Endpoint: POST /pos/charge
- Purpose: Same-origin proxy of api
POST /poswith{ amountSats }. - Errors: Upstream 400, 401, 409, 502.
- Used by:
createPosCharge. - Auth: Bearer.
Endpoint: DELETE /pos/charge
- Purpose: Same-origin proxy of api
DELETE /pos. Cancels the open charge. - Errors: Upstream 401, 404, or 502 if the api is unreachable.
- Used by:
cancelPosCharge. - Auth: Bearer.
Endpoint: GET /me
- Purpose: Same-origin proxy of the signed-in account, including optional
funding(nullforbasis). - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
fetchMe. - Auth: Bearer.
Endpoint: GET /me/activity
- Purpose: Same-origin Bearer proxy of api
GET /me/activityfor given and received sat totals plus both cumulative day series (house gifts and forum zaps). - Errors: Upstream 401, 503
{ error: "Gift stats are unavailable" }, or 502 if the api is unreachable. - Used by:
fetchAccountActivityviauseAccountTotals. The profile chart usesfetchMemberActivity. - Auth: Bearer.
Endpoint: GET /view-key/[viewKey]
- Purpose: Same-origin public proxy of api
GET /view/:viewKey. - Errors: Upstream 404
{ error: "Not found" }, or 502 if the api is unreachable. - Used by:
fetchViewProfile. - Auth: Public.
Endpoint: GET /view-key/[viewKey]/activity
- Purpose: Same-origin public proxy of api
GET /view/:viewKey/activityfor the public profile given and received series. - Errors: Upstream 404, 503
{ error: "Gift stats are unavailable" }, or 502 if the api is unreachable. - Used by:
fetchViewActivityviaViewProfileLoaderwhen the card stays public. - Auth: Public.
Endpoint: GET /view-key/[viewKey]/posts
- Purpose: Same-origin public proxy of api
GET /view/:viewKey/posts. The body is{ messages }, the same list as the member posts route. - Errors: Upstream 404, 503, or 502 if the api is unreachable.
- Used by:
fetchViewForumListviaViewProfileLoader. - Auth: Public.
Endpoint: GET /view-key/[viewKey]/shops
- Purpose: Same-origin public proxy of api
GET /view/:viewKey/shops. The body is{ messages }. - Errors: Upstream 404, 503, or 502 if the api is unreachable.
- Used by:
fetchViewForumListviaViewProfileLoader. - Auth: Public.
Endpoint: GET /view-key/[viewKey]/credits
- Purpose: Same-origin public proxy of api
GET /view/:viewKey/credits. The body is{ messages }. - Errors: Upstream 404, 503, or 502 if the api is unreachable.
- Used by:
fetchViewForumListviaViewProfileLoader. - Auth: Public.
Endpoint: GET /view-key/[viewKey]/replies
- Purpose: Same-origin public proxy of api
GET /view/:viewKey/replies. The body is{ messages }. - Errors: Upstream 404, 503, or 502 if the api is unreachable.
- Used by:
fetchViewForumListviaViewProfileLoader. - Auth: Public.
Endpoint: GET /forum/messages
- Purpose: Same-origin Bearer proxy of api GET
/messages(public forum list, newest-first), forwarding optionalmode,limit, andcursorquery parameters. App path is/forum/messagesso/messages/[id]can serve HTML. The welcome client always sendslimit=20; the JSON body may include opaquenextCursor(omitted at end of feed). - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
fetchMessages. - Auth: Bearer.
Endpoint: GET /forum/messages/places
- Purpose: Same-origin Bearer proxy of api GET
/messages/places(live top-level notes that have a pin). - Errors: Upstream 401, or 502 if the api is unreachable.
- Used by:
fetchPlaces. - Auth: Bearer.
Endpoint: GET /maps/key
- Purpose: Returns
{ key }for the browser map, or{ key: null }whenGOOGLE_MAPS_API_KEYis unset or blank. An empty value does not fail container boot. The key is not logged. - Errors: None. Always 200.
- Used by:
fetchMapsKey(PlacesMapScreen,ShopScreen,PlaceField). - Auth: None.
Endpoint: GET /forum/messages/hidden
- Purpose: Same-origin Bearer proxy of api GET
/messages/hidden(hidden living-room notes for moderators). App path is/forum/messages/hiddenso HTML/moderate/hiddencan serve the page. - Errors: Upstream 401/403, or 502 if the api is unreachable.
- Used by:
listHiddenMessagesviaHiddenNotesScreenon/moderate/hidden. - Auth: Bearer; moderator role on the api.
Endpoint: POST /forum/messages
- Purpose: Same-origin Bearer proxy of api POST
/messages(create a public forum message or reply with optional photo, optional place pin, and optional Ask fields). JSON and multipart sendgoalCurrencyandgoalAmount;goalSatsremains a field of the read note. Optional JSON or multipartgoalCurrencyandgoalAmount(top-level notes only) are the ask; omitted on replies and when unset. A place pin is likewise top-level only. - Errors: Upstream 401/400/403/429, or 502 if the api is unreachable. 403 is an unpaid-reply rejection (
A reply needs a Bitcoin payment, or the api error string). - Used by:
postMessage. - Auth: Bearer.
Endpoint: GET /forum/messages/[id]/replies
- Purpose: Same-origin Bearer proxy of api GET
/messages/:id/replies(oldest-first replies for one note). The body also carrieshearts, the note's paid hearts newest first; each heart hasaccountId,name, optionalusernameandrole, the exactsats,createdAt, and the frozenamountUsd,amountChf,amountEur, andamountPhpstrings (two decimals ornull). A missingheartsfield is[]. - Errors: Upstream 401/404, or 502 if the api is unreachable.
- Used by:
fetchReplies. - Auth: Bearer.
Endpoint: GET /public-messages/[id]/external-profile
- Purpose: Same-origin public proxy of api GET
/messages/:id/external-profile(name, npub, and optional nip05 and lud16, no Bearer). OptionalpostCount,replyCount,shopCount, andcreditCountare nonnegative integers; absent still parses. - Errors: Upstream 404
{ error: "Not found" }, upstream 503, or 502 if the api is unreachable. - Used by:
fetchExternalAuthorProfile. - Auth: Public.
Endpoint: GET /public-messages/[id]/external-posts
- Purpose: Same-origin public proxy of api GET
/messages/:id/external-posts, body{ messages }for that external author, no Bearer. - Errors: Upstream failure, or 502 if the api is unreachable.
- Used by:
fetchExternalAuthorPosts. - Auth: Public.
Endpoint: GET /public-messages/[id]/external-shops
- Purpose: Same-origin public proxy of api GET
/messages/:id/external-shops, body{ messages }for that external author's shop notes, no Bearer. - Errors: Upstream failure, or 502 if the api is unreachable.
- Used by:
fetchExternalAuthorShops. - Auth: Public.
Endpoint: GET /public-messages/[id]/external-credits
- Purpose: Same-origin public proxy of api GET
/messages/:id/external-credits, body{ messages }for that external author's credit notes, no Bearer. - Errors: Upstream failure, or 502 if the api is unreachable.
- Used by:
fetchExternalAuthorCredits. - Auth: Public.
Endpoint: GET /public-messages/[id]/external-replies
- Purpose: Same-origin public proxy of api GET
/messages/:id/external-replies, body{ messages }for that external author, no Bearer. - Errors: Upstream failure, or 502 if the api is unreachable.
- Used by:
fetchExternalAuthorReplies. - Auth: Public.
Endpoint: GET /public-messages/[id]
- Purpose: Same-origin public proxy of api GET
/messages/:id(one note as JSON, no Bearer). The HTML public note is/messages/[id]. - Errors: Upstream 404
{ error: "Not found" }, or 502 if the api is unreachable. - Used by:
fetchPublicMessage. - Auth: Public.
Endpoint: GET /public-messages/[id]/replies
- Purpose: Same-origin public proxy of api GET
/messages/:id/replies(oldest-first live replies, no Bearer). The body also carries the note'sheartsnewest first with the same fields as the Bearer proxy, including the frozenamountUsd,amountChf,amountEur, andamountPhpstrings. The HTML public thread is/messages/[id]. - Errors: Upstream 404
{ error: "Not found" }, or 502 if the api is unreachable. - Used by:
fetchPublicReplies. - Auth: Public.
Endpoint: GET /messages/compose-target
- Purpose: Same-origin Bearer proxy of api GET
/messages/compose-target. Returns{ messageId, sats, firstPostFree }: the official platform profile note so a basis account can invoice 1 sat to 21.gifts before posting or replying, and whether this member's next top-level post is their free first post (no live or hidden top-level note of their own besides About me). - Errors: Upstream 401/409/400/503, or 502 if the api is unreachable.
- Used by:
fetchComposeTarget. - Auth: Bearer.
Endpoint: GET /links/[code]
- Purpose: Same-origin public proxy of api GET
/links/:code. JSON body is{ "kind": "message" | "member", "id": "<uuid>" }. No Bearer. The HTML redirect visitors open is/l/[code]; this path is JSON only. - Errors: Upstream 400
{ "error": "invalid_code" }, 404{ "error": "not_found" }, 409{ "error": "ambiguous" }, or 502 if the api is unreachable. - Used by:
fetchShortLink. - Auth: Public.
Endpoint: GET /l/[code]
- Purpose: Resolve an 8-hex short code (case-insensitive) and redirect to
/messages/<uuid>or/members/<uuid>. The code is the first UUID group, lowercased. Invalid codes do not call the api. There is no page under/l/— unknown codes use the existing not-found page. - Errors: 404 via
notFound()when the code is not 8 hex, the lookup fails or is not OK, the body is not JSON, or the body is not a message or member UUID. Success is a redirect, not JSON. - Used by: Shared note, reply, and member profile links copied from the forum and member card.
- Auth: Public.
Endpoint: GET /messages/[id]/repayment
- Purpose: Same-origin proxy of api GET
/messages/:id/repayment. Public ledger of givers and each bitcoin repayment, including loanclosedAtand each line'spaidSats/paidAmount; a partially paid line remains due/scheduled and itsdueSatsis the remainder. Adueline whose giver cannot receive yet carrieswaiting: true, andwaitingSharescounts those lines. The body is passed through unchanged. - Errors: Upstream 404/503, or 502 if the api is unreachable.
- Used by:
getRepayment. - Auth: Public.
Endpoint: POST /messages/[id]/repayment
- Purpose: Same-origin Bearer proxy of api POST
/messages/:id/repayment. Without a body (or with an empty body), the author pays the next giver their share of the next due day and receives{ pr, amountSats, sparkInvoice? }. With JSON{ amount }, it requests a freely chosen repayment amount in whole sats for BTC or at most two decimals in the loan currency and returns{ amountSats, amount, bills, waiting }with the due endpoint's bill shapes.amountSatsis the sum ofbillsonly: waiting shares are allocated by the requested loan-currency amount but are not paid now, so an all-waiting answer hasamountSats: 0and an emptybillsarray. The first free-amount payment of a collecting loan also closes collecting in the api. The optional body is passed through unchanged. - Errors: The no-body form keeps its upstream 401/400/404/409/429/503 errors. The amount form can also return 400
amount_too_high,invalid_amount,too_many_shares, orNothing is due; 403SUNDAY_REST; 409missing_requirementsor an open share payment; 429/503; or 502 if the api is unreachable. Max errors carrymaxSatsandmaxAmount. - Used by:
prepayLoanthroughuseLoanRepay.prepay, before the shared wallet send path. No screen uses the no-body single-share form because/loans/repayasks for every payable bill at once (POST /messages/[id]/repayment/due). - Auth: Bearer.
Endpoint: POST /messages/[id]/invoice
- Purpose: Same-origin Bearer proxy of api POST
/messages/:id/invoice(pay a forum note; optionaltextis the zap comment and is omitted when empty). Success{ pr, amountSats, sparkInvoice? };sparkInvoiceis the request the in-app wallet pays instead ofpr(it paysprwhen the wallet refuses it, except for a heart, which is paid by the Spark invoice only), ornull, and may be absent. - Errors: Upstream 401/400/404/409/429/503, or 502 if the api is unreachable. 409
missing_requirementsis a setup overlay, not a pay-sheet error. A heart (heart: true) the api cannot issue as a fee-free Spark invoice is 503{ error: 'HEART_UNAVAILABLE' }with nopr; the proxy passes it through unchanged. - Used by:
postMessageInvoice. - Auth: Bearer.
Endpoint: POST /lnurl/pay-request
- Purpose: Same-origin Bearer proxy of api POST
/lnurl/pay-request. Body{ target }(user@domainor a bech32 LNURL on another host). 200{ target, minSendableMsat, maxSendableMsat, commentAllowed, description, domain }. - Errors: Upstream 400
Not a payable address(malformed, not https, not a pay request, or on this app's own host), 404Address not found, 502Address could not be reached, 401 without a session; 502Upstream api unreachablewhen the api is unreachable. - Used by:
postLnurlPayRequest. - Auth: Bearer.
Endpoint: GET /me/loans
- Purpose: Same-origin proxy of api
GET /me/loans, listing the signed-in member's loans that are still collecting or being repaid plus the Sunday-rest flag. Each loan includesclosedAt, current free-repaymentmaxSats, and fiatmaxAmount;due.waitingSharescounts the shares waiting for a lender's wallet, andlenderWaiting{ shares, loans, sats }counts repayments owed to the caller while the caller cannot receive. For a fiat loan without a usable rate, the api leaves exactly the currently priced unpaid sat fieldstotalSats,due.payableSats,due.waitingSats, andnext.satsnull; their stored loan-currency amounts remain available. The body is passed through unchanged. - Errors: Upstream 401 or service errors, or 502 if the api is unreachable.
- Used by:
getMyLoansthroughuseMyLoansfor the loans card, the lender card, Menu row, and/loans/repay. - Auth: Bearer.
Endpoint: POST /messages/[id]/repayment/due
- Purpose: Same-origin proxy of api
POST /messages/:id/repayment/due. It returns every currently payable recipient bill for the author's funded loan, oldest first, plus waiting shares whose recipients cannot receive; one call is capped at 60 bills. - Errors: Upstream 401/400/404/409/429/503, or 502 if the api is unreachable.
- Used by:
postRepaymentDuethroughuseLoanRepaybefore wallet preparation. - Auth: Bearer.
Endpoint: POST /messages/[id]/repayment/close
- Purpose: Same-origin proxy of api
POST /messages/:id/repayment/close. With no body, it permanently stops an ask from collecting and returns{ fundedAt, closedAt, collectedSats, collectedAmount }; repayment remains available. - Errors: Upstream 401, 404, 409
missing_requirements, 429, or 503; 502 if the api is unreachable. - Used by:
closeLoanthroughuseLoanRepay.closeCollecting, followed byGET /me/loans. - Auth: Bearer.
Endpoint: POST /lnurl/invoice
- Purpose: Same-origin Bearer proxy of api POST
/lnurl/invoice. Body{ target, amountMsat, comment? }. The api resolves the target again, never takes a callback URL from the client, and checks amount, comment, invoice amount, and description hash. 200{ pr }. - Errors: The errors of
POST /lnurl/pay-request, plus 400Amount out of rangeand 400Comment too long. - Used by:
postLnurlInvoice. - Auth: Bearer.
Endpoint: POST /contact/submit
- Purpose: Same-origin Bearer proxy of api POST
/contact(create an in-app contact message to 21.gifts). Nested under/contact/submitbecause the UI page already owns/contact. - Errors: Upstream 401/400, or 502 if the api is unreachable.
- Used by:
postContact. - Auth: Bearer.
Endpoint: GET /messages/[id]/photo
- Purpose: Same-origin proxy of api GET
/messages/:id/photo(raw JPEG/PNG/WebP bytes for one forum message). The extensionless route stays forfetchMessagePhotoandfetchPublicMessagePhoto(inbox, deleted staff row, shop-editor fallback, profile picture). Public forum stills use<img src>/messages/{id}/photo.jpgwithout Authorization. - Errors: Upstream 401/404, or 502 if the api is unreachable.
- Used by:
fetchMessagePhoto,fetchPublicMessagePhoto. - Auth: Optional Bearer.
Endpoint: GET /messages/[id]/photo.jpg
- Purpose: Same-origin proxy of the api file of that extension. Authorization is removed before the upstream call so the edge can store the public still;
cache-controlis copied from the api. - Errors: Upstream 404, or 502 when the api is unreachable.
- Used by:
forumPhotoSrc. - Auth: None.
Endpoint: GET /messages/[id]/photo/[file]
- Purpose: Same-origin proxy of api extra stills at GET
/messages/:id/photo/{1-9}.jpg. App Routerfilemust match{1-9}.jpg; other names 404 without proxying. - Errors: Route 404 for unknown
file; upstream 404/502 when the extra still is missing or unreachable. - Used by:
fetchMessagePhoto/fetchPublicMessagePhotowith index 1–9, andforumPhotoSrc, which builds/messages/{id}/photo/{n}.jpgfor index >= 1.ForumBoardandPublicMessageLoaderattach public extra stills through that path. - Auth: Optional Bearer.
Endpoint: GET /messages/[id]/[file]
- Purpose: App Router GET that proxies
video.mp4/video.webm/video.movto the 21.gifts api at runtime viagetApiUrl()(not next.config rewrites). Otherfilevalues return 404 without proxying. Public; missing files 404 from the api. - Errors: Route 404 for unknown
file; upstream 404/502 for known video names when missing or unreachable. - Used by: Feed
<video src>viaforumVideoSrc. - Auth: None required.
Endpoint: GET /push/vapid-public
- Purpose: Same-origin Bearer proxy of api GET
/push/vapid-public(VAPID application server public key for Web Push subscribe). - Errors: Upstream 401, 503
{ error: "Push is not configured" }, or 502 if the api is unreachable. - Used by:
fetchVapidPublicKeyviaenablePushon/settings, viaenablePushfrom the SignedInChrome Notifications click, and viaresyncPushSubscriptioninSignedInChrome. - Auth: Bearer.
Endpoint: POST /me/push-subscriptions
- Purpose: Same-origin Bearer proxy of api POST
/me/push-subscriptions(register a browser push subscription:{ endpoint, keys: { p256dh, auth } }). - Errors: Upstream 400
{ error: "Invalid subscription" }, 401, 503{ error: "Push is not configured" }, or 502 if the api is unreachable. - Used by:
postPushSubscriptionviaenablePushon/settings, viaenablePushfrom the SignedInChrome Notifications click, and viaresyncPushSubscriptioninSignedInChrome. - Auth: Bearer.
Endpoint: GET /conversations
- Purpose: Same-origin Bearer proxy of api GET
/conversations(incoming threads, plus the member's own 21.gifts contact thread when it has a message; empty and outbound-only member/Damus threads are omitted). GET/conversationsnever lists themoderator_groupthread, even for moderators. Each item has requiredkind:member_member|member_platform|member_damus|moderator_group, requiredlastFromMe, requiredlastSats,unread(default false),unreadMessageCount(default 0, inbound unread messages), optionalaccountId(counterpart), and the envelope includesunreadCount(default 0, unread thread count). - Errors: Upstream 401/503, or 502 if the api is unreachable.
- Used by:
fetchConversationson/messages,useUnreadCount,NotificationsLoader,refreshUnreadAppBadge. - Auth: Bearer.
Endpoint: GET /conversations/moderator-group
- Purpose: Same-origin Bearer proxy of api GET
/conversations/moderator-group(singleton closed staff room as{ conversation }, same item fields as GET/conversationsincludingunreadandunreadMessageCount). - Errors: Upstream 401/403/404, or 502 if the api is unreachable.
- Used by:
fetchModeratorGroupviaModeratorGroupScreenon/moderate/groupand viaInboxLoaderon/messages(unlisted?c=guard for a moderator). - Auth: Bearer; moderator on the api.
Endpoint: POST /conversations
- Purpose: Same-origin Bearer proxy of api POST
/conversationswith{ forumMessageId }to open or return the thread with that note's author. Response is the same conversation list-row shape, including requiredkind, requiredlastFromMe, and optionalaccountId(counterpart). - Errors: Upstream 400 (self), 404 (unknown note), 401/503, or 502 if the api is unreachable.
- Used by:
openConversationfrom the member-profile Message button. - Auth: Bearer.
Endpoint: GET /conversations/[id]
- Purpose: Same-origin Bearer proxy of api GET
/conversations/:id?limit=&cursor=. The client always sendslimit=20; optionalcursorrequests the next older page and optionalsinceMessageIdlong-polls. Body{ messages, nextCursor? }(oldest-first within the page). Each message has requiredfromMe(true iff this session is the actor) andsats,hasPhoto/photoCount(client defaults omitted fields to false / 0), and optionalaccountId(sender). For a staff viewer, incomingnameand optionalaccountIdare the actor. Members still see platform identity (21.gifts) on official replies. Optional querysinceMessageIdis forwarded for gift pay-sheet polling. - Errors: Upstream 401/404/503, or 502 if the api is unreachable.
- Used by:
fetchConversationon/messages?c=and on/moderate/group. - Auth: Bearer.
Endpoint: POST /conversations/[id]
- Purpose: Same-origin Bearer proxy of api POST
/conversations/:idwith{ text }(1–8000 characters) and optional{ photo, photos }(JPEG/PNG/WebP, at most 10). Empty text is allowed when at least one photo is present (Moderators group and/messagesDirect/Contact/Damus). Staff replies on official threads still send as the platform account on the api, but JSONfromMe,name, andaccountIdfollow the actor. The created message has requiredfromMe,hasPhoto,photoCount, and optionalaccountId(sender). - Errors: Upstream 400/401/404/503, or 502 if the api is unreachable.
- Used by:
postConversationMessagein the inbox composer and inModeratorGroupScreen. - Auth: Bearer.
Endpoint: GET /conversations/[id]/messages/[messageId]/photo
- Purpose: Same-origin Bearer proxy of api GET
/conversations/:id/messages/:messageId/photo(still 0). Conversation stills (inbox Direct/Contact/Damus and the staff room) are private; 401 without a session. - Errors: Upstream 401/404/503, or 502 if the api is unreachable.
- Used by:
fetchConversationMessagePhotofromInboxLoaderandModeratorGroupScreen. - Auth: Bearer.
Endpoint: GET /conversations/[id]/messages/[messageId]/photo/[file]
- Purpose: Same-origin Bearer proxy of api GET
/conversations/:id/messages/:messageId/photo/:file. Filename must match{1-9}.{jpg|jpeg|png|webp}; otherwise 404 without calling the api. The proxy always requests{n}.jpgfrom the api. - Errors: 404 for an unsupported filename; upstream 401/404/503, or 502 if the api is unreachable.
- Used by:
fetchConversationMessagePhotofor indices 1–9 fromInboxLoaderandModeratorGroupScreen. - Auth: Bearer.
Endpoint: POST /conversations/[id]/invoice
- Purpose: Same-origin Bearer proxy of api POST
/conversations/:id/invoicewith{ sats, text? }. Success{ pr, amountSats, messageId, sparkInvoice? }for the inbox pay sheet;sparkInvoiceis the request the in-app wallet pays instead ofpr(it paysprwhen the wallet refuses it), ornull, and may be absent. - Errors: Upstream 400/401/404/429/503, or 502 if the api is unreachable.
- Used by:
postConversationInvoicein the inbox composer. - Auth: Bearer.
Endpoint: POST /conversations/[id]/read
- Purpose: Same-origin Bearer proxy of api POST
/conversations/:id/read(mark one conversation read). - Errors: Upstream 401/404/503, or 502 if the api is unreachable.
- Used by:
markConversationReadfromInboxLoaderafter a successful thread fetch. - Auth: Bearer.
Endpoint: GET /forum/mentions
- Purpose: Same-origin Bearer proxy of api GET
/mentions. Optionalqis the username prefix. An empty query is the first page of handles. The forum composer uses it while@is being typed. The Person field on/grants/payments/amountsuses the same search and opens that first page when the field is exactly@. - Errors: Upstream 401/400/409, or 502 if the api is unreachable.
- Used by:
searchMentionAccountsfromMentionTextareaon the post, reply, ask-for-money, shop, inbox, and moderator-room composers, fromShopAccountControl, and fromDailyPaymentAmountsScreenfor the Person field on/grants/payments/amounts. - Auth: Bearer.
Endpoint: GET /forum/accounts/by-username/[username]
- Purpose: Same-origin Bearer proxy of api GET
/accounts/by-username/:username. Exact account lookup by username. The stored spelling is returned; the client does not compare the name again. - Errors: Upstream 401/400/404/409, or 502 if the api is unreachable.
- Used by:
lookupAccountByUsernamefromShopAddWizard,ShopAccountControl, andForumLoader. - Auth: Bearer.
Endpoint: GET /forum/notifications
- Purpose: Same-origin Bearer proxy of api GET
/notifications(posts, replies, payments, moderator appointment, and moderator proposal for the session). App path is/forum/notificationsso HTML/notificationscan serve the page. - Errors: Upstream 401/503, or 502 if the api is unreachable.
- Used by:
fetchNotificationsviaNotificationsLoaderon/notifications, viauseUnreadCountinSignedInChrome, viaForumLoaderon/welcome, and viarefreshUnreadAppBadge(fromInboxLoaderafter mark-read). - Auth: Bearer.
Endpoint: POST /forum/notifications/read-all
- Purpose: Same-origin Bearer proxy of api POST
/notifications/read-all(mark every notification read). Optional JSON{ endpoint }when this browser has a push subscription; endpoint only when the current push endpoint is a non-empty string. - Errors: Upstream 401/503, or 502 if the api is unreachable.
- Used by:
markAllNotificationsReadfromNotificationsLoader. - Auth: Bearer.
Endpoint: POST /forum/notifications/read-by-message
- Purpose: Same-origin Bearer proxy of api POST
/notifications/read-by-message(mark notifications for one forum message read). JSON{ messageId, endpoint? }; endpoint only when the current push endpoint is a non-empty string. - Errors: Upstream 401/503, or 502 if the api is unreachable.
- Used by:
markNotificationsReadForMessagefromForumLoader(note becomes expanded),NoteTranslate(Translate requested with a session),PublicMessageLoader(signed-in message page ready),MemberProfileScreen(profile note becomes expanded), andPublicMessageThread(thread note becomes expanded). - Auth: Bearer.
Endpoint: POST /forum/notifications/read-visible
- Purpose: Same-origin Bearer proxy of api POST
/notifications/read-visible, which stamps onlyforum_post,forum_reply, andforum_mentionwhose reply id is that message. JSON{ messageId, endpoint? }; endpoint only when the current push endpoint is a non-empty string. - Errors: Upstream 401/503, or 502 if the api is unreachable.
- Used by:
markVisibleForumNoteReadfromForumLoaderwhen the note card is fully inside the scrollport. - Auth: Bearer.
Endpoint: POST /forum/notifications/[id]/read
- Purpose: Same-origin Bearer proxy of api POST
/notifications/:id/read(mark one notification read). Optional JSON{ endpoint }when this browser has a push subscription; endpoint only when the current push endpoint is a non-empty string. - Errors: Upstream 401/404/503, or 502 if the api is unreachable.
- Used by:
markNotificationReadfromNotificationsLoaderon row click and fromForumLoaderon the welcome appointment pill. - Auth: Bearer.
Endpoint: DELETE /me/push-subscriptions
- Purpose: Same-origin Bearer proxy of api DELETE
/me/push-subscriptions(remove a browser push subscription by{ endpoint }). - Errors: Upstream 400, 401, 404, 503
{ error: "Push is not configured" }, or 502 if the api is unreachable. - Used by:
deletePushSubscriptionviadisablePushon/settingsand on/profile, fromLogoutButton(Menu and the Settings Account section), and viaresyncPushSubscriptioninSignedInChromefor the old endpoint after a VAPID key change. - Auth: Bearer.
Endpoint: GET /trust/graph
- Purpose: Same-origin Bearer proxy of api
GET /trust-chain(nodes and stored edges). Lives at/trust/graphso it does not collide with the signed-in HTML page/trust-chain. - Errors: Upstream 401, 403, 503, or 502 if the api is unreachable.
- Used by:
fetchTrustChainon signed-in/trust-chain(forwards?around=). - Auth: Bearer.
Endpoint: GET /trust/proposals
- Purpose: Same-origin Bearer proxy of api
GET /trust/proposals(open moderator proposals for moderators). Lives under/trust/proposalsbecause Next.js forbids aroute.tsbeside the HTML page at/moderate/proposals. - Errors: Upstream 401 without a Bearer session, 403 when the account is not a moderator, 503 when the api is unavailable, or 502 JSON if this proxy cannot reach the api origin.
- Used by:
fetchTrustProposalsviaProposalsScreenon/moderate/proposalsand viauseUnreadCount(signed-in Menu andModerateScreenOpen-proposals count). Confirm uses existingPOST /trust/confirm-moderator(postTrustConfirm), not appoint. - Auth: Bearer session; the api requires a moderator. The app does not fetch this list for other signed-in roles (forbidden copy, no request).
Endpoint: POST /trust/verify
- Purpose: Same-origin Bearer proxy of api
POST /trust/verifywith{ accountId, confirmedName }. The proxy forwards the JSON body unchanged. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
postTrustVerifyinMemberVerifyScreen. - Auth: Bearer (moderator).
Endpoint: POST /trust/propose-moderator
- Purpose: Same-origin Bearer proxy of api
POST /trust/propose-moderatorwith{ accountId }. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
postTrustProposeinMemberTrustActions. - Auth: Bearer (moderator).
Endpoint: POST /trust/confirm-moderator
- Purpose: Same-origin Bearer proxy of api
POST /trust/confirm-moderatorwith{ accountId }. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
postTrustConfirminMemberTrustActionsandProposalsScreen. - Auth: Bearer (moderator, not the proposer).
Endpoint: POST /trust/reject-moderator
- Purpose: Same-origin Bearer proxy of api
POST /trust/reject-moderatorwith{ accountId }. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
postTrustRejectinProposalsScreen. - Auth: Bearer (moderator; the original proposer may reject).
Endpoint: POST /trust/appoint-moderator
- Purpose: Same-origin Bearer proxy of api
POST /trust/appoint-moderatorwith{ accountId }. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
postTrustAppointinMemberTrustActions. - Auth: Bearer (founder).
Endpoint: POST /funding/apply
- Purpose: Same-origin Bearer proxy of api
POST /funding/apply. Applications are open to every verified member. Rolebasisis 403 Forbidden and does not write a grant. - Errors: Upstream 400/401/403/409/503, matching
postFundingApply, or 502 if the api is unreachable. - Used by:
postFundingApply.FundingApplyScreencalls it after Yes on the truth question for a verified account with statusnoneorrejected. A basis account does not call it. - Auth: Bearer session; the api requires a role other than
basis.
Endpoint: POST /funding/withdraw
- Purpose: Same-origin Bearer proxy of api
POST /funding/withdraw. The caller withdraws their own grant: an open application, a one-day trial, or an admitted place. No body. 200{ funding }with statusnone. - Errors: Upstream 401/403/409/503 unchanged (409: nothing to withdraw, or a staff decision at the same moment), 404 while the api does not have the endpoint yet, or 502 if the api is unreachable.
- Used by:
postFundingWithdraw.FundingWithdrawControlcalls it after the member confirms Withdraw my application or Leave the grant on/grants. - Auth: Bearer session; the api refuses
basiswith 403.
Endpoint: GET /funding/payout-days
- Purpose: Same-origin Bearer proxy of api
GET /funding/payout-days(seven-day grant payout matrix for moderators). Lives under/funding/payout-daysbecause Next.js forbids aroute.tsbeside the HTML page at/moderate/payouts. - Errors: Upstream 401 without a Bearer session, 403 when the account is below moderator, 503 when the api is unavailable, or 502 JSON if this proxy cannot reach the api origin.
- Used by:
fetchFundingPayoutDaysviaFundingPayoutsScreenon/moderate/payouts. - Auth: Bearer session; the api requires at least moderator. The app does not fetch this list for other signed-in roles (forbidden copy, no request).
Endpoint: GET /shops/activity/shops
- Purpose: Same-origin Bearer proxy of api
GET /shops/activity/shops(per-shop POS activity for staff:windowDays,today, and one row per shop withnoteId,name,npub,accountId,username,activeDays,lastChargeDay, never used first, then oldest last charge first). The HTML table lives at/moderate/shops. - Errors: Upstream 401 without a Bearer session, 403 when the account is not staff, 503 when the api is unavailable, or 502 JSON if this proxy cannot reach the api origin.
- Used by:
fetchShopActivityShopsviaShopActivityShopsScreenon/moderate/shops. - Auth: Bearer session; the api requires staff. The app does not fetch this list for signed-in roles below moderator (forbidden copy, no request).
Endpoint: GET /funding/applications
- Purpose: Same-origin Bearer proxy of api
GET /funding/applications(open grant applications for moderators). Lives under/funding/applicationsbecause Next.js forbids aroute.tsbeside the HTML page at/grants/applications(/moderate/applicationsredirects there). - Errors: Upstream 401 without a Bearer session, 403 when the account is below moderator, 503 when the api is unavailable, or 502 JSON if this proxy cannot reach the api origin.
- Used by:
fetchFundingApplicationsviaFundingApplicationsScreenon/grants/applications.ModerateScreenon/moderatedoes not call this GET. - Auth: Bearer session; the api requires at least moderator. The app does not fetch this list for other signed-in roles (forbidden copy, no request).
Endpoint: GET /funding/daily-roster
- Purpose: Same-origin Bearer proxy of api
GET /funding/daily-roster(daily payout comment, payments switch,defaultAmountUsd, recipient rows, moderator payments switch, and moderator rows). Lives under/funding/daily-rosterbecause Next.js forbids aroute.tsbeside the HTML pages at/grants/payments/comment,/grants/payments/amounts, and/grants/payments/moderators. - Errors: Upstream 401 without a Bearer session, 403 when the account is below initiator, 503 when the api is unavailable, or 502 JSON if this proxy cannot reach the api origin.
- Used by:
fetchDailyRosterviaDailyPaymentCommentScreenon/grants/payments/comment,DailyPaymentAmountsScreenon/grants/payments/amounts, andDailyPaymentModeratorsScreenon/grants/payments/moderators. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum. The app does not fetch this roster for other signed-in roles (forbidden copy, no request).
Endpoint: POST /funding/daily-roster/comment
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/commentwith{ comment }. - Errors: Upstream 400
Invalid comment, 401, 403, 503, or 502 if the api is unreachable. - Used by:
saveDailyRosterCommentinDailyPaymentCommentScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/payments
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/paymentswith{ enabled }(boolean). Sets the daily payments switch only. - Errors: Upstream 400
Invalid payments switch, 401, 403, 503, or 502 if the api is unreachable. - Used by:
saveDailyRosterPaymentsinDailyPaymentAmountsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/recipients
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/recipientswith{ accountId, amountUsd }. Appends one daily recipient for that person. - Errors: Upstream 400
Invalid person or amount,Unknown person,Person has no Lightning address, orAddress already listed, 401, 403, 503, or 502 if the api is unreachable. - Used by:
addDailyRosterRecipientinDailyPaymentAmountsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/recipients/update
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/recipients/updatewith{ address, amountUsd }. Changes one daily amount. - Errors: Upstream 400
Unknown addressorInvalid address or amount, 401, 403, 503, or 502 if the api is unreachable. - Used by:
updateDailyRosterRecipientinDailyPaymentAmountsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/recipients/delete
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/recipients/deletewith{ address }. Removes one daily recipient. - Errors: Upstream 400
Unknown address, 401, 403, 503, or 502 if the api is unreachable. - Used by:
deleteDailyRosterRecipientinDailyPaymentAmountsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/moderators
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/moderatorswith{ accountId, amountUsd }. Appends one moderator stipend for that person. - Errors: Upstream 400
Invalid person or amount,Unknown person,Person has no Lightning address, orAddress already listed, 401, 403, 503, or 502 if the api is unreachable. - Used by:
addDailyRosterModeratorinDailyPaymentModeratorsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/moderators/update
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/moderators/updatewith{ address, amountUsd }. Changes one moderator stipend. - Errors: Upstream 400
Unknown addressorInvalid address or amount, 401, 403, 503, or 502 if the api is unreachable. - Used by:
updateDailyRosterModeratorinDailyPaymentModeratorsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/moderators/delete
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/moderators/deletewith{ address }. Removes one moderator. - Errors: Upstream 400
Unknown address, 401, 403, 503, or 502 if the api is unreachable. - Used by:
deleteDailyRosterModeratorinDailyPaymentModeratorsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: POST /funding/daily-roster/moderators/payments
- Purpose: Same-origin Bearer proxy of api
POST /funding/daily-roster/moderators/paymentswith{ enabled }(boolean). Sets the moderator payments switch only. - Errors: Upstream 400
Invalid payments switch, 401, 403, 503, or 502 if the api is unreachable. - Used by:
saveDailyRosterModeratorPaymentsinDailyPaymentModeratorsScreen. - Auth: Bearer session. The api allows at least initiator (initiator and founder) only; fond and software_developer are below that minimum.
Endpoint: GET /funding/applications/[accountId]
- Purpose: Same-origin Bearer proxy of api
GET /funding/applications/:accountId(staff review payload: account, grant, living-room posts). - Errors: Upstream 401/403/404/503, or 502 if the api is unreachable.
- Used by:
fetchFundingApplicationviaFundingApplicationDetailScreenon/grants/applications/[accountId]. - Auth: Bearer session; the api requires at least moderator.
Endpoint: POST /funding/trial
- Purpose: Same-origin Bearer proxy of api
POST /funding/trialwith{ accountId }. Target must be effective pending. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
proxyFundingTrialPost(API still exposes trial; the staff UI no longer calls it). - Auth: Bearer (at least moderator).
Endpoint: POST /funding/admit
- Purpose: Same-origin Bearer proxy of api
POST /funding/admitwith{ accountId }. Target pending or trial. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable. A 409
{ error: 'All grant places are taken' }means the round has no free place;postFundingAdmitthrowsFUNDING_PLACES_FULL_ERRORfor it. - Used by:
postFundingAdmitinFundingApplicationDetailScreen. - Auth: Bearer (at least moderator).
Endpoint: POST /funding/reject
- Purpose: Same-origin Bearer proxy of api
POST /funding/rejectwith{ accountId }. The subject may re-apply. - Errors: Upstream 400/401/403/404/409/503, or 502 if the api is unreachable.
- Used by:
postFundingRejectinFundingApplicationDetailScreen. - Auth: Bearer (at least moderator).
Endpoint: GET /forum/messages/[id]
- Purpose: Same-origin Bearer proxy of api GET
/messages/:id. App path is/forum/messages/[id]so HTML/messages/[id]can stay the page. Staff (at least moderator) receive a soft-hidden row withdeletedAt/deletedBy; unsigned/non-staff hidden ids stay 404. - Errors: Upstream 401/403/404, or 502 if the api is unreachable.
- Used by:
fetchForumMessageviaPublicMessageLoaderon/messages/[id]. - Auth: Bearer; staff hide-stamps only when the api role is at least moderator.
Endpoint: DELETE /forum/messages/[id]
- Purpose: Same-origin moderation proxy to DELETE /messages/:id.
- Auth: Forwards Bearer authorization; the API requires live moderator role.
- Returns: Upstream 204, 401, 403, 404 or 503; proxy failures return 502.
- Side effects: Deletes the post, direct replies and stored media on 21.gifts. Does not refund gifts or erase external Nostr relay copies.
Endpoint: PATCH /forum/messages/[id]/place
- Purpose: Same-origin moderation proxy to PATCH /messages/:id/place with JSON
{ place }(a pin, ornullto clear). - Auth: Forwards Bearer authorization; the API requires live moderator role.
- Returns: Upstream 200 public message JSON, with
placeomitted when cleared. - Errors: 401/403/404/400/503 with
{ "error": string }; unreachable api is 502.
Endpoint: PATCH /forum/messages/[id]/photos
- Purpose: Same-origin moderation proxy to PATCH /messages/:id/photos with JSON
{ photos }. An empty list clears stills. A video on the note stays, and this write does not add an edit-history row. - Auth: Forwards Bearer authorization; the API requires live moderator role.
- Returns: Upstream 200 public message JSON.
- Errors: 401/403/404/400/503 with
{ "error": string }; unreachable api is 502. Sunday in the device zone is refused by the API.
Endpoint: PATCH /forum/messages/[id]/text
- Purpose: Same-origin moderation proxy to PATCH /messages/:id/text with JSON
{ text }. The API keeps#21GiftsShopon the stored body and records the change. - Auth: Forwards Bearer authorization; the API requires live moderator role.
- Returns: Upstream 200 public message JSON.
- Errors: 401/403/404/400/503 with
{ "error": string }; unreachable api is 502. Sunday in the device zone is refused by the API.
Endpoint: GET /forum/messages/[id]/edits
- Purpose: Same-origin moderation proxy to GET /messages/:id/edits. Returns who changed the shop note text, place, or account, and when.
- Auth: Forwards Bearer authorization; the API requires live moderator role.
- Returns: Upstream 200
{ edits }newest first. An empty list is{ edits: [] }. - Errors: 401/403/404/503 with
{ "error": string }; unreachable api is 502. This read is not a Sunday write.
Endpoint: PATCH /forum/messages/[id]/shop-account
- Purpose: Same-origin moderation proxy to PATCH /messages/:id/shop-account with JSON
{ username }(a handle, ornullto clear). - Auth: Forwards Bearer authorization; the API requires live moderator role.
- Returns: Upstream 200 public message JSON, with
shopAccountomitted when cleared; otherwise{ id, username, name }. - Errors: 404
{ "error": "No account with that username" }when the handle is unknown; other failures match the place patch (401/403/400/503, or 502 when unreachable).
Endpoint: GET /translate
- Purpose: Same-origin proxy of api
GET /translate.{ available: boolean }is true when the api hasTRANSLATE_URLandTRANSLATE_API_KEY. Always 200 from the api. - Errors: 502 when the api is unreachable.
- Used by:
fetchTranslateAvailableinNoteTranslate. - Auth: Public.
Endpoint: POST /translate
- Purpose: Same-origin proxy of api
POST /messages/:id/translate. Body{ messageId, target }. The api looks upmessage_translationbefore DeepL and returns{ translatedText, cached }. - Errors: 400 invalid body, 404 unknown/hidden note, 503 not configured, 502 upstream.
- Used by:
translateNotefromNoteTranslate. - Auth: Public for a live note (Bearer forwarded for a hidden staff permalink).
Endpoint: POST /conversations/[id]/messages/[messageId]/translate
- Purpose: Same-origin proxy of api
POST /conversations/:id/messages/:messageId/translate. Body{ target }. The api translates the stored conversation message and returns{ translatedText, cached }. - Errors: 400 invalid body, 401 without a session, 404 when the thread or message is missing, 503 not configured, 502 upstream.
- Used by:
translateConversationMessagefromNoteTranslateon inbox and moderator-room prose. - Auth: Forwards Bearer authorization. The api requires a participant session.
Endpoint: GET /fond/payouts
- Purpose: Same-origin Bearer proxy of api
GET /fond/payouts. Lists today's open Fond payout rows (id,kind,status,utcDay,paymentHash) in the api's order; it carries no amounts.paymentHashis a string or null and may be absent from an older api. - Auth: Bearer session of the account named
FOND_USERNAME. The api answers 403Fond onlyfor another session and 404 when its Fond surface is off. - Returns: Upstream 200
{ payouts: [{ id, kind, status, utcDay, paymentHash }] }, wherepaymentHashis a string or null and may be absent from an older api. - Errors: Upstream 401 without a Bearer session, 403 for another account, 404 when the surface is off, 503 when the queue is unavailable, or 502 when this proxy cannot reach the api.
- Used by:
fetchFondPayoutsthroughrunFondPayoutTick; the route is also covered by the e2e proxy spec.
Endpoint: POST /fond/payouts/[id]/invoice
- Purpose: Same-origin Bearer proxy of api
POST /fond/payouts/:id/invoice. The api converts the row's stored USD amount at the current spot and returns{ id, bolt11, paymentHash, sparkInvoice }; the app payssparkInvoice, orbolt11without one or after the wallet refused it at prepare, once and sends no proof. - Auth: Bearer session of the Fond account. The api answers 403
Fond onlyfor another session. - Returns: Upstream 200
{ id, bolt11, paymentHash, sparkInvoice }, withsparkInvoicea string or null. After the payment, the api detects the send by payment hash, BOLT11, or Spark invoice string and settles the row itself. - Errors: Upstream 404 for an unknown or malformed id, 409 in progress / not payable / amount below one sat, 401, 403, 503, or 502 when unreachable.
Endpoint: PUT /fond/deposit-address
- Purpose: Same-origin Bearer proxy of api
PUT /fond/deposit-address. Body{ address }: the Fond wallet's static Bitcoin deposit address, read from the wallet SDK in the Fond member's signed-in app. The api stores it idempotently and returns it asonchainAddressinGET /fond/summary. - Auth: Bearer session of the Fond account. The api answers 403 for another session and 404 when its Fond surface is off.
- Returns: Upstream 200
{ address }. - Errors: Upstream 400 for an invalid address, 401 without a Bearer session, 403 for another account, 404 when the surface is off, 503 when the api cannot store it now, or 502 when this proxy cannot reach the api.
- Used by:
putFondDepositAddressthroughregisterFondDepositAddressinFondDepositSync.
Endpoint: GET /fonds/[username]/summary
- Purpose: Same-origin public proxy of api
GET /fond/summaryfor the Fond page. The 200 body is{ username, receivedSats, paidOutSats, feesSats, balanceSats, balanceSyncedAt, payoutsPaid, payoutsPaidUsd, onchainAddress };balanceSatsandbalanceSyncedAtmay be null, andpayoutsPaidUsdis the stored two-decimal figure.onchainAddressis the Fond wallet's registered deposit address or null; an api that does not send it yet reads as null. The route answers 404 when the body'susernameis not the path handle, and answers a malformed 200 body with 502. - Auth: Public, no session.
- Returns: Upstream 200 with
Cache-Control: no-store, or the route's own 404{ error: "Not found" }. - Errors: Upstream 404 when the api runs without the Fond, 503
{ error }on failure, 502 when the api is unreachable or its 200 body is invalid, or the route's 404 for another handle. - Used by:
fetchFondSummarythroughFondSummaryLoaderon/fonds/[username].