API Keys
Create API key
Creates a new API key. The full key is returned once.
post/v1/api-keys
Headers
x-project-idstring
Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.
Example:prj_example
Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.
Request body
Example request
{
"name": "Primary Key",
"description": "Used by backend service.",
"role": "api_developer",
"permissions": [
"tokens:read",
"tokens:write"
],
"walletScope": "selected",
"allowedIps": [
"203.0.113.0/24"
],
"expiresAt": "2025-12-31T00:00:00.000Z",
"signingWalletId": "privy_wallet_123",
"signingWalletIds": [
"privy_wallet_123",
"dfns_wallet_456"
],
"walletLabel": "Mint authority wallet",
"walletPurpose": "mint_authority"
}Response
API key created
Example response
{
"data": {
"apiKey": {
"id": "key_example",
"name": "Primary Key",
"key": "sk_test_example",
"keyPrefix": "sk_test_abc",
"role": "api_developer",
"environment": "sandbox",
"expiresAt": "2025-12-31T00:00:00.000Z",
"createdAt": "2025-01-01T00:00:00.000Z"
}
},
"meta": {
"requestId": "req_example",
"timestamp": "2025-01-01T00:00:00.000Z"
}
}