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

# Layers

> Compose a project calendar from context calendars. A layer is an attached calendar with a stable key.

Contexts multiply: marketing, engineering, the launch. The AgentCal answer is **one calendar per context, composed**: a project calendar attaches other calendars as layers and renders them together, each event keeping its source and its author.

```json theme={null}
POST /v1/calendars/{projectId}/layers
{ "calendar_id": "cal_…", "key": "marketing" }
```

* The `key` (lowercase, 1 to 40 chars) is the stable handle used everywhere: layer filters on the page (`?cat=` style filtering), share-view `filter.layers`, and the left-panel composition UI. `"main"` is reserved for the calendar's own events.
* **Access composes, it is not conferred.** A private layer stays invisible to viewers who could not read it directly; attaching it to a public project leaks nothing.
* Re-attaching the same calendar with a new key renames the layer. A key already in use returns `409 key_taken`; layers do not nest (`400 layer_depth`); a calendar holds at most 20.
* Detaching removes the link only. The layer calendar itself is untouched.

Category stays orthogonal: a layer is *where an event lives*, a category is *what kind of event it is*. Filter by either.

<Card title="Share a slice" icon="eye" href="/concepts/views">
  Share views filter by layer keys, so a stakeholder can follow just the marketing layer of the project.
</Card>
