Skip to main content

API reference

Every route lives under src/app/api. None of them require an API key. Authorization is cookie-based: an authenticated session, an anonymous draft session, or nothing, depending on the route (see Authentication).

Auth

RouteMethodPurpose
/api/auth/challengePOSTIssues a SEP-53 sign-in message and a matching JWT for a given public key.
/api/auth/verifyPOSTVerifies a signed challenge and issues a session plus a refresh token.
/api/auth/sessionGETReturns the current authenticated public key, refreshing the session from the refresh token if needed.
/api/auth/logoutPOSTRevokes the current refresh token and clears both session cookies.

Batches

RouteMethodPurpose
/api/batchesGETLists every batch visible to the current session (owned, or anonymous-drafted).
/api/batchesPOSTCreates a batch from parsed CSV text: network, optional asset, optional source account.
/api/batches/[batchId]GETFetches one batch with its recipients and attempts.
/api/batches/[batchId]PATCHUpdates a batch's network or asset. Only allowed before anything's been prepared.
/api/batches/[batchId]/statusGETA lightweight poll: just the batch status and each recipient's status, for refreshing a list view without the full payload.
/api/batches/[batchId]/claimPOSTAttaches the connected wallet as owner and source account of an anonymously-drafted batch. Idempotent for the wallet that already owns it.
/api/batches/[batchId]/recipientsPUTReplaces the recipient list, diffing against the existing rows so unedited recipients keep their id. Blocked once a PaymentAttempt exists.
/api/batches/[batchId]/checksPOSTRuns the bulk on-chain check (account existence, trustlines) against every still-pending recipient, or against a specific set of recipient ids if provided.
/api/batches/[batchId]/preparePOSTBuilds the payment transaction(s) for every READY recipient. See Transaction building.
/api/batches/[batchId]/submitPOSTSubmits one signed (or pre-authorized) attempt and polls Stellar until it reaches a final state.
/api/batches/[batchId]/retryPOSTRe-runs prepare/submit for only the FAILED recipients, leaving successful ones untouched.

Address lists

RouteMethodPurpose
/api/address-listsGETLists the current wallet's saved address lists.
/api/address-listsPOSTCreates a new address list.
/api/address-lists/[listId]GETFetches one list with its entries.
/api/address-lists/[listId]PATCHRenames a list or replaces its entries.
/api/address-lists/[listId]DELETEDeletes a list.
/api/address-lists/[listId]/start-batchPOSTCreates a new, already-claimed batch pre-filled from the list's entries.

Balances and assets

RouteMethodPurpose
/api/check-balancePOSTStateless bulk address, trustline, and balance lookup. Requires no wallet and creates nothing.
/api/wallet/balancesGETReturns the connected wallet's balances on the given network.
/api/assets/iconGETLooks up an icon for a custom (not built-in) asset through its issuer's SEP-1 stellar.toml.