Skip to main content
POST
/
wallet
/
unlink
Wallet Unlink
curl --request POST \
  --url https://pm-t1.bxingupdate.com/bvapi/wallet/unlink \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "message": "<string>",
  "error": "<string>"
}
Revert from self-custody back to managed wallet.

Overview

Restores the user’s managed wallet from the previous state. Users can switch back and forth freely between managed and self-custody.

What Happens

  1. mk_ai_agent.wallet_address is cleared (set to NULL)
  2. All wallet credential rows for the user are physically deleted from mk_ai_agent_wallet_credential. This is intentional: the table has a unique index on api_key, and a soft-deleted row would block the same key from being re-registered against a different (wallet_address, signature_type) pair (e.g. migrating from an EOA to its Polymarket Deposit Wallet).
  3. The user can re-link a wallet at any time via the challenge flow.
Unlink is destructive. The CLOB API key / secret / passphrase that were stored for the user are removed from Aion’s database and cannot be recovered through Aion. They can still be re-derived from the user’s private key via Polymarket’s auth endpoint.
In most cases you do not need to call /wallet/unlink before re-registering. POST /wallet/credentials automatically reclaims the api_key slot when you register the same key against a different (walletAddress, signatureType) pair — for example, when switching from the bare EOA (signatureType=0) to the user’s Polymarket Deposit Wallet (signatureType=3) after detecting it via the profile API.

Rate Limiting

  • 10 attempts per hour per API key (IP-based)

Re-linking

After unlinking, you can link the same or a different wallet by going through the challenge flow again:
  1. GET /wallet/link/challenge?address=0x...
  2. POST /wallet/link with the signed challenge

Authorizations

Authorization
string
header
default:YOUR_API_KEY
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

Successful Response

success
boolean
required
message
string | null
error
string | null