> ## 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 Collections?

> Organize and manage your routes, secrets, and environment configurations with Collections

# What are Collections?

## Overview

Collections in KnoxCall are organizational containers that help you group related routes, secrets, and variables together. They provide a structured way to manage shared configurations across multiple routes and maintain consistency in your API proxy setup.

<Info>
  The **Secrets** page now uses a two-level hierarchy with collections as the top level. Clicking a collection reveals its secrets. Secrets that don't belong to any collection appear under an **Uncollected** group. When creating a new secret, you'll be prompted to assign it to a collection — or type a new name to create one on the fly.
</Info>

## Key Features

### Route Organization

Group related routes together for better project management. All routes in a collection can share common settings and configurations.

### Shared Variables

Define variables once and use them across all routes in the collection. Variables can be:

* **Static values** - Reusable configuration values
* **Secret references** - Point to encrypted secrets for sensitive data

### Environment Defaults

Set default configurations per environment that apply to all routes in the collection:

* **Base URLs** - Default target URLs for each environment
* **Default Clients** - Automatically attach authorized clients to routes
* **Expected Environments** - Auto-provision routes with specific environments

### Centralized Secret Management

Attach secrets to a collection and reference them across all routes, ensuring consistent credential management.

## Use Cases

<AccordionGroup>
  <Accordion title="Multi-Service API Management" icon="server">
    Group routes for different microservices (auth, payments, notifications) in separate collections, each with their own secrets and environment configurations.
  </Accordion>

  <Accordion title="Multi-Tenant Applications" icon="building">
    Create collections per client or tenant, with isolated credentials and configuration variables.
  </Accordion>

  <Accordion title="Environment-Specific Routing" icon="layer-group">
    Define different base URLs and client permissions per environment (dev, staging, production) at the collection level.
  </Accordion>

  <Accordion title="Team Collaboration" icon="users">
    Organize routes by team or project area, making it easier for different teams to manage their own API integrations.
  </Accordion>
</AccordionGroup>

## How Collections Work

When you create a collection, you can:

1. **Add Routes** - Assign existing routes or create new ones directly in the collection
2. **Define Variables** - Create reusable key-value pairs or secret references
3. **Configure Environments** - Set base URLs and default clients per environment
4. **Attach Secrets** - Move secrets into the collection for shared access. Use the inline **Move to Collection** submenu accessible from any secret row in the Secrets list for quick assignment without opening the secret detail.
5. **Apply Defaults** - Bulk-apply environment configurations to all routes

Routes in a collection can reference collection variables using the syntax:

```text theme={"dark"}
{{var:variable_name}}
```

## Benefits

<CardGroup cols={2}>
  <Card title="Consistency" icon="check-circle">
    Ensure all related routes use the same credentials and configurations
  </Card>

  <Card title="Scalability" icon="chart-line">
    Easily add new routes that inherit collection settings
  </Card>

  <Card title="Maintainability" icon="wrench">
    Update shared variables and secrets in one place
  </Card>

  <Card title="Environment Management" icon="layer-group">
    Streamline multi-environment deployments with collection defaults
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Managing Collections" icon="folder-cog" href="/essentials/collections/managing-collections">
    Learn how to create and manage collections
  </Card>

  <Card title="Collection Variables" icon="variable" href="/essentials/collections/collection-variables">
    Work with variables and secret references
  </Card>
</CardGroup>
