Skip to content

Request access

Tell us about your processing, and we'll reply by email.

API reference

Sweeps

A sweep moves a token or the native coin from a deposit address to a hot wallet. Sweeps go on chain in batches: one transaction of your gas wallet carries the due sweeps on a chain, to any of your hot wallets.

GET/v1/sweeps

Your sweeps, newest first. The filters combine.

NameInTypeDescription
limitqueryintegerHow many rows a page holds. From 1 to 200. Default: 50.
cursorquerystringThe next_cursor of the previous page; none for the first page.
statusquerystringOnly sweeps with this status. One of: queued, processing, swept, failed, rejected.
chain_idqueryChainIDOnly this chain.
accountqueryAddressOnly sweeps from this deposit address.
hot_walletqueryAddressOnly sweeps to this hot wallet.
external_idquerystringOnly the sweep with this external_id. Up to 128 characters.
tx_hashqueryTxHashOnly the sweeps the transaction with this hash carried. Any hash of the transaction works: the mined one, or one it had before it was replaced at a higher fee. A transaction that reverted or was dropped finds its sweeps too, though they went back to the queue and may ride another transaction since. The exception is one that reverted or was dropped while a version of the service from before October 24, 2026 was running (see Transaction).
transaction_idqueryTransactionIDOnly the sweeps the transaction with this id carried, as with tx_hash.
list_idquerystring (uuid)Only the items of the sweep list with this id.
StatusDescription
200A page of sweeps. Returns the fields below.
400invalid_query: a query parameter is not valid; message says which.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
FieldTypeDescription
items requiredarray of Sweep
next_cursor requiredNextCursorThe cursor of the next page; null on the last page.
Terminal window
curl "https://api-testnet.portuna.io/v1/sweeps?chain_id=11155111&status=swept&limit=1" \
-H "Authorization: Bearer $PORTUNA_API_KEY"
200 OK
{
"items": [
{
"id": "8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047",
"external_id": "dep-80c2d4",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"token_address": "0x3809a97a7a25C8bA577027c0AE2D81a09cdA1a2f",
"token_symbol": "USDT",
"token_decimals": 6,
"delegate": "0x4B016ED183d0CF18B99d2d4f9f6F218BC1D9CaF4",
"status": "swept",
"attempts": 1,
"swept_amount": "250000000",
"tx_hash": "0xe2a3d8ffdcd7c4ed8a2389a59ce91622863c495d052a7571206bb494919dc35b",
"transaction_id": 48213,
"batch_size": 50,
"batch_index": 17,
"log_index": 142,
"transfer_log_index": 141,
"kind": "repeat",
"gas": 18078,
"gas_cost": "21693600000000",
"fee": "23358000000000",
"conventional_gas": 53633,
"rate_bps": 7000,
"tariff_source": "base",
"created_at": "2026-10-11T07:02:15Z",
"updated_at": "2026-10-11T07:03:02Z"
}
],
"next_cursor": "eyJ0IjoiMjAyNi0xMC0xMVQwNzowMjoxNVoiLCJpZCI6IjhhNmUyZjMxIn0"
}

POST/v1/sweeps

Sweeps a token or the native coin from a deposit address to a hot wallet. Sweeps that have arrived by the time a batch is sent go in that one batch, whatever hot wallets they go to. The deposit address must run on one of your deployed delegates that holds hot_wallet: until it is delegated to one, the request carries its authorization for one. The outcome comes in the webhook event of the transaction that carried the sweep, transaction.mined, or in transaction.reverted or transaction.dropped once its attempts ran out; a sweep that no transaction carried ends in a sweep.rejected or sweep.failed event. It also shows in GET /v1/sweeps/{id}.

