Skip to main content

GET /api/consumer/session

Without address, checks consumer_token, its audience, database account and session version. Success returns account with ID, wallet address/type, Circle wallet ID, canonical mode, canServerSign and walletVerified. On mainnet, bound Circle wallet liveness is checked before displaying the address. Stale/wrong-network results return 409 WALLET_NEEDS_UPDATE; transient failure returns 503 WALLET_CHECK_FAILED. Neither response is permission to fund an older cached address. Missing/invalid session returns 401. With a valid EVM address query, GET issues a challenge and a 5-minute HTTP-only consumer_connect_nonce cookie. The optional nonce=1 marker is used by the UI; address selects the challenge path. Keep the cookie through POST. The session rate limiter applies.

POST /api/consumer/session

Send Content-Type: application/json.

Connect or resume an existing wallet

The handler requires the nonce cookie and verifies the signature. A bare address fails with 400; absent/expired challenge fails with 400; invalid signature fails with 401. The account is reused or created as EXTERNAL; reconnecting does not create an automatic Circle signing identity. Success sets the 30-day HTTP-only consumer_token and returns success, isNew and account. Login responses set walletVerified: false; use the GET liveness check for that separate fact. The current session POST defaults isNew to false even on its account-creation paths, so do not rely on it as a provisioning signal. When the same browser previously had a Circle session, the server can best-effort link that verified account as an external bridge destination. A usable existing link is not replaced. A client-supplied destination is not authoritative here; successful wallet login does not prove the link write completed.

Empty body / Circle provisioning

An empty POST can create a new Circle Developer-Controlled wallet/account for callers without a resolvable EXTERNAL session. It is not idempotent recovery and may leave a Circle wallet if a later database operation fails. A resolvable EXTERNAL session is refused with 403 EMAIL_VERIFICATION_REQUIRED, without converting that wallet. Use the app’s verified-email flow (POST/PUT /api/consumer/email-auth) to create or retrieve a FlareHQ wallet; do not repeatedly submit {} to recover an existing account.

DELETE /api/consumer/session

Clears the session and nonce cookies and returns success: true. If the account resolves, it attempts a session-version bump. That database update is best-effort; cookie clearing alone does not prove every other token copy was revoked after a database failure.