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.
List sweeps
Section titled “List sweeps”GET/v1/sweeps
Your sweeps, newest first. The filters combine.
Parameters
Section titled “Parameters”| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | How many rows a page holds. From 1 to 200. Default: 50. |
cursor | query | string | The next_cursor of the previous page; none for the first page. |
status | query | string | Only sweeps with this status. One of: queued, processing, swept, failed, rejected. |
chain_id | query | ChainID | Only this chain. |
account | query | Address | Only sweeps from this deposit address. |
hot_wallet | query | Address | Only sweeps to this hot wallet. |
external_id | query | string | Only the sweep with this external_id. Up to 128 characters. |
tx_hash | query | TxHash | Only 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_id | query | TransactionID | Only the sweeps the transaction with this id carried, as with tx_hash. |
list_id | query | string (uuid) | Only the items of the sweep list with this id. |
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | A page of sweeps. Returns the fields below. |
400 | invalid_query: a query parameter is not valid; message says which. |
401 | unauthorized: no API key, an unknown one or a revoked one. |
403 | partner_disabled: your account is disabled. |
Response body
Section titled “Response body”| Field | Type | Description |
|---|---|---|
items required | array of Sweep | |
next_cursor required | NextCursor | The cursor of the next page; null on the last page. |
Example request
Section titled “Example request”curl "https://api-testnet.portuna.io/v1/sweeps?chain_id=11155111&status=swept&limit=1" \ -H "Authorization: Bearer $PORTUNA_API_KEY"Example response
Section titled “Example response”{ "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"}Create a sweep
Section titled “Create a sweep”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}.
Request body
Section titled “Request body”| Field | Type | Description |
|---|---|---|
external_id | string | Your 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 required | ChainID | The 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 required | Address | Your hot wallet on this chain, where the funds go. A delegate that holds it must be active. |
account required | Address | The deposit address. |
token required | string | A 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. |
amount | Amount | How much to sweep, above zero; without it, the whole balance. |
keep_one_unit | boolean | Leave 1 smallest unit of the token on the deposit address; defaults to your settings. Ignored for the native coin. |
authorization | Authorization | Needed 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 required | integer (int64) | The chain of the request; 0 (any chain) is refused. |
authorization.address required | Address | A 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 required | integer (int64) | The deposit address’s current nonce. |
authorization.y_parity required | integer | The signature’s y parity. One of: 0, 1. |
authorization.r required | string | The signature’s r, 0x-hex of up to 32 bytes. Format: ^0x[0-9a-fA-F]{1,64}$. |
authorization.s required | string | The 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}$. |
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | A sweep with this external_id already exists. It is returned as it is now, and no other sweep is created. Returns Sweep. |
202 | The sweep is queued. Returns Sweep. |
400 | invalid_json: the body is not JSON, is over 64 KiB or has unknown fields. |
401 | unauthorized: no API key, an unknown one or a revoked one. |
403 | partner_disabled: your account is disabled. |
409 | hot_wallet_not_active: no delegate that holds the hot wallet is deployed yet: its own delegate is still being deployed, or its deployment failed. |
422 | unknown_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. |
Example request
Section titled “Example request”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" }}'Example response
Section titled “Example response”{ "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 a sweep
Section titled “Get a sweep”GET/v1/sweeps/{id}
Parameters
Section titled “Parameters”| Name | In | Type | Description |
|---|---|---|---|
id required | path | string (uuid) | The sweep’s id. |
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | The sweep. Returns Sweep. |
401 | unauthorized: no API key, an unknown one or a revoked one. |
403 | partner_disabled: your account is disabled. |
404 | not_found: there is no such object in your account. |
Example request
Section titled “Example request”curl "https://api-testnet.portuna.io/v1/sweeps/8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047" \ -H "Authorization: Bearer $PORTUNA_API_KEY"Example response
Section titled “Example response”{ "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"}