Deletes a MarginX group and releases its members without deleting the underlying accounts or moving funds. Requires TRANSFER permission.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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 type | Can call | Scope |
|---|---|---|
| Main User Level API key (also the Main Portfolio key) | Yes | Margin groups belonging to the main user. |
| Sub-user Level API key | No | Not supported. |
| Dedicated Sub Portfolio Level API key | No | Not supported. |
| Exchange-native API key | No | Use an LTP Main User Level API key. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
groupId | Path | string | Yes | Margin 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
| Field | Type | Description |
|---|---|---|
code | integer | 200 means success; any other value indicates an error. |
message | string | Result message. |
data.id | string | Deleted margin group ID. |
data.deleted | boolean | true 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.
| Code | When it occurs | What to do |
|---|---|---|
100400 | Invalid group ID, including zero, negative, non-integer or out-of-range values. | Use a valid group ID. |
-1 | The 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. |
2000 | Signature verification fails. | Check the authentication headers and signature. |
2003 | The calling API key level is not allowed. | Use a Main User Level API key. |
2004 | The key lacks a required permission. | Use a key with TRANSFER permission. |
100429 | Rate limit exceeded. | Reduce the request rate. |
