cURL
curl --request POST \
--url https://test.deribit.com/api/v2/private/remove_subaccount \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 6,
"method": "private/remove_subaccount",
"params": {
"subaccount_id": 120
}
}'{
"jsonrpc": "2.0",
"id": 6,
"result": "ok"
}Account Management
private/remove_subaccount
Removes a subaccount from the main account. The subaccount must be empty before it can be removed.
Removal cannot be undone through the API. The subaccount can no longer be used or logged in to, it disappears from private/get_subaccounts, all of its active sessions are terminated, and its deposit addresses are moved to the main account.
Access & Restrictions:
- Must be called by the main account that owns the subaccount. Any other account is rejected with
13009(unauthorized); an already removed subaccount returns13009withdata.reason=already_removed. - Also rejected for accounts without subaccount management (
13009), retail brokers (14021) and locked accounts (11098). - Vault subaccounts are rejected during access validation with
14049(vault_subaccount_not_allowed). - Only one subaccount can be removed per main account every 5 minutes. A repeated call earlier returns
12006(remove_subaccount_over_limit) with the remaining time indata.wait(seconds).
Removal is refused with 12007 (subaccount_not_removable); data.reason is one of:
"has not zero equity": open positions, a position closed since the last daily settlement (08:00 UTC) whose realized profit/loss is not settled yet (the subaccount becomes removable after that settlement), non-zero initial or maintenance margin, or absolute equity or balance at or above the currency’s minimum balance (only dust whose absolute value is below the threshold is allowed);"has opened trigger orders": untriggered trigger orders;"has pending deposits";"is owner of app": the subaccount owns an API application;"has active block rfq"or"is part of block rfq allocation";"is linked to a voice broker";"is an LSP participant";"has a locked portfolio, reason: <reasons>", where<reasons>is a comma-separated list such asliquidation running,negative equity,locked by admin,locked on user requestorlegacy lock.
Other reason strings may be returned in rare cases.
If the subaccount’s portfolio could not be cleaned up or verified, or the change could not be saved, the call fails with 13008 (request_failed).
📖 Related Article: Managing Subaccounts
Scope: account:read_write
cURL
curl --request POST \
--url https://test.deribit.com/api/v2/private/remove_subaccount \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 6,
"method": "private/remove_subaccount",
"params": {
"subaccount_id": 120
}
}'{
"jsonrpc": "2.0",
"id": 6,
"result": "ok"
}Query Parameters
Was this page helpful?