Help Center/ ModelArts/ API Reference/ Authorization Management/ One-Click Authorization or Authorization Reset
Updated on 2026-11-12 GMT+08:00

One-Click Authorization or Authorization Reset

Function

This API is used to create ModelArts agency authorization in one-click mode or reset an existing agency. It is used when you use ModelArts for the first time and need to enable agency authorization, or when the existing agency authorization is abnormal or expires and needs to be reconfigured. Before using this API, ensure that you have logged in to the system and have the operation permission. After one-click authorization, the system automatically creates an agency relationship. After the reset, the original agency is replaced with the new one. If you do not have the required permissions or the system is abnormal, an error message is returned.

Debugging

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

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.

URI

POST /v2/{project_id}/auth/grant

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: N/A

Range: N/A

Default Value: N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

is_reset

No

Boolean

Definition: Whether to reset the authorization.

Constraints: N/A

Range

  • true: Reset an existing agency (deleted and then created).

  • false: common authorization.

Default Value: false

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

service_name

String

Definition: Service name.

Range: N/A

status

Boolean

Definition: Authorization status. true indicates that the authorization has been granted, and false indicates that the authorization has not been granted.

Range

  • true: Authorized.

  • false: Not authorized.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

{
  "is_reset" : false
}

Example Responses

Status code: 200

{
  "service_name" : "ModelArts",
  "status" : true
}

Status Codes

Status Code

Description

200

The agency authorization is successful.

400

Error response

403

The agency already exists but cannot be queried. You need to manually delete it.

Error Codes

See Error Codes.