POST /v1/partner/accounts/{accountId}/release ends your link to an account. The account stays an ordinary Kash user, but you can no longer act for it: from then on every route answers it 404 ACCOUNT_NOT_FOUND, and no further webhooks arrive for it.
Users have no Kash login yet, so a released account’s funds would be out of their reach. The API therefore refuses to release an account that still holds anything.
Empty the account first
1
Close its positions
Sell open positions, or wait for their markets to resolve.
GET /v1/portfolio/positions with Kash-Account lists them. Winnings are paid in automatically when a market resolves.2
Withdraw the USDC
Read
maxAmountAtomic from the withdrawal quote and withdraw it. Wait for withdrawal.completed.3
Wait two minutes
Anything that finished in the last two minutes still blocks a release, while the chain catches up.
4
Release
Call release. The answer is
200 with the account in released.When a release is refused
409 RELEASE_REQUIRES_EMPTY_ACCOUNT while the account:
- holds USDC;
- holds a position in a market that has not resolved;
- holds a winning position it has not redeemed;
- holds a position in a cancelled market;
- has a trade, redemption, payout, withdrawal, or other transfer or charge on its wallet that has not finished, including a payout the API makes when a market resolves and a withdrawal that failed and returned its USDC;
- had any of those finish less than two minutes ago.
detail says what was found first:
503 DEPENDENCY_UNAVAILABLE when the holdings cannot be read from the chain, when the account-changes switch cannot be read, or when the account kept changing while it was being released. 503 ROUTE_DISABLED when account changes are switched off. Nothing changed; retry.
Accounts with no wallet
An account inprovisioning or provisioning_failed has no wallet, so it holds nothing and is released without a chain read. Releasing a provisioning_failed account is how you clear it before creating the user’s account again.
After a release
- You receive
account.released. - The account answers
404 ACCOUNT_NOT_FOUNDeverywhere and is no longer listed. - No further webhooks arrive for it, apart from a destination change made before the release that is delivered after it, since webhooks are not ordered.
- The
externalIdis free: creating it again makes a new account with a newaccountId. - A retry of the release with the same
Idempotency-Keyreplays the stored200. Without the key, a second release answers404.
Next
Webhooks
Every event your endpoint receives.
Errors
Every code a partner integration can meet.