Skip to content

Enable or Disable Users

API Overview

Use this API to enable or disable a specified user.

API URL

POST Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/user/updateuserBanStatus

To obtain anymetrics_host:anymetrics_port, see Calling APIs.

Request parameters

Common Request Headers

parameter Type required Max Length Description
tenant-id String Yes 32 Tenant ID, used to identify the tenant for metric query content.
auth-type String Yes 32 Authentication method. Supports UID, TOKEN, ACCOUNT, and APIKEY.
auth-value String Yes 32 Authentication value corresponding to auth-type.

Request parameters

parameter Type required Max Length Description Example Value
userId String Yes user ID 463663891121963008
ban Boolean Yes Enable or disable the user true

Response parameters

parameter Type required Max Length Description Example Value
code String Yes 32 API response code 200
succeess boolean Yes Whether successful true
errorMsg String Yes 512 Error message NULL
detailErrorMsg String Yes 512 Detailed error message for request failure NULL
traceId String Yes 128 traceId fdde343f9ff2dcd70.292.16857691758642861
data String Yes 32 Returned userId 478209624953061376

Request Example

curl --location --request POST 'https://127.0.0.1:8083/anymetrics/api/v1/user/updateuserBanStatus' \
--header 'auth-type: UID' \
--header 'tenant-id: tn_19487697' \
--header 'auth-value: 463663891121963008' \
--header 'Accept-Language: zh-CN' \
--data-raw '{
     "userId":"463707832823316480",
     "ban":false
}'

Response Example

{
    "data": true,
    "success": true,
    "code": "200",
    "errorMsg": null,
    "detailErrorMsg": null,
    "traceId": "c397f866392e4a9e885c8a6c4f39fdb5.181.17466755543990979"
}