Skip to main content

Overview

Vouch uses API keys for authentication. Every request must include:
  1. Authorization header with your API key
  2. 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:
  • Origin header presence
  • Referer header presence
  • User-Agent indicating browser
If you try to use a server key in client-side code, you’ll immediately get a 401 error.

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 subdomain
  • localhost:3000 - Development domains
  • app://com.yourapp.example - Mobile apps (iOS/Android)

Mobile App Domains

The Vouch iOS and Android SDKs automatically send an Origin 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.
The SDK uses your app’s Bundle Identifier (e.g., com.example.myapp):
Add 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

Managing API Keys

Finding Your Keys

  1. Go to vouch.expert/dashboard
  2. Select your project
  3. Navigate to SettingsAPI Keys
  4. Copy the appropriate key for your environment

Regenerating Keys

If a key is compromised:
  1. Navigate to API Keys in your project settings
  2. Click Regenerate next to the compromised key
  3. Update your application with the new key
  4. Old key is immediately invalidated
Regenerating a key immediately invalidates the old key. Update your application before regenerating production keys.

Best Practices

Use environment variables instead:
For security, rotate API keys every 90 days:
  1. Generate new key
  2. Deploy with new key
  3. Verify everything works
  4. Delete old key
Never use server keys in client-side code:
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

HTTP Status: 401

Missing Project ID

HTTP Status: 400

Wrong Key Type

HTTP Status: 401

Domain Not Allowed

HTTP Status: 403

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