Revoke Credential
Revoke a trading account credential.
Endpoint
POST /api/v3/credential/revoke
Description
Revokes an existing API credential. Once revoked, the credential cannot be used for trading and cannot be reactivated.
Authentication
Requires Bearer token authentication.
Authorization: Bearer {access_token}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
credentialId | string | Yes | Credential ID to revoke |
Response
Returns the revoked credential object.
| Field | Type | Description |
|---|---|---|
credentialId | string | Credential identifier |
userId | string | User ID |
venue | string | Exchange venue |
name | string | Credential name |
status | string | Credential status (REVOKED) |
revokedAt | integer | Revocation timestamp (milliseconds) |
Usage
import requests
headers = {"Authorization": f"Bearer {access_token}"}
response = requests.post(
"https://cadenza-api-uat.algo724.com/api/v3/credential/revoke",
headers=headers,
json={
"credentialId": "660e8400-e29b-41d4-a716-446655440000"
}
)
credential = response.json()["data"]
print(f"Revoked: {credential['credentialId']} - {credential['status']}")
curl -X POST https://cadenza-api-uat.algo724.com/api/v3/credential/revoke \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{"credentialId": "660e8400-e29b-41d4-a716-446655440000"}'
Example Response
{
"data": {
"credentialId": "660e8400-e29b-41d4-a716-446655440000",
"userId": "user-uuid-here",
"venue": "BINANCE",
"name": "My Binance API Key",
"type": "EXCHANGE",
"status": "REVOKED",
"createdAt": 1703052635110,
"updatedAt": 1703052700000,
"revokedAt": 1703052700000
},
"success": true,
"errno": 0,
"error": null
}
Error Responses
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Missing credential ID |
| 401 | Unauthorized | Invalid or expired access token |
| 403 | Forbidden | Not authorized to revoke this credential |
| 404 | Not found | Credential not found |
| 400 | Already revoked | Credential is already revoked |
Example Error
{
"data": null,
"success": false,
"errno": -130001,
"error": "Credential is already revoked"
}
Notes
- Revoking a credential is permanent and cannot be undone
- Trading accounts using this credential will no longer function
- Create a new credential if you need to reconnect
- It's recommended to also revoke the API key on the exchange itself