Delete Admin Console Account¶
POST /api/v1/super-account/delete
Overview¶
Soft-deletes the specified admin console account.
Before Calling and Usage Steps¶
First, use the Admin Console Account List to verify the target and the initial super admin flag, and ensure that a login-capable admin account is retained. Use the accountUuids CSV to mark accounts in batches with status=3 and set deleteAt; do not delete regular business accounts or workspaces. The current delete branch does not perform the Token cleanup of the disable branch, nor does it refresh the admin account profile cache. Do not assume, based solely on a successful response, that all existing sessions have been immediately invalidated. First process session revocation according to organizational procedures and verify it, then delete. This SYS entry point does not protect the initial super admin; unknown/deleted UUIDs are ignored.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| X-Df-SVersion | string | Signature version for the original path and request body; do not omit it and then continue using the algorithm on this page. Example: v20240417How to obtain or enter: The example on this page uses this fixed version, which is paired with the example signing algorithm. |
|
| X-Df-Access-Key | string | Y | Read endpoints can use r or w credentials; write endpoints require w credentials. Example: <external-access-key>How to obtain or enter: Assigned by the site administrator as an External API AK; do not use a Workspace OpenAPI Key. |
| X-Df-Signature | string | Y | Concatenate the uppercase method, nonce, original full path, timestamp, and original UTF-8 request body with spaces, then compute HMAC-SHA256 and take the hex digest. Example: <hmac-sha256-hex>How to obtain or enter: Compute it with the matching SK according to External API Signature Authentication; see the complete runnable template below. |
| X-Df-Timestamp | string | Y | Must be within the signature validity window configured for the site; do not reuse the example time. Example: 1785427200How to obtain or enter: When sending, use str(int(time.time())) to generate the current Unix seconds string. |
| X-Df-Nonce | string | Y | Temporary nonce; when resending after a failure, generate a new value and recalculate the signature. Example: 97d275ee9f774315a7885ba7347acbd9How to obtain or enter: Generate uuid.uuid4().hex again for each request. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| accountUuids | commaArray | Y | Required CSV string, not a JSON array; the field name is exactly accountUuids. The server calls split directly and does not trim leading or trailing whitespace; do not add spaces between multiple UUIDs. Unknown/deleted UUIDs are ignored, and an empty string does not match any normal account. Allows null: False Example: mact_example001How to obtain or enter: Obtain one or more admin accounts from content.data[].uuid in the Admin Console Account List, and join them with English commas. |
Additional Parameter Notes¶
See External API Signature Authentication for authentication. This module manages site admin console accounts; UUIDs are usually prefixed with mact_; they are not workspace business member acnt_ accounts, nor are they space Owners. List/detail endpoints can use r or w permissions; the others require w permission. External executes as sys and does not apply the restrictions that regular admin console accounts have when operating on the initial super admin. Before operating, verify the target account and an admin account that can still log in. The response returns only one matching username or an empty object, and is not proof of per-account deletion; after deletion, verify each account through the list/detail endpoints. This API does not provide a recovery entry point.
Request Example¶
import hashlib
import hmac
import json
import time
import uuid
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
# Replace with the target site address and the External API AK/SK assigned by the administrator.
server = "https://external-api.guance.com"
access_key = "<external-access-key>"
secret_key = "<external-secret-key>"
method = 'POST'
path = '/api/v1/super-account/delete'
query = {}
data = {'accountUuids': 'mact_example001'}
full_path = path + ("?" + urlencode(query) if query else "")
body = "" if data is None else json.dumps(data, ensure_ascii=False, separators=(",", ":"))
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
string_to_sign = " ".join([method, nonce, full_path, timestamp, body])
signature = hmac.new(secret_key.encode("utf-8"), string_to_sign.encode("utf-8"), hashlib.sha256).hexdigest()
headers = {
"X-Df-Access-Key": access_key,
"X-Df-Timestamp": timestamp,
"X-Df-Nonce": nonce,
"X-Df-Signature": signature,
"X-Df-SVersion": "v20240417",
}
if data is not None:
headers["Content-Type"] = "application/json"
request = Request(server + full_path, data=None if data is None else body.encode("utf-8"), headers=headers, method=method)
try:
with urlopen(request, timeout=30) as result:
payload = json.loads(result.read().decode("utf-8"))
except HTTPError as error:
detail = error.read().decode("utf-8")
print("HTTP", error.code, detail) # Check errorCode, message, content, and traceId; do not print the AK/SK.
raise SystemExit(1)
except (URLError, TimeoutError):
print("The request result is unknown; for write operations, query the current account status first, and decide whether to retry after confirmation.")
raise SystemExit(1)
print(json.dumps(payload, ensure_ascii=False, indent=2))
Response¶
HTTP 200, with the unified application/json envelope; External does not automatically add declaration. content is the result summary of this delete operation; verify it against the fields below. It is not the complete account profile.
| Field | Type | Description |
|---|---|---|
| content | object | Result summary, not a per-account result. |
| content.username | string | Optional: the login name of any one matching record; order is not guaranteed. When querying the summary, it may still match an account that was already deleted, so do not use it to determine the actual number of updates. |
{
"code": 200,
"content": {
"username": "api-doc-admin"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Example response when no records match:
{
"code": 200,
"content": {},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
This table covers only the business errors reachable by the current External SYS branch; self-protection errors for real accounts in the regular admin console are not directly reproduced here. Ordinary 5xx errors such as database/cache errors are globally unified as ft.InternalServerError, and failures may occur after the status or profile has already been saved.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field is missing, or the field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Invalid request JSON syntax | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The JSON top level is not an object | Some JSON file format errors | Submit a JSON object according to the table. |
| 500 | ft.InternalServerError | Database, cache, audit, or unhandled field exception | Internal error | Retain the traceId and verify the current account profile and status; updates/deletions may fail after they have been saved. |