Skip to main content
RebelFi uses API key authentication for all programmatic API access.

API Key Authentication

Generating API Keys

There are two types of API keys:

Profile-Scoped Keys

Profile-scoped keys can only register wallets and execute operations within their linked Wallet Profile. You must create a Wallet Profile before generating a profile-scoped key.
  1. Navigate to Settings → Wallet Profiles and create a profile (or use an existing one)
  2. Navigate to Settings → API Keys
  3. Click Generate API Key
  4. Provide a descriptive name (e.g., “Production SDK”, “Dev Environment”)
  5. Select the Wallet Profile to associate with this key
  6. Under Allowed addresses, enter your servers’ addresses (recommended) or choose Any address
  7. Choose when the key expires
  8. Copy and securely store the key (shown only once)

Admin Keys

Admin keys provide read-only access across all Wallet Profiles in your organization. They cannot register wallets, plan operations, or submit transactions. Use admin keys for internal tools that need aggregate metrics across all partners.
  1. Navigate to Settings → API Keys
  2. Click Generate API Key
  3. Provide a descriptive name (e.g., “Internal Dashboard”)
  4. Select Admin (read-only, all profiles)
  5. Copy and securely store the key (shown only once)
Admin keys and walletProfileId are mutually exclusive — you cannot create an admin key scoped to a specific profile.

Managing Keys With a Dashboard Session

Creating, changing, and deleting keys are sensitive actions. When you call these routes with a dashboard session token instead of the dashboard, the session must have confirmed a code in the last 10 minutes. Otherwise the route answers 403 with the code STEP_UP_REQUIRED, and details.methods says which code to use: ["totp"] if you have two-factor authentication, otherwise ["email"].
1

Get a code (email only)

Skip this step if you use an authenticator app. Otherwise, ask RebelFi to email you an 8-character code, valid for 10 minutes:
2

Confirm the code

Send the code from your authenticator app ("method": "totp") or from the email ("method": "email"):
3

Call the key route

For the next 10 minutes, that session can create, change, and delete keys.
Five wrong codes end the session. Sign in again to get a new one. API keys never need this step, and can’t create or change other keys.

The Key Is Shown Once

The create response is the only place the secret appears, in its key field:
RebelFi stores only a SHA-256 fingerprint of the key, so neither the dashboard nor the API can show it again. If you lose a key, delete it and create a new one. Listing keys (GET /api/core/apikeys) returns each key’s keyPrefix (the environment prefix plus the first 6 characters, such as rfk_prod_3fa9c1) to tell keys apart, never the key itself. Each entry also shows who created it (createdByEmail), when it was last used (lastUsedAt), and the address of that request (lastUsedAddress).
Keys marked createdBeforeHashing (shown in the dashboard as “Created before keys were hashed — rotate”) existed when RebelFi still stored keys in readable form, so older database backups contain them. Replace them: create a new key, deploy it, then delete the old one.
Organization admins get an email whenever a key is created, deleted, or has its allowed addresses or expiry changed.

Restricting a Key to Your Servers

We strongly recommend restricting each key to the addresses your servers call RebelFi from. A key with an allowlist is refused from any other address, so a leaked key is useless to anyone outside your network.
  • allowedNetworks takes IPv4 or IPv6 addresses and CIDR ranges, up to 20 entries, such as 203.0.113.10 or 198.51.100.0/24. A single address is stored as /32 (IPv4) or /128 (IPv6).
  • An empty list (the default when you leave it out) allows any address. The dashboard marks such keys No IP restriction.
  • A request from outside the allowlist is refused with 403 and the code API_KEY_ADDRESS_NOT_ALLOWED. The response names the address RebelFi saw in details.address, so you can add it. The key itself keeps working from its allowed addresses. It is not suspended.
In the dashboard, open a key’s Edit restrictions dialog to change its allowlist. It lists the addresses the key was recently used from, so you can add them in one click. Listing keys returns the same addresses in recentAddresses (up to 5, newest first). To change a key’s allowlist or expiry through the API, send both fields. They replace the current values. Like creating a key, this needs a recent code on the session:
If your servers’ outbound addresses change often and you can’t list them, leave the allowlist empty. RebelFi then watches the addresses each key is used from and suspends a key used for a sensitive action (such as registering a wallet) from an address it hasn’t seen before.

Key Expiry

A key can expire. Set expiresAt (ISO-8601) when you create the key or later, or pick 30 days, 90 days, or 1 year in the dashboard. Leave it out, or send null, for a key that never expires.
  • Organization admins get an email 7 days before a key expires.
  • From its expiry on, a key is refused with 403 and the code API_KEY_EXPIRED. Create a new key and deploy it before then.

API Key Format

RebelFi API keys follow this format:
Examples:
  • rfk_sandbox_xxxxxxxxxxx - Development key
  • rfk_prod_xxxxxxxxxxx - Production key

Using API Keys

Include the API key in the x-api-key header:

SDK Authentication

When using the TypeScript SDK:
Profile-scoped API keys can only operate on wallets registered within that profile. Admin keys are read-only across all profiles. Store all keys securely and rotate them regularly. Create separate keys for different environments (dev, staging, production).

Security Best Practices

API Key Management

DO:
  • Store in environment variables
  • Use secrets management (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault)
  • Encrypt at rest
DON’T:
  • Commit to version control
  • Store in code or configuration files
  • Share via email or chat
  • Log in plain text
Rotate API keys regularly:
  1. Generate new API key
  2. Deploy new key to production (blue/green deployment)
  3. Verify new key works
  4. Revoke old key
  5. Update documentation
Recommended frequency: Every 90 days
Use different API keys for each environment:
  • Development: rfk_sandbox_xxx
  • Staging: rfk_prod_xxx (non-dev environments use production prefix)
  • Production: rfk_prod_xxx
This limits blast radius if a key is compromised.

Rate Limiting

Requests are budgeted per API key, per minute, plus a ceiling for the whole organization:

Handling Rate Limits

When rate limited, you’ll receive a 429 status with RATE_LIMIT_EXCEEDED error code.

Troubleshooting

Cause: Invalid or missing API keySolution:
  • Verify API key is correct
  • Ensure proper header format (x-api-key: ...)
  • Check key hasn’t been revoked
  • Try generating a new API key
Cause: Valid credentials but access deniedSolution:
  • API_KEY_ADDRESS_NOT_ALLOWED: the request came from an address outside the key’s allowlist. Add details.address to the key’s allowed addresses, or send the request from an allowed server
  • API_KEY_EXPIRED: the key passed its expiry. Create a new key
  • Verify the Wallet Profile linked to this API key is enabled (not disabled or deleted)
  • Verify the wallet you are accessing belongs to the key’s Wallet Profile
  • Check that the blockchain you are targeting is enabled in the Wallet Profile’s enabledChains configuration
Cause: Too many requests in time windowSolution:
  • Implement exponential backoff
  • Reduce request frequency
  • Contact support for higher limits if needed

Next Steps

Wallet Profiles

Set up wallet profiles and link your API key

API Reference

Explore authenticated API endpoints