API reference
Webhook events
How to verify and handle deliveries, with code: Webhooks.
Each event goes to your webhook URL as a POST with a JSON body. Events are recorded only while a webhook is
set.
- Delivery is at least once: handle each event
idonce, and apply each item of a transaction event once. Order is not guaranteed: rely on the status indata, not on the order of events. A final status (swept,failed,rejected,revoked) never changes: an event that comes later withprocessingorqueuedfor it is older news. - Store the event, then respond: transaction events carry up to 200 items, so accept bodies of up to 256 KiB.
- Verify every delivery:
v1inPortuna-Signatureis the HMAC-SHA256, in hex, of the string<t>.<body>with your webhook secret as the key, where<body>is the raw request body. Accepttonly within 5 minutes of your clock. Each attempt is signed anew. - Respond with any 2xx within 10 seconds. Any other response, a redirect included, or no response in time is a failed attempt: the event is tried again after 10 s, 20 s, 40 s and so on, up to an hour between attempts, 12 attempts in all.
- New event types may come: accept and ignore the ones you do not handle.
Headers
Section titled “Headers”| Name | Type | Description |
|---|---|---|
Portuna-Signature required | string | t=<unix seconds>,v1=<signature>: the time of this attempt and the HMAC-SHA256 of <t>.<body> with your webhook secret, in hex. Example: t=1791634982,v1=6e735f32a0… |
Portuna-Event required | string | The event type, as in type in the body. Example: transaction.mined |
Portuna-Delivery required | string (uuid) | The event’s id, as in the body. It is the same in every attempt. |
User-Agent | string | Identifies the sender. Verify deliveries by their signature, not by this header. Example: portuna-webhooks/1 |
The body is an Event object.
The body of a webhook delivery. type tells what happened and what data is.
- Sweeps and revocations that ride a transaction: a transaction event, one per transaction rather than one per
sweep.
transaction.sentcomes when the transaction is sent and again for every replacement at a higher fee;transaction.minedonce it is mined and confirmed, with each sweep’s outcome;transaction.revertedortransaction.droppedif it failed as a whole, with what became of each sweep.datais the transaction and its items as they were at the event. - Sweeps and revocations that ended before any transaction carried them:
sweep.rejected,sweep.failed,revocation.rejected,revocation.failed, with the sweep as inGET /v1/sweeps/{id}or the revocation as inGET /v1/revocations/{id}. - A hot wallet as in
GET /v1/hot-wallets, a delegate as inGET /v1/delegates, a token as inGET /v1/tokens, a change of your tariff, a low balance alert, a payout as inGET /v1/payouts.
Every sweep’s outcome comes in exactly one event. Hot wallets, delegates, tokens, sweeps and revocations are shown as they are when the event is delivered (the status of a sweep or revocation in its event is final, so that is how it was); transactions and payouts as they were when the event happened.
| Field | Type | Description |
|---|---|---|
id required | string (uuid) | The event’s id, the same in every attempt. |
type required | string | The event type. One of: transaction.sent, transaction.mined, transaction.reverted, transaction.dropped, sweep.failed, sweep.rejected, revocation.failed, revocation.rejected, hot_wallet.active, hot_wallet.failed, delegate.active, delegate.failed, token.refused, tariff.changed, balance.low, balance.payout. |
created_at required | string (date-time) | When the event happened. |
data required | TransactionEventData | Sweep | Revocation | HotWallet | Delegate | Token | TariffChange | BalanceLow | Payout | Depends on type: see below. |
Event types
Section titled “Event types”| Type | data | Description |
|---|---|---|
transaction.senttransaction.minedtransaction.revertedtransaction.dropped | TransactionEventData | A transaction of sweeps or revocations was sent, or ended. transaction.sent: a version of it was signed and is being broadcast, the first or a replacement at a higher fee with a new hash; its items are processing. transaction.mined: it is mined and confirmed (3 blocks in Ethereum, 15 in BSC); each item is swept or failed (revoked or failed for revocations). transaction.reverted: it is mined but failed as a whole, its gas spent; transaction.dropped: another transaction took its nonce, nothing was spent. In both, each item is queued, to ride a new transaction with events of its own, or failed if its attempts ran out. |
sweep.failedsweep.rejected | Sweep | A sweep ended before any transaction carried it. sweep.rejected: a check before sending failed; sweep.failed: its attempts ran out before it was sent, for example the gas wallet could not pay. A sweep that rode a transaction ends in that transaction’s event instead. |
revocation.failedrevocation.rejected | Revocation | A revocation ended before any transaction carried it. revocation.rejected: it was never sent; revocation.failed: its attempts ran out before it was sent. A revocation that rode a transaction ends in that transaction’s event instead. |
hot_wallet.activehot_wallet.failed | HotWallet | A hot wallet’s delegate deployment ended. hot_wallet.active: the delegate is deployed; hot_wallet.failed: the deployment failed. |
delegate.activedelegate.failed | Delegate | The deployment of a delegate of a set ended. delegate.active: the delegate is deployed; delegate.failed: the deployment failed. A hot wallet’s own delegate reports with hot_wallet.* events instead. |
token.refused | Token | A token you could sweep is refused now: its sweeps kept failing, it failed the checks again when the service started, or Portuna blocked it. Its sweeps that are still queued are rejected with token_disabled. |
tariff.changed | TariffChange | What you pay for a token changed, or will: a rate Portuna agreed with you was set, taken back, runs out within 7 days or ran out, or a token’s conventional cost changed. A rise of a conventional cost by more than 5% applies 7 days after this event; you are notified 7 days before an agreed rate runs out, and again when it does. |
balance.low | BalanceLow | Your gas wallet fell below a low balance threshold. One event each time it falls below; the alert re-arms once the balance recovers. |
balance.payout | Payout | A payout of your available balance to one of your hot wallets was sent (status is sent, with its transaction), paid or failed. One event for each of these steps. |
Example payload
Section titled “Example payload”Content-Type: application/jsonUser-Agent: portuna-webhooks/1Portuna-Event: transaction.minedPortuna-Delivery: 7e2c9a41-3b5d-4f60-8c17-d9a0e4b2f816Portuna-Signature: t=1793095272,v1=<hex HMAC-SHA256>{ "id": "7e2c9a41-3b5d-4f60-8c17-d9a0e4b2f816", "type": "transaction.mined", "created_at": "2026-10-27T10:01:12Z", "data": { "transaction": { "id": 48420, "chain_id": 11155111, "kind": "sweep", "status": "mined", "hash": "0x315137ae951da414629cf9481c89422639bd7e238873820559e0b0a2f8071457", "block_number": 11987254, "hot_wallets": [ "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769" ], "sweeps": { "total": 3, "processing": 0, "swept": 2, "failed": 1, "requeued": 0 }, "revocations": null, "gas_used": 104220, "gas_cost": "125064000000000", "fees": "25278000000000", "created_at": "2026-10-27T10:00:03Z", "mined_at": "2026-10-27T10:01:12Z", "list_id": null }, "part": 1, "parts": 1, "items": [ { "id": "c7d41a92-5b3e-4f08-9d21-6e8a0b3f5c71", "external_id": "dep-81f0a2", "batch_index": 0, "account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23", "hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769", "token": "USDT", "token_address": "0x3809a97a7a25C8bA577027c0AE2D81a09cdA1a2f", "amount": null, "status": "swept", "swept_amount": "120000000", "fee": "23358000000000", "log_index": 211, "transfer_log_index": 210 }, { "id": "1e8b6f04-9a27-4c3d-b5e1-0f4a7d2c9e63", "external_id": "dep-81f0a3", "batch_index": 1, "account": "0x4B506125a16ab3A70A2970e11B1cd9039b0b0D99", "hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769", "token": "ETH", "token_address": null, "amount": null, "status": "swept", "swept_amount": "4180000000000000", "fee": "1920000000000", "log_index": 212 }, { "id": "5f2a9c7e-0d14-4b86-a3f9-7c1e2b8d4a50", "external_id": "dep-81f0a4", "batch_index": 2, "account": "0xa4c0D7FcDDd1e47925E354eB506Cc3C209C1787b", "hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769", "token": "USDT", "token_address": "0x3809a97a7a25C8bA577027c0AE2D81a09cdA1a2f", "amount": "50000000", "status": "failed", "reason": "NothingToSweep", "log_index": 213 } ] }}