Skip to main content
Routes are the core building block of KnoxCall. Each route defines a target upstream API that KnoxCall proxies requests to, along with configuration for secrets injection, rate limiting, request signing, and more.
These endpoints manage route configuration. To actually call a route you’ve configured, use your tenant’s unique proxy URL (e.g., https://{hash}.{slug}.knoxcall.com/your-route).

List Routes

GET /v1/routes
Returns a paginated list of all routes in your tenant.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items per page (max 100)
sortstringcreated_atSort by: created_at, name, or enabled
orderstringdescSort direction: asc or desc
enabledbooleanFilter by enabled status

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Payment Gateway",
      "target_base_url": "https://api.stripe.com/v1",
      "base_environment": "production",
      "enabled": true,
      "requires_clients": false,
      "collection_id": null,
      "created_at": "2026-01-15T09:30:00.000Z",
      "environment_override_count": 2,
      "require_signature": false,
      "rate_limit_enabled": true,
      "rate_limit_requests": 100,
      "rate_limit_window_sec": 60,
      "allowed_methods": ["GET", "POST"]
    }
  ],
  "meta": {
    "total": 24,
    "page": 1,
    "per_page": 20,
    "total_pages": 2,
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}
curl "https://api.knoxcall.com/v1/routes?page=1&per_page=20" \
  -H "Authorization: Bearer tk_live_abc123..."

Get Route

GET /v1/routes/:id
Returns the full configuration for a single route, including injection rules, environment overrides, and payload structure.

Path Parameters

ParameterTypeDescription
iduuidThe route ID

Response

{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Payment Gateway",
    "target_base_url": "https://api.stripe.com/v1",
    "base_environment": "production",
    "enabled": true,
    "requires_clients": false,
    "methods": null,
    "mtls_certificate_id": null,
    "collection_id": null,
    "created_at": "2026-01-15T09:30:00.000Z",
    "environment_override_count": 2,
    "payload_structure": null,
    "injection_rules": null,
    "ip_allowlist": null,
    "data_plane_node_id": null,
    "configured_environments": ["production", "staging"]
  },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}

Errors

StatusTypeDescription
404not_foundRoute not found

Create Route

POST /v1/routes
Creates a new route in your tenant.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name for the route
target_base_urlstringYesThe upstream API base URL to proxy requests to
base_environmentstringNoDefault environment (defaults to production)
inject_headers_jsonobjectNoHeaders to inject into proxied requests
inject_body_jsonobjectNoBody fields to inject into proxied requests
injection_rulesobject[]NoAdvanced injection rules for secrets
ip_allowliststring[]NoIP addresses or CIDR ranges allowed to call this route
method_configsobjectNoPer-HTTP-method configuration overrides
collection_idstringNoAssign to a collection

Response

Returns the created route object (same shape as Get Route).
curl -X POST https://api.knoxcall.com/v1/routes \
  -H "Authorization: Bearer tk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Payment Gateway",
    "target_base_url": "https://api.stripe.com/v1"
  }'

Errors

StatusTypeDescription
400validation_errorMissing required fields or invalid environment
403plan_limitRoute limit reached for your subscription plan
409conflictA route with this name already exists

Update Route

PATCH /v1/routes/:id
Updates one or more fields on an existing route. Only include the fields you want to change.

Path Parameters

ParameterTypeDescription
iduuidThe route ID

Request Body

All fields are optional. Only provided fields will be updated.
FieldTypeDescription
namestringDisplay name
enabledbooleanEnable or disable the route
requires_clientsbooleanWhether requests must come from an authorized client
target_base_urlstringUpstream API base URL
inject_headers_jsonobjectHeaders to inject
inject_body_jsonobjectBody fields to inject
method_configsobjectPer-HTTP-method configuration
injection_rulesobject[]Advanced injection rules
require_signaturebooleanRequire request signature validation
signature_tolerance_secnumberSignature timestamp tolerance in seconds
rate_limit_enabledbooleanEnable rate limiting
rate_limit_requestsnumberMax requests per window
rate_limit_window_secnumberRate limit window in seconds
rate_limit_burstnumberBurst allowance
allowed_methodsstring[]Restrict to specific HTTP methods
http_method_restrictions_enabledbooleanEnable method restrictions
egress_server_idstringRoute through a specific egress/VPN server
ip_allowliststring[]Allowed IP addresses or CIDR ranges
data_plane_node_idstringAssign to a specific data plane node

