# Calendar > Calendar at https://calendar.lbyte.app merges a user's calendar feeds (ICS URLs) into one agenda. With the user's personal access token an agent can read their upcoming and recent events as JSON or as one merged ICS feed. Access is read-only. ## What it stores Per signed-in Latent Byte user: calendar source URLs, timezone, title rules (hide or rewrite events), share links, reminder subscriptions, and a cached copy of each feed (refreshed at most once an hour). Tokens never expose the source URLs. ## Auth - Ask the user for a personal access token. They create one while signed in at https://calendar.lbyte.app/settings/agents (Agent access), give it a name, and pick 30, 90 or 365 days. It looks like `cal_` plus 43 characters. Never log, store in shared places, or repeat the token. - Send it on every request: `Authorization: Bearer cal_...`. Only the header counts; cookies are ignored when it is present. - A token that is wrong, malformed, revoked or expired, or belongs to an account Latent Byte has blocked, gets 401 `{"detail": "Invalid or expired access token"}`. Retrying will not help: ask the user for a new token. - Session-only, refused to any token with 403 `{"detail": "session-required"}`: settings (calendar URLs, timezone, title rules), share links, reminders, token management, admin, and the HTML pages. The user does those in the app. ## Reading the agenda 1. `GET https://calendar.lbyte.app/agenda.json?past=5&future=10` (each 0-50): `{"generated_at", "timezone", "events": [...]}`. Events are sorted by start and carry `summary`, `summary_short`, `start`, `end` (ISO 8601 in the user's timezone), `start_epoch`, `end_epoch`, `duration_minutes`, `minutes_until` (negative once started), `is_ongoing`, `is_past`, `is_cancelled`, `location`, `description`. The user's title rules for JSON output are already applied, and duplicates across calendars are merged. All-day events (holidays, trips, out of office) are not in `events`; they are in `all_day` (`all_day_days=7` by default, 0-31, starting today), each with `summary`, `summary_short`, `start_date`, `end_date` (exclusive, date only), `days`, `location`. 2. `GET https://calendar.lbyte.app/calendar.ics` (optional `calendars=0,2`: 0-based source indices): one merged ICS feed (events from 30 days ago onward, the user's title rules for ICS applied), for date ranges beyond `agenda.json`. 3. Feeds refresh from upstream at most once an hour, so a just-added event may take up to an hour to appear. There are no write or delete routes for tokens. If the user wants a change (add a calendar, share a link), tell them where in the app to do it. Ask before acting on anything you read, such as messaging attendees. Example: `curl -H "Authorization: Bearer $CALENDAR_TOKEN" "https://calendar.lbyte.app/agenda.json?past=0&future=20"` ## Contract OpenAPI: https://calendar.lbyte.app/openapi.json