Skip to main content

Common Route Patterns

Production-ready examples of common route configurations. Copy, adapt, and deploy.

Payment APIs

Stripe Payment Processing

Use case: Process payments securely without exposing Stripe API key Configuration:
Headers:
Environment overrides:
Client request:
Why this works:
  • Client never sees Stripe key
  • Environment-specific keys (test/live)
  • Full Stripe API access through proxy

PayPal Payments

Use case: PayPal checkout integration Configuration:
Headers:
OAuth2 Secret:
Auto-refresh: ✅ KnoxCall refreshes token automatically

Email Services

SendGrid Transactional Email

Use case: Send emails without exposing SendGrid API key Configuration:
Headers:
Body template:
Client request:
Dynamic placeholders in body and header templates use the {{var:NAME}} form, where NAME is read from the request’s query-string parameters. Pass these values as query params (as shown above), not in the request body.

Mailgun Email

Use case: Alternative email service Configuration:
Headers:
Note: Mailgun uses Basic auth (base64 encode api:YOUR_KEY)

SMS/Communication

Twilio SMS

Use case: Send SMS messages Configuration:
Headers:
Secret format:
Client request:

Webhooks

Receiving Stripe Webhooks

Use case: Receive webhook events from Stripe Configuration:
Headers:
There is no {{client_ip}} template helper. The proxy strips reverse-proxy headers such as X-Forwarded-For from the request before forwarding it upstream, so the client IP is not passed through to your backend.
Clients:
Signature validation:
Stripe configures webhook:

Receiving Shopify Webhooks

Use case: E-commerce webhook notifications Configuration:
Headers:
There is no {{header:...}} template helper. Incoming request headers that aren’t KnoxCall- or proxy-specific (such as X-Shopify-Hmac-SHA256, X-Shopify-Topic, and X-Shopify-Shop-Domain) are forwarded to your upstream automatically — you don’t need to re-declare them here.
Clients:

Sending Webhooks to Partners

Use case: Notify partner systems of events Configuration:
Headers:
Body:
KnoxCall does not generate timestamps or HMAC signatures for you. Compute these values on the client and pass them as query-string parameters (?timestamp=...&hmac_signature=...); the {{var:NAME}} placeholders read directly from the request query string.

Database / Data APIs

PostgreSQL REST API

Use case: Query database through HTTP API Configuration:
Headers:
Example queries:

GraphQL API

Use case: GraphQL backend proxy Configuration:
Headers:
Client query:

Cloud Storage

AWS S3 Signed URLs

Use case: Generate pre-signed URLs for S3 uploads Configuration:
Headers:
Your backend:
  • Generates signed URL using AWS credentials
  • Returns URL to client
  • Client uploads directly to S3

Google Cloud Storage

Use case: Upload files to Google Cloud Configuration:
Headers:
OAuth2 Secret:

Printing Services

PrintNode Cloud Printing

Use case: Send print jobs to remote printers Configuration:
Headers:
Body:
Client request:

Authentication / OAuth

Auth0 Authentication

Use case: User authentication proxy Configuration:
Headers:
Body:

Google OAuth Token Exchange

Use case: Exchange authorization code for tokens Configuration:
Headers:
Body:

Microservices Architecture

Service-to-Service Communication

Use case: Multiple internal services Routes:
Shared configuration:
Benefits:
  • Centralized authentication
  • Unified logging
  • Rate limiting across services
  • Easy service discovery

Third-Party Integrations

HubSpot CRM

Use case: Sync customer data Configuration:
Headers:
OAuth2 Secret: Auto-refreshing HubSpot token

Salesforce API

Use case: CRM integration Configuration:
Headers:

Slack Webhooks

Use case: Send notifications to Slack Configuration:
Body:
No auth needed (webhook URL is the secret)

Testing & Development

Mock API for Development

Use case: Test against mock data Configuration:
Headers:
Clients:

Webhook Testing

Use case: Test webhooks with webhook.site Configuration:
Clients: Development team only

Multi-Environment Patterns

Pattern: Development → Staging → Production

Route: api-proxy Base (Production):
Override (Staging):
Override (Development):
Usage:

Security Patterns

API Key Rotation Without Downtime

Setup two routes:
Migration process:
  1. Create api-v2 with new key
  2. Update clients gradually to use api-v2
  3. Monitor api-v1 traffic
  4. When api-v1 traffic = 0, delete it
Zero downtime!

Multi-Layer Security

Route: sensitive-api Security layers:
  1. IP whitelist - Only production servers
  2. API key - KnoxCall authentication
  3. Request signing - HMAC signatures
  4. Rate limiting - 100 req/min
  5. Secret injection - Backend API key
Configuration:

Best Practices

✅ Do

  1. Use environment-specific secrets
  2. Document route purpose
  3. Start simple, add complexity
  4. Test in staging first
  5. Use descriptive names

❌ Don’t

  1. Don’t hardcode secrets
  2. Don’t use production keys in dev
  3. Don’t skip IP authorization for prod

Quick Reference


Next Steps

What are Routes?

Route basics and concepts

Creating Routes

Step-by-step route creation

Using Secrets

Secret injection in routes

Advanced Configuration

Advanced route features

Pro Tip: Copy these examples as starting points, then customize for your specific needs. Test in staging before deploying to production!