Skip to main content
POST
/
api
/
auth
/
api-key
curl -X POST https://oro-tradebook-devnet.up.railway.app/api/auth/api-key \
  -H "Content-Type: application/json" \
  -d '{
    "challengeId": "abc123-def456",
    "signature": "base58EncodedSignature",
    "keyName": "My Trading Key"
  }'
{
  "success": true,
  "data": {
    "apiKey": "uuid-api-key-value",
    "id": "uuid-api-key-value",
    "scope": ["PARTNER_EXECUTIVE_AUTHORITY"],
    "name": "My Trading Key",
    "walletAddress": "YourSolanaWalletAddress",
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}

Overview

Creates a new API key after you’ve signed the challenge message from the /api/auth/challenge endpoint. Important: The API key is only shown once at creation time. Store it securely.

Request Body

challengeId
string
required
The challenge ID received from the challenge endpoint
signature
string
required
Base64-encoded signature of the challenge message
keyName
string
required
Human-readable name for the API key
expirationDays
number
Number of days until the key expires. If not provided, the key never expires.

Response

success
boolean
Whether the request was successful
data
object
curl -X POST https://oro-tradebook-devnet.up.railway.app/api/auth/api-key \
  -H "Content-Type: application/json" \
  -d '{
    "challengeId": "abc123-def456",
    "signature": "base58EncodedSignature",
    "keyName": "My Trading Key"
  }'
{
  "success": true,
  "data": {
    "apiKey": "uuid-api-key-value",
    "id": "uuid-api-key-value",
    "scope": ["PARTNER_EXECUTIVE_AUTHORITY"],
    "name": "My Trading Key",
    "walletAddress": "YourSolanaWalletAddress",
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}