Response

Returns the updated route object.

Errors

StatusTypeDescription
400validation_errorNo valid fields provided
404not_foundRoute not found

Delete Route

DELETE /v1/routes/:id
Permanently deletes a route and all of its environment overrides.

Path Parameters

ParameterTypeDescription
iduuidThe route ID

Response

{
  "data": { "deleted": true },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}

Errors

StatusTypeDescription
404not_foundRoute not found

Get Route Logs

GET /v1/routes/:id/logs
Returns paginated request logs for a specific route, showing every proxied request with status, latency, and geographic data.

Path Parameters

ParameterTypeDescription
iduuidThe route ID

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items per page (max 100)

Response

{
  "data": [
    {
      "id": "log-uuid",
      "request_id": "req_a1b2c3d4",
      "ts": "2026-03-10T14:22:01.000Z",
      "src_ip": "203.0.113.42",
      "method": "POST",
      "path": "/v1/charges",
      "status_code": 200,
      "latency_ms": 187,
      "upstream_host": "api.stripe.com",
      "error": null,
      "environment": "production",
      "rate_limited": false,
      "signature_valid": true,
      "source_ip_country": "US",
      "source_ip_city": "San Francisco"
    }
  ],
  "meta": {
    "total": 1482,
    "page": 1,
    "per_page": 20,
    "total_pages": 75,
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Errors

StatusTypeDescription
404not_foundRoute not found

List Route Environments

GET /v1/routes/:id/environments
Returns all environment-specific configuration overrides for a route.

Path Parameters

ParameterTypeDescription
iduuidThe route ID

Response

[
  {
    "environment_name": "staging",
    "target_base_url": "https://api-staging.stripe.com/v1",
    "inject_headers_json": {},
    "inject_body_json": {},
    "require_signature": false,
    "signature_tolerance_sec": null,
    "rate_limit_enabled": false,
    "rate_limit_requests": null,
    "rate_limit_window_sec": null,
    "rate_limit_burst": null,
    "allowed_methods": null
  }
]

Errors

StatusTypeDescription
404not_foundRoute not found

Set Route Environment Override

PUT /v1/routes/:id/environments/:env
Creates or replaces the environment-specific configuration for a route. This lets you point the same route at a different upstream URL, inject different headers, or apply different rate limits per environment.

Path Parameters

ParameterTypeDescription
iduuidThe route ID
envstringEnvironment name (e.g., staging, development)

Request Body

All fields are optional. Only provided fields will override the base route configuration for this environment.
FieldTypeDescription
target_base_urlstringOverride upstream URL
inject_headers_jsonobjectOverride injected headers
inject_body_jsonobjectOverride injected body fields
require_signaturebooleanOverride signature requirement
signature_tolerance_secnumberOverride signature tolerance
rate_limit_enabledbooleanOverride rate limiting
rate_limit_requestsnumberOverride max requests
rate_limit_window_secnumberOverride window duration
rate_limit_burstnumberOverride burst allowance
allowed_methodsstring[]Override allowed HTTP methods

Response

Returns the environment config object.

Errors

StatusTypeDescription
400validation_errorInvalid environment name
404not_foundRoute not found

Delete Route Environment Override

DELETE /v1/routes/:id/environments/:env
Removes the environment-specific override, reverting the route to its base configuration for that environment.

Path Parameters

ParameterTypeDescription
iduuidThe route ID
envstringEnvironment name

Response

{
  "deleted": true
}

Errors

StatusTypeDescription
404not_foundRoute or environment config not found