Help Center/ ModelArts/ API Reference/ Workspace Management/ Updating the Authorization Mode
Updated on 2025-11-19 GMT+08:00

Updating the Authorization Mode

Function

This API is used to modify the authorization mode and permission configuration information of a specified resource or function. This API is used when system administrators can use this API to adjust the access permission of resources. Developers can use this API to update authorization policies to meet new service requirements. Security auditors can use this API to modify authorization configurations to comply with new security specifications. Before using this API, ensure that you have the update permission and the authorization mode of the target resource or function exists. After the API is called, the API updates the authorization mode of the target resource and returns the updated authorization mode information. If you do not have the permission to access this API or the authorization mode of the target resource does not exist, the API will return an error message.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

PUT /v1/auth-mode

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details, see Obtaining a User Token.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

mode

Yes

String

Definition: Update mode type.

Range

  • strict: strict mode

  • loose: non-strict mode

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

domain_id

String

Definition: Account domain ID.

Range: N/A

mode

String

Definition: Authorization mode.

Range

  • strict: strict mode

  • loose: non-strict mode

Example Requests

Update to strict mode.

POST https://{endpoint}/v1/auth-mode

{
  "mode" : "strict"
}

Example Responses

Status code: 200

Response body for querying the authorization mode.

{
  "domain_id" : "06024304b180d5090fbac00141b6cae0",
  "mode" : "strict"
}

Status Codes

Status Code

Description

200

Response body for querying the authorization mode.

Error Codes

See Error Codes.