Skip to main content

Create Credential

Create a new trading account credential.

Endpoint

POST /api/v3/credential/create

Description

Creates new API credentials for a trading account. This allows you to store exchange API keys securely for automated trading.

Authentication

Requires Bearer token authentication.

Authorization: Bearer {access_token}

Request Body

FieldTypeRequiredDescription
venuestringYesExchange venue (e.g., BINANCE)
apiKeystringYesExchange API key
apiSecretstringYesExchange API secret
apiPassphrasestringNoAPI passphrase (required for some exchanges)
namestringNoCustom name for the credential
typestringNoCredential type (default: EXCHANGE)

Response

Returns the created credential object. Note: The API secret is not returned for security.

FieldTypeDescription
credentialIdstringUnique credential identifier
userIdstringUser ID
venuestringExchange venue
namestringCredential name
typestringCredential type
apiKeystringAPI key (masked)
statusstringCredential status (ACTIVE)
createdAtintegerCreation timestamp (milliseconds)

Usage

import requests

headers = {"Authorization": f"Bearer {access_token}"}

response = requests.post(
"https://cadenza-api-uat.algo724.com/api/v3/credential/create",
headers=headers,
json={
"venue": "BINANCE",
"apiKey": "your-api-key",
"apiSecret": "your-api-secret",
"name": "My Binance API Key"
}
)

credential = response.json()["data"]
print(f"Credential ID: {credential['credentialId']}")
curl -X POST https://cadenza-api-uat.algo724.com/api/v3/credential/create \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"venue": "BINANCE",
"apiKey": "your-api-key",
"apiSecret": "your-api-secret",
"name": "My API Key"
}'

Example Response

{
"data": {
"credentialId": "660e8400-e29b-41d4-a716-446655440000",
"userId": "user-uuid-here",
"venue": "BINANCE",
"name": "My Binance API Key",
"type": "EXCHANGE",
"apiKey": "your-api-***",
"status": "ACTIVE",
"createdAt": 1703052635110,
"updatedAt": 1703052635110
},
"success": true,
"errno": 0,
"error": null
}

Error Responses

HTTP CodeErrorDescription
400Invalid requestMissing or invalid parameters
400Invalid credentialsAPI credentials failed validation
401UnauthorizedInvalid or expired access token

Notes

  • API secrets are encrypted and stored securely
  • API secrets are never returned in API responses
  • Credentials are validated against the exchange before being stored
  • Use credential.revoke to invalidate credentials