Overview
Vouch uses API keys for authentication. Every request must include:- Authorization header with your API key
- X-Project-Id header with your project ID
API Key Types
Vouch provides two types of API keys, each with different use cases and security characteristics:Client Keys
For browser and mobile apps
- Restricted to allowed domains
- 1,000 requests/hour
- Safe to expose in client code
- Automatic device fingerprinting
- Cannot override IP/User-Agent
Server Keys
For backend services
- No domain restrictions
- 5,000 requests/hour
- Must be kept secret
- Can override IP/User-Agent
- Blocked from browsers
Security Features
Server Key Browser Protection
Server keys are automatically blocked when used from browsers to prevent accidental exposure. Detection happens via:Originheader presenceRefererheader presenceUser-Agentindicating browser
Client Key Domain Validation
Client keys are validated against your allowed domains list. Configure allowed domains in your dashboard: Allowed Domain Patterns:example.com- Exact match*.example.com- Wildcard subdomainlocalhost:3000- Development domainsapp://com.yourapp.example- Mobile apps (iOS/Android)
Mobile App Domains
The Vouch iOS and Android SDKs automatically send anOrigin header using your app’s bundle identifier / package name in the format app://your.bundle.id. You need to add this as an allowed domain in your dashboard.
- iOS
- Android
The SDK uses your app’s Add
Bundle Identifier (e.g., com.example.myapp):app://com.example.myapp to your allowed domains.You can find your bundle identifier in Xcode (iOS) or your
build.gradle file (Android).Authentication Examples
- JavaScript (Client)
- Node.js (Server)
- cURL
- Python
Managing API Keys
Finding Your Keys
- Go to vouch.expert/dashboard
- Select your project
- Navigate to Settings → API Keys
- Copy the appropriate key for your environment
Regenerating Keys
If a key is compromised:- Navigate to API Keys in your project settings
- Click Regenerate next to the compromised key
- Update your application with the new key
- Old key is immediately invalidated
Best Practices
Never commit API keys to version control
Never commit API keys to version control
Use environment variables instead:
Rotate keys periodically
Rotate keys periodically
For security, rotate API keys every 90 days:
- Generate new key
- Deploy with new key
- Verify everything works
- Delete old key
Use client keys in browsers
Use client keys in browsers
Never use server keys in client-side code:
Restrict client key domains
Restrict client key domains
Configure allowed domains to prevent unauthorized use:
- Add
localhost:*for development - Add your production domains
- Use wildcards carefully (
*.example.com)
Error Responses
Invalid API Key
Missing Project ID
Wrong Key Type
Domain Not Allowed
Next Steps
Client vs Server Keys
Deep dive into key type differences
API Reference
Explore the validation endpoint
Error Handling
Handle authentication errors
Dashboard
Manage your API keys