FieldTypeDescription
external_idstringYour id for the sweep, unique in your account: a request with an external_id that is already taken returns that sweep instead of creating another, so retries are safe. Up to 128 characters.
chain_id requiredChainIDThe chain’s id (EIP-155): 11155111 Sepolia and 97 BSC testnet with a test key, 1 Ethereum and 56 BSC with a live key.
hot_wallet requiredAddressYour hot wallet on this chain, where the funds go. A delegate that holds it must be active.
account requiredAddressThe deposit address.
token requiredstringA token’s ticker listed on the chain (in any case), the contract address of a listed token or of a token you enabled (POST /v1/tokens), or native (or the native coin’s ticker) for the native coin. The token must be active in GET /v1/tokens.
amountAmountHow much to sweep, above zero; without it, the whole balance.
keep_one_unitbooleanLeave 1 smallest unit of the token on the deposit address; defaults to your settings. Ignored for the native coin.
authorizationAuthorizationNeeded until the deposit address is delegated to a deployed delegate that holds hot_wallet. After that it is not used, though one that is sent must still be valid. One for another delegate of yours that holds the hot wallet moves the deposit address to that delegate.
authorization.chain_id requiredinteger (int64)The chain of the request; 0 (any chain) is refused.
authorization.address requiredAddressA deployed delegate that holds the sweep’s hot wallet: the hot wallet’s own from POST /v1/hot-wallets, or one of a set from POST /v1/delegates. The zero address for a revocation.
authorization.nonce requiredinteger (int64)The deposit address’s current nonce.
authorization.y_parity requiredintegerThe signature’s y parity. One of: 0, 1.
authorization.r requiredstringThe signature’s r, 0x-hex of up to 32 bytes. Format: ^0x[0-9a-fA-F]{1,64}$.
authorization.s requiredstringThe signature’s s, 0x-hex of up to 32 bytes, in the lower half of the curve order (EIP-2). Format: ^0x[0-9a-fA-F]{1,64}$.
StatusDescription
200A sweep with this external_id already exists. It is returned as it is now, and no other sweep is created. Returns Sweep.
202The sweep is queued. Returns Sweep.
400invalid_json: the body is not JSON, is over 64 KiB or has unknown fields.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
409hot_wallet_not_active: no delegate that holds the hot wallet is deployed yet: its own delegate is still being deployed, or its deployment failed.
422unknown_chain, invalid_external_id, invalid_address, unknown_token (neither a base token of the chain nor one you added: a token of your own is named by its address, never by its symbol), token_disabled (you turned the token off), token_refused (Portuna refused the token, see its reason in GET /v1/tokens), token_needs_support (the token was turned off after 5 sweeps in a row failed because of it: contact support), token_blocked (Portuna blocked the token for every account), invalid_amount, unknown_hot_wallet (the hot wallet is not registered on this chain) or invalid_authorization (among others, it is for a delegate that is not deployed or does not hold the hot wallet); message says what is wrong.
Terminal window
curl -X POST "https://api-testnet.portuna.io/v1/sweeps" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "dep-7f3a91",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"authorization": {
"chain_id": 11155111,
"address": "0x4B016ED183d0CF18B99d2d4f9f6F218BC1D9CaF4",
"nonce": 0,
"y_parity": 1,
"r": "0x78bf295470b34d1375ada01b437d335f9ba3a1ecae6e9e4aeb165e7ff8a269fc",
"s": "0x5cf744d5817c760c1613581e06567596cb59d014a6bf602b4809a4040a837b7c"
}
}'
202 Accepted
{
"id": "3d0c5d0e-6b7f-4a5e-9a51-3c8f0b2e7d14",
"external_id": "dep-7f3a91",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"token_address": "0x3809a97a7a25C8bA577027c0AE2D81a09cdA1a2f",
"token_symbol": "USDT",
"token_decimals": 6,
"status": "queued",
"attempts": 0,
"created_at": "2026-10-10T09:20:41Z",
"updated_at": "2026-10-10T09:20:41Z"
}

GET/v1/sweeps/{id}

NameInTypeDescription
id requiredpathstring (uuid)The sweep’s id.
StatusDescription
200The sweep. Returns Sweep.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
404not_found: there is no such object in your account.
Terminal window
curl "https://api-testnet.portuna.io/v1/sweeps/8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047" \
-H "Authorization: Bearer $PORTUNA_API_KEY"
200 OK
{
"id": "8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047",
"external_id": "dep-80c2d4",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"token_address": "0x3809a97a7a25C8bA577027c0AE2D81a09cdA1a2f",
"token_symbol": "USDT",
"token_decimals": 6,
"delegate": "0x4B016ED183d0CF18B99d2d4f9f6F218BC1D9CaF4",
"status": "swept",
"attempts": 1,
"swept_amount": "250000000",
"tx_hash": "0xe2a3d8ffdcd7c4ed8a2389a59ce91622863c495d052a7571206bb494919dc35b",
"transaction_id": 48213,
"batch_size": 50,
"batch_index": 17,
"log_index": 142,
"transfer_log_index": 141,
"kind": "repeat",
"gas": 18078,
"gas_cost": "21693600000000",
"fee": "23358000000000",
"conventional_gas": 53633,
"rate_bps": 7000,
"tariff_source": "base",
"created_at": "2026-10-11T07:02:15Z",
"updated_at": "2026-10-11T07:03:02Z"
}