Unbinding an Application Key
Function
This API is used to unbind an API key from a specified service. This API is applicable to the scenario where the permission of an API key to access a specified service needs to be revoked. Before calling this API, ensure that the API key to be unbound has been obtained and bound to the specified service. After the unbinding is successful, the API key does not take effect for the specified service, but can still be used for other services. If you attempt to unbind an API key that does not exist or is not bound to a specified service, an exception message is returned, prompting you to check the validity and binding status of the API key.
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, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
modelarts:apiKey:unbind
Write
apiKey *
-
-
-
service *
-
URI
POST /v2/{project_id}/services/{service_id}/api-keys/{key_id}/unbind
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details, see Obtaining a Project ID and Name. Constraints N/A Range Project ID. Default Value N/A |
| service_id | Yes | String | Definition Service ID, which can be obtained from the response body during service creation or by obtaining services owned by the current user. The service_id field is the service ID. Constraints N/A Range Service ID. Default Value N/A |
| key_id | Yes | String | Definition API key ID, which can be obtained from the response body when you create an API key or by querying the API keys. The key_id field in the response body is the API key ID. Constraints N/A Range The API key ID can only contain lowercase letters and digits. The length of the API key ID is 32 characters. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| key_id | String | Definition API key ID, which can be obtained from the response body when you create an API key or by obtaining API keys. The id field in the response body is the API key ID. Range The value is in UUID format. |
| name | String | Definition Name of the API key, which you can edit when creating the API key. Range The value can contain 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
| description | String | Definition Description of the API key, which you can edit when creating the API key. Range The value can contain 1 to 256 characters, including letters, digits, hyphens (-), and underscores (_). |
| create_time | String | Definition Time when the API key is created, which is automatically generated based on the creation time. Range Millisecond-level timestamp, which is a 13-digit number, for example, 1609459200000. |
| scope | String | Definition Scope of the API key. Range |
| domain_id | String | Definition Domain ID. For details about how to obtain the value, see Obtaining the Account Name and Account ID. Range Account ID |
| project_id | String | Definition Project ID. For details, see Obtaining a Project ID and Name. Range Project ID of the account. |
| services | Array of ServiceIdName objects | Definition List of real-time services bound to the API key. |
| workspace_id | String | Definition Workspace ID. Range Workspace ID. |
Example Requests
Unbind an API key.
POST https://{endpoint}/v2/{project_id}/services/{service_id}/api-keys/{key_id}/unbind Example Responses
Status code: 200
API key information.
{
"create_time" : 1743228962325,
"description" : "test",
"domain_id" : "04f258c83e00d5a50f3****example",
"key_id" : "8a0e4a2d95e088ea0195****example",
"name" : "test_3123",
"project_id" : "04f258c84780d5a52****example",
"scope" : "SERVICE",
"services" : [ ],
"workspace_id" : "0"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | API key information. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot