Modify Admin Console Account Profile¶
POST /api/v1/super-account/{account_uuid}/modify
Overview¶
Modify the Admin Console account profile, role, or password.
Before Calling and Usage Steps¶
Requires an External credential with w permission. First, back up the existing profile using Admin Console Account Details; omitted fields are retained, an empty password string also retains the password, while an empty mobile string clears it. extend/exterId are compatibility declaration fields that are not in effect; do not use them for business binding. You can perform operations on non-deleted accounts, including disabled accounts. When modifying a disabled account, the profile may be saved first, and then a cache refresh throws 401 AccountDisabled; if you receive a 401, also check the current state first. If the target does not exist, this SYS branch may return 500; it cannot be guaranteed to return 404 like the details endpoint. Currently, External does not apply the protection that regular Admin Console accounts provide for the initial super administrator; verify the target first.
Path Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| account_uuid | string | Y | Admin Console account UUID, not a regular business account UUID. Example: mact_example001How to obtain or enter: Obtain it from content.data[].uuid in the Admin Console Account List. |
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Df-SVersion | string | Signature version for the original path and request body; you cannot omit it and continue using the algorithm on this page. Example: v20240417How to obtain or enter: The example on this page uses this fixed version, which matches the example signature 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 the External API AK; workspace OpenAPI Keys cannot be used. |
| 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: Generate the current Unix seconds string with str(int(time.time())) when sending. |
| X-Df-Nonce | string | Y | Temporary serial number; when resending after a failure, also generate a new value and recompute the signature. Example: 97d275ee9f774315a7885ba7347acbd9How to obtain or enter: Regenerate uuid.uuid4().hex for each request. |
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | Optional; omitted to retain. It must not duplicate the login name of another non-deleted account. It is recommended to keep it within 128 characters and not pass an empty string, to avoid clearing the login name and affecting subsequent logins; the current declaration does not enforce non-emptiness, and null is invalid. Allows null: False Example: api-doc-admin-renamedHow to obtain or enter: Read the current login name from Admin Console Account Details and replace it with a new unique value as needed. |
|
| password | string | Optional; omitting it or passing an empty string both leave the password unchanged; if non-empty, it is validated for strength and resetPasswordAt is updated. When the password rotation policy is enabled, it must not duplicate any password within the most recently configured number of passwords; null is invalid. Allows null: False Example: Changed!2026aHow to obtain or enter: Enter a new strong password; omit it when you do not need to change the password. |
|
| string | Optional email string; omitted to retain. An explicit value must be a valid email address and cannot be cleared with an empty string. It is recommended to keep it within 64 characters; do not pass null or a non-string, as this may trigger a 500. Allows null: False $isEmail: True Example: xxx@guance.comHow to obtain or enter: Enter a valid email address string that can receive notifications. |
||
| name | string | Optional; omitted to retain. It is recommended to keep it within 64 characters; null is invalid. Allows null: False Example: Example Admin New NicknameHow to obtain or enter: Update the display nickname as needed. |
|
| role | string | Optional; omitted to retain. Setting it to dev attempts to clear the default admin Token cache and causes standard Admin Console login to be rejected; do not treat dev as a regular read-only account; null is invalid. Allows null: False Example: adminHow to obtain or enter: Use only admin/dev defined by this Admin Console; these are not workspace roles. |
|
| mobile | string | Optional; omitted to retain. No countryCode splitting/number validation is performed; null is invalid. Allows null: False Example: 13800138000How to obtain or enter: Enter a new mobile number string, or use an empty string to clear it. |
|
| exterId | string | Optional string; this endpoint does not establish an external identity binding; null is invalid. Allows null: False Example: legacy-idHow to obtain or enter: Legacy declaration compatibility parameter; currently not read or persisted, so it is recommended to omit it. |
|
| extend | json | Optional object; current modifications are not saved to the mapping column, and the corresponding field is not returned. Allows null: False Example: {}How to obtain or enter: Legacy declaration compatibility field; currently not persisted, so it is recommended to omit it. |
Additional Parameter Notes¶
For authentication, see External API Signature Authentication. This module manages site Admin Console accounts; UUIDs usually start with mact_; they are not workspace business members acnt_, nor workspace Owners. List/Details can use r or w permissions; the rest require w permission. External executes as the sys identity and does not apply the operation restrictions that regular Admin Console accounts have for the initial super administrator. Before operating, verify the target account and an Admin Console account that can still log in. Modification refreshes the account profile cache. A non-empty new password updates the reset time; role=dev clears the current default admin Token cache mode. If the site has customized the Token key template, the administrator must verify the actual clearing effect.
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/mact_example001/modify'
query = {}
data = {'name': 'Example Admin New Nickname'}
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 AK/SK.
raise SystemExit(1)
except (URLError, TimeoutError):
print("The request result is unknown; for write operations, query the current account state first, and decide whether to retry after confirmation.")
raise SystemExit(1)
print(json.dumps(payload, ensure_ascii=False, indent=2))
Response¶
HTTP 200 with a unified application/json envelope; External does not automatically add declaration. content is the modified Admin Console account profile object; other steps may still fail after saving.
| Field | Type | Description |
|---|---|---|
| content.id | integer or null | Admin Console account record sequence number; id=1 is the initial super administrator. The snapshot returned on creation may be null; use uuid for calls. |
| content.uuid | string | Admin Console account UUID, usually with the mact_ prefix. |
| content.status | integer | Account status: 0 enabled, 2 disabled, 3 deleted; List and Details exclude 3 but can still return 2. |
| content.creator | string | Creator identity; for External, usually sys. |
| content.updator | string | Last updater identity; may be empty if never updated. |
| content.createAt | integer | Creation Unix seconds. |
| content.deleteAt | number | Deletion Unix seconds; usually -1 if not deleted. |
| content.updateAt | number | Update Unix seconds; some modifications only update updator, so this value alone cannot determine whether the profile changed. |
| content.name | string | Display nickname. |
| content.username | string | Admin Console login name. |
| content.email | string | Email; may be empty if not configured. |
| content.mobile | string | Admin Console account mobile number displayed after decryption; empty if not set; there is no separate countryCode field. |
| content.role | string | Admin Console role identifier; defined values are admin/dev; dev is rejected in the standard Admin Console account password login flow and cannot be treated as a regular read-only role. |
| content.resetPasswordAt | integer or null | Most recent password reset Unix seconds; the creation snapshot may be null, and the persisted initial value is usually -1, which triggers the standard Admin Console first-reset prompt. |
| content.mfaSecret | string | Internal MFA binding field that the current implementation may return; it is not for business integration use. Do not construct authentication based on it, and actual values should not be logged or disclosed. An empty example does not mean all existing accounts are empty. |
{
"code": 200,
"content": {
"id": 1001,
"uuid": "mact_example001",
"status": 0,
"creator": "sys",
"updator": "sys",
"createAt": 1785427200,
"deleteAt": -1,
"updateAt": -1,
"name": "Example Admin New Nickname",
"username": "api-doc-admin",
"email": "xxx@guance.com",
"mobile": "",
"role": "admin",
"resetPasswordAt": -1,
"mfaSecret": ""
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
This table only guarantees business errors reachable by the current External SYS branch; self-protection errors of real regular Admin Console accounts are not directly copied. Ordinary 5xx errors from databases/caches, etc. are globally unified as ft.InternalServerError, and failures may occur only after the status or profile has already been saved.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling Method |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field missing, or field value violates the declared validation condition | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Invalid JSON syntax in the request | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | JSON top level is not an object | Some json file format error | Submit a JSON object as described in the table. |
| 400 | ft.InvalidPasswordRule | The non-empty new password provided during modification does not meet the current password strength rules | Invalid password rule | At least 8 characters, with at least three of the four categories: digits, uppercase letters, lowercase letters, and special characters. |
| 400 | ft.NameEamilExist | username is occupied by another non-deleted admin account | name/email already exists | Choose a unique login name; this branch actually checks username, not email uniqueness. |
| 406 | ft.PasswordRepeated | Password rotation policy is enabled and the new password duplicates a password within the most recently configured number of passwords | The new password cannot be the same as any of the previous {} passwords | Choose a new strong password that has not been used; the number of comparisons is determined by the site security policy. |
| 401 | ft.AccountDisabled | Target account is disabled; cache refresh is rejected after the profile is submitted | Current user has been disabled | Query first to confirm the modification result, enable the account according to the authorization process before proceeding, and do not directly repeat the password change. |
| 401 | ft.AbnormalUserOrDelete | Account no longer exists/deleted during cache refresh after profile submission | Current user does not exist/or has been deleted | Recheck the account lifecycle status. |
| 500 | ft.InternalServerError | Database, cache, audit, or unhandled field exception; target does not exist/deleted, email is passed as null/non-string, or stored field length is abnormal | Internal error | Retain traceId and check the account's current profile and status; modification/deletion may have been saved before the failure. |