Delete Margin Group

Deletes a MarginX group and releases its members without deleting the underlying accounts or moving funds. Requires TRANSFER permission.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Deletes a MarginX margin group and releases its members from that group. It does not delete DMA accounts or RapidX Portfolios, withdraw assets or transfer funds.

Rate limit: 10 requests per minute per API key.

API key access

Requires a signed LTP Open API request with TRANSFER permission.

API key typeCan callScope
Main User Level API key (also the Main Portfolio key)YesMargin groups belonging to the main user.
Sub-user Level API keyNoNot supported.
Dedicated Sub Portfolio Level API keyNoNot supported.
Exchange-native API keyNoUse an LTP Main User Level API key.

Parameters

NameInTypeRequiredDescription
groupIdPathstringYesMargin group ID returned by Get Margin Groups or Create Margin Group. Not a DMA account ID or Portfolio ID. Must be a positive integer expressed as a string.

There are no query parameters and no request body. The group must have its debt settled and no conflicting in-flight orders. Deletion releases all member accounts from the group; the accounts themselves remain available.

For authentication, follow Authentication. With no query or body parameters, the HMAC input is &<nonce>: an ampersand followed by the same nonce sent in the header.

Response fields

FieldTypeDescription
codeinteger200 means success; any other value indicates an error.
messagestringResult message.
data.idstringDeleted margin group ID.
data.deletedbooleantrue when deletion succeeds.

After successful deletion, the group no longer appears in the group list. Its detail and member queries return a group-unavailable error. A new group created with the same members receives a new group ID.

Repeated deletion and uncertain outcomes

Deleting a nonexistent group or repeating a successful deletion returns an error, not another successful deletion. The current response is:

{
  "code": -1,
  "message": "Lending data temporarily unavailable"
}

Despite its wording, this message can mean the group does not exist; it does not necessarily indicate a temporary outage. If a deletion request times out or its outcome is unclear, check the group list before retrying. Do not keep retrying solely because the message says "temporarily unavailable".

Success and error examples are available in the response panel.

Error codes

Errors can return HTTP 200 with a non-success JSON code. Check code, not HTTP status alone. See Error Codes for shared errors.

CodeWhen it occursWhat to do
100400Invalid group ID, including zero, negative, non-integer or out-of-range values.Use a valid group ID.
-1The group is unavailable or deletion fails a business check. Nonexistent groups and repeated deletions currently return Lending data temporarily unavailable.Check whether the group still exists. If it does, check outstanding debt and in-flight orders before retrying; contact support if needed.
2000Signature verification fails.Check the authentication headers and signature.
2003The calling API key level is not allowed.Use a Main User Level API key.
2004The key lacks a required permission.Use a key with TRANSFER permission.
100429Rate limit exceeded.Reduce the request rate.
Path Params
string
required

Margin group ID, not a DMA account or Portfolio ID. Positive integer expressed as a string.

Headers
string
required

Current Unix timestamp in seconds, also used in the signature.

string
required

HMAC-SHA256 hex signature; see Authentication.

string
required

Current Unix timestamp in microseconds.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json