Wallets
POST/v1/spending-wallets/{id}/sweep

Sweep spending wallet

View as .md
curl -X POST "https://api.52-28-238-205.sslip.io/v1/spending-wallets/{id}/sweep" \  -H "Cookie: <console session cookie>" \  -H "Content-Type: application/json" \  -d '{"challenge_id":"cha_01jd2x3k4m5n6p7q8r9s0t1v2w","credential":{}}'

Sends the wallet's full balance back to the owner's return address and issues a sweep receipt. Console session or API key with wallet:connect; a console session needs a passkey step-up within the last 5 minutes, and an empty wallet can't be swept (409).

Server URLhttps://api.52-28-238-205.sslip.io
POST/v1/spending-wallets/{id}/sweepBase URL: https://api.52-28-238-205.sslip.io
Authorization
  • sessionCookie: <console session cookie>
  • apiKeyAuthorization: Bearer sk_test_...
Path
  • idstringrequired

    Spending wallet id (swl_...).

Body

application/json. Fields are listed under Request body below.

Requires permissionwallet:connect
Held by owner. The caller must hold this permission, or the call is refused with 403. From the console it also needs a passkey step-up within the last 5 minutes.

Authorization

cookieuapg_session<token>

Console session cookie (HttpOnly, SameSite=Lax)

Path Parameters

id*Id

Spending wallet id (swl_...).

Request Body

application/json
  1. body
challenge_id?|

Id of the passkey challenge returned by the matching options call.

credential?|

The passkey assertion (WebAuthn) produced for the challenge.

Response Body

Success.

application/json
  1. response
wallet*
receipt_id*Receipt Id

Receipt id (rcpt_...).

tx_ref?string|null
[key: string]?any