> ## Documentation Index
> Fetch the complete documentation index at: https://docs.knoxcall.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What are Routes?

> A quick introduction to routes - the foundation of API proxying in KnoxCall.

# What are Routes?

A **route** is a smart proxy that forwards API requests from your clients to your backend services. Think of it as a secure middleman that adds security, monitoring, and control.

## The Basic Concept

```text theme={"dark"}
Your Client → KnoxCall Route → Your Backend API
```

Instead of calling your backend directly, clients call KnoxCall. KnoxCall validates the request, applies security rules, injects secrets, logs everything, then forwards to your backend.

## Why Use Routes?

Routes solve common API problems:

✅ **Hide backend URLs** - Clients don't know your real backend URLs
✅ **Centralize credentials** - API keys stored securely, not in code
✅ **Monitor everything** - Log all requests and responses
✅ **Add security** - Rate limiting, IP whitelisting, signatures
✅ **Manage environments** - Different configs for dev/staging/prod

## How It Works

**Step 1: Client makes request**

```bash theme={"dark"}
curl https://YOUR-SUBDOMAIN.knoxcall.com/api/users \
  -H "x-knoxcall-route: my-route" \
  -H "x-knoxcall-key: YOUR_API_KEY"
```

**Step 2: KnoxCall processes**

* Validates API key or IP address
* Checks permissions
* Injects secrets (like API keys)
* Applies rate limits

**Step 3: Forwards to backend**

```http theme={"dark"}
GET https://your-backend.com/api/users
Authorization: Bearer SECRET_FROM_VAULT
```

**Step 4: Returns response**

* Logs request and response
* Triggers alerts if needed
* Returns to client

## Required Headers

Every request needs:

```bash theme={"dark"}
x-knoxcall-route: YOUR_ROUTE_NAME
```

And either:

```bash theme={"dark"}
x-knoxcall-key: YOUR_API_KEY    # API key auth
# OR
# Your IP whitelisted              # IP-based auth
```

## URL Structure

```text theme={"dark"}
https://YOUR-SUBDOMAIN.knoxcall.com/your/api/path
        ^^^^^^^^^^^^^^
        tenant slug
```

* **Subdomain**: Your tenant slug — identifies your tenant (shown in dashboard)
* **Path**: Passed through to backend unchanged

## Common Use Cases

### Webhook Forwarding

```text theme={"dark"}
Stripe Webhook → KnoxCall → Your Server
- Log every webhook
- Verify signatures
- Retry on failure
```

### API Proxy

```text theme={"dark"}
Mobile App → KnoxCall → Backend API
- Hide backend URL
- Manage API keys securely
- Monitor usage
```

### Microservices

```text theme={"dark"}
Frontend → KnoxCall → {
  /users → User Service
  /orders → Order Service
  /payments → Payment Service
}
```

## Quick Example

**1. Create a route:**

* Name: `my-api`
* Target: `https://api.example.com`

**2. Make a request:**

```bash theme={"dark"}
curl https://acme.knoxcall.com/users \
  -H "x-knoxcall-route: my-api" \
  -H "x-knoxcall-key: tk_abc123..."
```

**3. KnoxCall forwards to:**

```text theme={"dark"}
https://api.example.com/users
```

That's it! Your route is working.

## What's Next?

<CardGroup cols={2}>
  <Card title="Create Your First Route" icon="plus" href="/getting-started/first-route">
    Step-by-step guide to create a route
  </Card>

  <Card title="Route Configuration" icon="sliders" href="/advanced/advanced-route-configuration">
    Configure headers, secrets, and more
  </Card>

  <Card title="Testing Routes" icon="flask" href="/essentials/routes/testing-routes">
    Test your routes with curl
  </Card>

  <Card title="Advanced Features" icon="wand-magic-sparkles" href="/advanced/advanced-route-configuration">
    Rate limiting, method configs, transformations
  </Card>
</CardGroup>

***

<Info>
  **Keep it simple:** Start with a basic route, then add advanced features as needed.
</Info>
