API Keys
Create, use, and manage API keys for server-to-server Recur API access.
API Keys Guide
API keys authenticate your server-to-server requests to the Recur API. They let your backend create plans, query subscriptions, and manage webhooks without requiring wallet signatures on every request.
How API Key Auth Works
| Auth Method | Use Case | How |
|---|---|---|
| Wallet JWT | Frontend/dashboard access | Sign a nonce with your wallet → get a JWT |
| API Key | Server-to-server | Pass Authorization: Bearer sk_... header |
API keys are equivalent to full merchant access — they can perform any operation your wallet JWT can, except modifying the API keys themselves (you need wallet auth for that).
Creating an API Key
Via Dashboard (Recommended)
- Go to Dashboard → API Keys
- Click Create New Key
- Copy the key immediately — it's shown only once
- Store it in your environment variables
Via API (requires wallet JWT)
Response:
Warning: The full key (
sk_live_...) is only returned once at creation time. If you lose it, revoke it and create a new one.
Using API Keys
Pass your API key in the Authorization header as a Bearer token:
In the SDK
In Node.js (raw fetch)
Scopes and Permissions
API keys currently grant full merchant access:
| Operation | Supported |
|---|---|
| List/create/update apps | Yes |
| List/create plans | Yes |
| List subscriptions | Yes |
| List transactions | Yes |
| Create/delete webhook endpoints | Yes |
| Export CSV data | Yes (Pro tier) |
| View analytics | Yes |
| Modify merchant profile | Yes |
| Manage API keys | No (requires wallet JWT) |
Note: Fine-grained scopes (read-only, per-app, etc.) are planned for a future release.
Revoking Keys
If a key is compromised, revoke it immediately:
Via Dashboard
- Go to Dashboard → API Keys
- Click Revoke next to the key
- Confirm — the key stops working instantly
Via API
Revocation is instant and permanent. Any server using the revoked key will get
401 Unauthorizedon the next request.
Security Best Practices
Storage
Do:
- Store in environment variables or a secrets manager (AWS Secrets Manager, Vault, etc.)
- Use different keys for development and production
- Rotate keys periodically (quarterly recommended)
Don't:
- Commit keys to source control
- Log keys in application output
- Share keys via chat/email (use a secrets manager)
- Use production keys in development
Key Rotation
To rotate a key without downtime:
- Create a new API key
- Update your server's environment variable to the new key
- Deploy the update
- Verify the new key works
- Revoke the old key
Client-Side Safety
Never expose API keys in client-side code. API keys are for server-to-server communication only.
If you need client-side access, use the wallet JWT flow (nonce → sign → verify → JWT) instead of API keys.
Identifying Keys
API keys have a recognizable prefix format:
| Prefix | Environment |
|---|---|
sk_live_ | Production |
sk_test_ | Development/devnet |
The dashboard shows the first few characters (prefix) so you can identify which key is which without exposing the full value.
Rate Limits
| Tier | Rate Limit |
|---|---|
| Free | 100 requests/minute |
| Pro | 1,000 requests/minute |
Rate-limited responses return 429 Too Many Requests with a Retry-After header.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Invalid or revoked key | Check the key is correct and not revoked |
403 Forbidden | Key doesn't have access to this resource | Verify the key belongs to the correct merchant |
429 Too Many Requests | Rate limit exceeded | Back off and retry after the Retry-After period |
Next Steps
- Backend Integration — use your API key in a complete server integration
- Webhooks — set up event notifications
- SDK Quickstart — initialize the client with your key