Method-Specific Route Configuration
Configure different headers, body templates, and security settings for each HTTP method on a single route.What are Method Configs?
Method configs let you customize route behavior per HTTP method. For example:- GET requests: Inject read-only API key
- POST requests: Inject write API key + additional auth
- DELETE requests: Require admin API key + signature
Why Use Method Configs?
Use Case 1: Different API Keys Per Method
Your API uses different keys for read vs write operations:Use Case 2: Method-Specific Headers
Use Case 3: Different Secrets Per Method
Use Case 4: Security Levels
How It Works
Fallback System
- GET requests → Uses read_key (global)
- POST requests → Uses write_key (method config)
- PUT requests → Uses read_key (global, no method config)
Create Method Config
Step 1: Edit Your Route
- Navigate to Routes
- Click your route
- Click Edit
Step 2: Scroll to Method Configs
Find the Method-Specific Configuration sectionStep 3: Add Method Config
Click Add Method Config Select HTTP Method:- Rate limit
- Require signature
- Allowed origins
Step 4: Save
Click Save Changes Now POST requests use different configuration!Example: Read vs Write Keys
Scenario
You have a REST API with:- Read operations: GET (low risk)
- Write operations: POST, PUT, DELETE (high risk)
Setup
Create secrets:api_read_key→ sk_read_abc123api_write_key→ sk_write_xyz789
Result
Example: Idempotency for POST
Scenario
Your API requires idempotency keys for POST requests to prevent duplicate processing.Setup
POST method config only:Usage
Client includes idempotency key in query param:idempotency_key from query and injects as header:
Example: Signature Only for Mutations
Scenario
You want to require HMAC signatures for POST/PUT/DELETE but not GET (performance).Setup
Global route config:Result
Advanced: Method-Specific Rate Limits
Scenario
Allow many GET requests (reads) but limit POST requests (writes).Setup
Global route:Result
- GET: 1000/min allowed
- POST: 100/min allowed
- Other methods: 1000/min (global)
Variables Available in Templates
Query Parameters: {{vars.param_name}}
Secrets: {{secret:name}}
Environment Variables
Can reference in templates for dynamic values.Viewing Method Configs
In Route Details
- Navigate to Routes
- Click your route
- See Method Configs section
- Shows all configured methods with icons:
- 🟢 GET
- 🔵 POST
- 🟡 PUT
- 🔴 DELETE
- ⚫ PATCH
- 🟣 OPTIONS
- ⚪ HEAD
In Logs
Request logs show which config was used:Best Practices
1. Use Global as Default
Configure global headers/body for the most common case (usually GET). Method configs only for exceptions.2. Principle of Least Privilege
3. Document Your Method Configs
Use route description to note:4. Test Each Method
Don’t assume method configs work without testing:5. Monitor Per-Method Metrics
In Analytics, filter by HTTP method:- GET success rate
- POST latency
- DELETE error rate
Common Patterns
REST API Standard
Webhook Receiver
File Upload API
Troubleshooting
Method Config Not Applied
Symptoms: Request uses global config instead of method config Check:- Method name matches exactly (case-sensitive:
POSTnotpost) - Method config is saved
- Route is enabled
- Check logs to see which config was used
Wrong Headers Injected
Debug:- Check request logs
- See “Config Used” field
- Verify method config has correct headers
- Check for typos in secret names
Variables Not Replaced
Symptoms: Backend receives literal{{vars.param}}
Causes:
- Query parameter name doesn’t match
- Typo in template:
{{vars.paramter}}instead of{{vars.parameter}} - Query parameter not provided in request
- Check query parameter name in request
- Match exactly in template
- Verify in logs
Related Concepts
- Global Route Config: Default configuration used when no method override
- Secrets: Encrypted credentials injected via
{{secret:name}} - Variables: Query parameters accessible via
{{vars.name}} - Rate Limiting: Can be different per method
- Request Signing: Can be required only for certain methods
Next Steps
Secret Injection
Use secrets in method configs
Rate Limiting
Different limits per method
Request Signing
Require signatures for mutations
Testing Routes
Test each method configuration
📊 Statistics
- Level: intermediate
- Time: 10 minutes
🏷️ Tags
routing, configuration, http-methods, rest-api