Skip to main content

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

FieldTypeRequiredDescription
credentialIdstringYesCredential ID to revoke

Response

Returns the revoked credential object.

FieldTypeDescription
credentialIdstringCredential identifier
userIdstringUser ID
venuestringExchange venue
namestringCredential name
statusstringCredential status (REVOKED)
revokedAtintegerRevocation 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 CodeErrorDescription
400Invalid requestMissing credential ID
401UnauthorizedInvalid or expired access token
403ForbiddenNot authorized to revoke this credential
404Not foundCredential not found
400Already revokedCredential 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