Authentication
All API requests require authentication using an API key.
API Keys
You’ll find your API keys in the dashboard.
| Key Type | Prefix | Use Case |
|---|---|---|
| Sandbox | sk_sandbox_ | Development & testing |
| Live | sk_live_ | Production |
Using Your API Key
Include your API key in the Authorization header:
curl https://eu.spaceinvoices.com/entities \
-H "Authorization: Bearer YOUR_API_KEY"Or with the SDK:
import SpaceInvoices from "@spaceinvoices/js-sdk";
const sdk = new SpaceInvoices("YOUR_API_KEY");Environment Separation
Sandbox and live environments are completely separate:
- Different API keys
- Different data
- No cross-contamination
// Development
const sdk = new SpaceInvoices(process.env.SI_SANDBOX_KEY);
// Production
const sdk = new SpaceInvoices(process.env.SI_LIVE_KEY);Key Rotation
To rotate your API key:
- Generate a new key in the dashboard
- Update your application to use the new key
- Revoke the old key once confirmed working
Rate Limits
| Environment | Requests/minute |
|---|---|
| Sandbox | 60 |
| Live | 600 |
When you exceed the rate limit, the API returns 429 Too Many Requests.
Security Best Practices
- Store keys securely — Use environment variables or a secrets manager
- Use different keys per environment — Never use production keys in development
- Rotate regularly — Rotate keys at least quarterly
- Monitor usage — Set up alerts for unusual API activity
- Restrict access — Only give team members the access they need