Skip to main content
POST
/
v1
/
api_keys
Create API Key
curl --request POST \
  --url https://api.ondoperps.xyz/v1/api_keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Trading Bot",
  "scopes": [
    "trade",
    "transfer"
  ]
}
'
{
  "success": true,
  "result": {
    "keyId": "ondoKeyId_abc123",
    "name": "Trading Bot",
    "createdAt": "2025-01-01T00:00:00Z",
    "scopes": [
      "trade",
      "transfer"
    ],
    "secretKey": "ondoApiSecret_abc123def456ghi789..."
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Human-readable name for the API key

Example:

"Trading Bot"

scopes
enum<string>[]
required

Permission scopes for the API key

API key permission scope

Available options:
trade,
transfer
Example:
["trade", "transfer"]

Response

Created API key (includes secret)

success
boolean
required

Whether the request was successful

Example:

true

error
string

Error message, present only on failure

Example:

""

error_code
string

Semantic error code. See each endpoint's error responses for the specific codes it can return.

deprecated
string

Deprecation notice, if applicable

Example:

""

result
object