Delete Key

When a key is no longer needed, or if the key is compromised and needs to be revoked, it can be deleted through this interface. Once the key is deleted, it will become invalid immediately, and all API calls using that key will return authentication errors.

This interface requires authentication, for details please refer to Platform Token.

Interface Description

  • Request Method: DELETE
  • Request URL: https://platform.acedata.cloud/api/v1/credentials/{credential_id}/
  • Request Headers:
    • accept: application/json
    • authorization: Bearer {token}

Where {credential_id} is the UUID of the key.

CURL Request Example

curl -X DELETE \
  -H "accept: application/json" \
  -H "authorization: Bearer {token}" \
  "https://platform.acedata.cloud/api/v1/credentials/c1d2e3f4-a5b6-7890-cdef-1234567890ab/"

A successful deletion will return HTTP 204 No Content.

Notes

  • Deleting a key is an irreversible operation, and it cannot be restored once deleted.
  • If you need to replace a key without affecting the currently used services, it is recommended to create a new key first, and then delete the old key.
  • You may also consider using the "Rotate Key" feature, which will automatically generate a new key and revoke the old key.

Code Example

Python:

import requests

credential_id = "c1d2e3f4-a5b6-7890-cdef-1234567890ab"
url = f"https://platform.acedata.cloud/api/v1/credentials/{credential_id}/"
headers = {
    "accept": "application/json",
    "authorization": "Bearer {token}"
}

response = requests.delete(url, headers=headers)
if response.status_code == 204:
    print("The key has been successfully deleted")
else:
    print(f"Deletion failed: {response.status_code}")