Overview
The Voyant API uses API keys for authentication. Each API key is scoped to a specific workspace and automatically filters all data access to that workspace context.API key format
API keys are workspace-scoped credentials that look like this:- Workspace ID: Automatically determined from the key
- Scopes: Optional permissions limiting API access
- Rate limits: Per-workspace request limits
- Status: Active or revoked
Authentication methods
Authorization header (recommended)
Pass your API key using theAuthorization: Bearer <token> header with every request:
Internal API authentication
For internal services, you can use an internal API key with explicit workspace specification:Internal API keys are only available to Voyant system services and are not accessible to
customers.
Managing API keys
Creating an API key
Generate new key
Click Generate New Key and provide a descriptive name (e.g., “Production API”, “Staging
Environment”).
Rotating API keys
For security best practices, rotate your API keys periodically:Revoking API keys
Immediately revoke an API key if:- It has been exposed publicly
- An employee with access has left
- You’re migrating to a new key
- You suspect unauthorized access
Propagation
Key changes take effect quickly across our platform. In most cases they are active immediately; allow up to about a minute for caches to refresh in edge locations.- Revocations stop new requests right away; rotate keys during low-traffic windows to avoid client cache hiccups.
- Scoped keys enforce minimum permissions and support wildcards (
products:*,*:read,*). - For best results, update your applications first, verify, then revoke old keys.
Security best practices
Environment variables
Always store API keys in environment variables, never in code:- Node.js
- Python
- PHP
Server-side only
API keys should only be used from secure server environments:- ✅ Backend servers (Node.js, Python, PHP, Ruby, Go, etc.)
- ✅ Serverless functions (AWS Lambda, Cloudflare Workers, Vercel Functions)
- ✅ Internal services and microservices
- ❌ Frontend JavaScript (React, Vue, Angular)
- ❌ Mobile applications (iOS, Android)
- ❌ Desktop applications with embedded keys
HTTPS only
Always use HTTPS when making API requests to protect your API key in transit:Minimal permissions
When creating API keys, grant only the minimum required permissions:- Use scoped keys for specific operations when available
- Use sandbox workspaces for development and testing
- Create separate keys for each workspace
Monitor key usage
Regularly review API key usage in your workspace settings:- Check access logs for unusual patterns
- Monitor rate limit consumption
- Review which keys are actively used
- Revoke unused keys
Workspace context
All API operations are automatically scoped to the workspace associated with your API key:You never need to specify a workspace ID in API requests. The workspace context is automatically
determined from your API key.
Multi-workspace access
If you need to access multiple workspaces, you must:- Generate a separate API key for each workspace
- Use the appropriate key for each request
- Manage keys separately in your application
Rate limiting
Rate limits depend on your workspace type: Live workspaces:- 3,000 requests per minute
- 30 requests per second burst
- 100 requests per minute
- 5 requests per second burst
Error responses
Authentication errors return specific status codes:Testing authentication
Verify your API key works correctly:A successful response with
200 OK confirms your API key is valid and working.Troubleshooting
Common authentication issues
401 Unauthorized - Invalid API key
401 Unauthorized - Invalid API key
429 Rate limit exceeded
429 Rate limit exceeded
- Implement request throttling in your application - Use exponential backoff for retries - Contact support for higher rate limits if needed - Cache responses when appropriate
Key rotation not working
Key rotation not working
- Ensure new key is active before revoking old one
- Check all services are using the new key
- Verify environment variables are updated
- Allow DNS/CDN cache to clear (up to 5 minutes)