Skip to content

Enable or Disable Management Console Accounts



POST /api/v1/super-account/set-disable

Overview

Enable or disable management console accounts in batches.

Prerequisites and Usage Steps

First, check each mact_uuid and whether id=1 in the Management Console account list, ensuring that at least one usable management account remains. Set status=2 when isDisable=true, and status=0 when false; unknown/deleted accounts are not updated. Before saving the status, disabling clears the target sessions according to the default management Token cache mode; under the normal default configuration, re-login is required. An exception during cleanup may result in some sessions having logged out while the account status has not yet been saved. Enabling does not restore the original Token. This SYS entry point does not apply initial super administrator protection.

Request Headers

Parameter Name Type Required Description
X-Df-SVersion string Signature version for the raw path and request body; you cannot omit it and continue using the algorithm on this page.
Example: v20240417
How to obtain or fill in: This page's example uses this fixed version, which is paired with the example signature algorithm.
X-Df-Access-Key string Y Read endpoints accept r or w credentials; write endpoints require w credentials.
Example: <external-access-key>
How to obtain or fill in: Assigned by the site administrator as the External API AK. Workspace OpenAPI Keys cannot be used.
X-Df-Signature string Y Concatenate the uppercase method, nonce, raw full path, timestamp, and raw UTF-8 request body with spaces, then compute HMAC-SHA256 and take the hex digest.
Example: <hmac-sha256-hex>
How to obtain or fill in: Compute it using the paired SK according to External API Signature Authentication; see the complete runnable template below.
X-Df-Timestamp string Y Must fall within the signature validity window configured for the site; do not reuse the example timestamp.
Example: 1785427200
How to obtain or fill in: Generate the current Unix seconds string with str(int(time.time())) when sending.
X-Df-Nonce string Y Temporary serial number; on a failed resend, also generate a new value and recompute the signature.
Example: 97d275ee9f774315a7885ba7347acbd9
How to obtain or fill in: Regenerate uuid.uuid4().hex for each request.

Body Request Parameters

Parameter Name Type Required Description
accountUuids commaArray Y Required CSV string, not a JSON array; the field must be spelled exactly accountUuids. The server splits directly without trimming leading or trailing whitespace; do not add spaces between multiple UUIDs. Unknown/deleted UUIDs are ignored, and an empty string matches no normal account.
Null allowed: False
Example: mact_example001
How to obtain or fill in: Obtain one or more management accounts from content.data[].uuid in the Management Console account list and join them with English commas.
isDisable boolean Y Required JSON boolean, not a string.
Null allowed: False
Allowed values: [True, False]
Example: true
How to obtain or fill in: Choose true to disable or false to enable according to the target state.

Additional Parameter Notes

For authentication, see External API Signature Authentication. This module manages site management console accounts; UUIDs are usually prefixed with mact_ and are not workspace business members (acnt_) or workspace Owners. List/details accept r or w permissions; all other operations require w permission. External executes as the sys identity and does not apply the operation restrictions that normal console accounts have regarding the initial super administrator; before operating, verify the target account and the management accounts that can still log in. The endpoint does not return the number of matches; when there are no matches, it may return {}. The Token cleanup mode is the default management-side key mode; if the site overrides this mode, the actual session revocation must be verified separately. Status changes do not delete account profiles.

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/set-disable'
query = {}
data = {'accountUuids': 'mact_example001', 'isDisable': True}
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("Request result unknown; for write operations, query the current account state first, then decide whether to retry.")
    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 a summary of the result of this account status operation; verify it against the fields below.

Field Type Description
content object Returned summary, not a per-account result.
content.username string Optional: the login name of any matching record; order is not guaranteed. When querying the summary, it may also match an account that was originally deleted, so you cannot use it to determine the actual number of updates.
{
  "code": 200,
  "content": {
    "username": "api-doc-admin"
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Response example when there are no matching records:

{
  "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 only covers business errors reachable in the current External SYS branch; the self-protection errors of real accounts in the normal console are not directly carried over. Ordinary 5xx errors such as those from the database/cache are globally unified as ft.InternalServerError; the failure may occur only after the status or profile has already been saved.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Verify the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Some json file format error Submit a JSON object as described in the table.
500 ft.InternalServerError Database, cache, audit, or unhandled field exception Internal error Retain the traceId and verify the account's current profile and status; modifications/deletions may fail only after being saved.

Feedback

Is this page helpful?