Deleting an Application Key
Function
This API is used to delete a specified API key. It is applicable to the scenario where the administrator needs to revoke the permission to access an application or a user. Before calling this API, ensure that the API key to be deleted has been obtained and is not used in other services. After the API key is deleted, it cannot be used to access any related services. If you attempt to delete an API key that does not exist or has been deleted, an error message is displayed, prompting you to check the validity 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:delete
Write
apiKey *
-
-
-
URI
DELETE /v2/{project_id}/services/api-keys/{key_id}
| 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 |
| 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
Delete an application key.
DELETE https://{endpoint}/v2/{project_id}/services/api-keys/{key_id} Example Responses
Status code: 200
API key information.
{
"create_time" : 1743494875405,
"description" : "test",
"domain_id" : "04f258c83e00d5****example",
"key_id" : "8a0e847095f063aa0****example",
"name" : "api-keys-name-test",
"project_id" : "04f258c84780d5****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