{"openapi":"3.1.0","info":{"title":"Chronary API","version":"1.0.0","description":"Calendar-as-a-service API for AI agents.\n\nManage calendars, events, and availability for AI and human agents.\nAll endpoints require an API key passed as a Bearer token.\n\n**Authentication:** `Authorization: Bearer chr_sk_...` or `Authorization: Bearer chr_ak_...`\n\n**Rate limit:** 10 requests/second per API key on Free, 25 on Developer, 50 on Pro. Exceeds return HTTP 429.\n\n**Quotas:** Monthly operation limits by plan — see [Billing & plans](https://docs.chronary.ai/resources/billing/) and [Rate limits](https://docs.chronary.ai/resources/rate-limits/).\n\n**Agent bootstrap:** Custom extensions prefixed `x-agent-*` describe the self-signup flow for AI agents. These are not part of any registered OpenAPI extension — they are a Chronary convention.","contact":{"name":"Chronary Support","email":"support@chronary.ai","url":"https://docs.chronary.ai"}},"servers":[{"url":"https://api.chronary.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key with `chr_sk_*` for org-level access or `chr_ak_*` for agent-scoped access. Pass in the Authorization header: `Authorization: Bearer chr_sk_...`"},"SessionAuth":{"type":"apiKey","in":"cookie","name":"__Host-chronary_session","description":"Console session JWT (HS256), issued by sign-in and sent as the `__Host-chronary_session` cookie (a Bearer JWT is also accepted). This is NOT a chr_sk_*/chr_ak_* API key — API keys are rejected with 401 on these endpoints."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","example":"validation_error","description":"Machine-readable error type. See https://docs.chronary.ai/resources/errors/ for the documented values."},"message":{"type":"string","example":"The field \"name\" is required."},"request_id":{"type":"string","example":"req_01H9X4M2P5R8T6V0"},"required_plan":{"type":"string","example":"developer","description":"plan_required: the cheapest plan you can buy that unlocks the feature"},"feature":{"type":"string","description":"plan_required: the gated feature"},"metric":{"type":"string","description":"quota_exceeded and count caps: the metric at its limit (a PLAN_LIMITS key, accepted by POST /v1/billing/upgrade-requests)"},"limit":{"type":"integer","description":"quota_exceeded and count caps: the limit that was enforced for `metric`"},"upgrade_url":{"type":"string","description":"Where a human upgrades the plan"},"upgrade_plan":{"type":"string","example":"pro","description":"quota_exceeded and count caps: the self-serve plan upgrade_url leads to (the next plan up)"},"docs_url":{"type":"string"},"contact_url":{"type":"string","description":"Contract-managed plans: where to contact sales"},"retry_after":{"type":"integer","description":"Seconds until the request may be retried"}},"required":["type","message","request_id"]}},"required":["error"]},"Agent":{"type":"object","properties":{"id":{"type":"string","example":"agt_01H9X4M2P5R8T6V0"},"orgId":{"type":"string","example":"org_01H9X4M2P5R8T6V0"},"name":{"type":"string","example":"Scheduling Assistant"},"type":{"type":"string","enum":["ai","human","resource"],"example":"ai"},"description":{"type":["string","null"],"example":"Books meetings with prospects."},"status":{"type":"string","enum":["active","paused","decommissioned"],"example":"active"},"metadata":{"type":"object","additionalProperties":{},"example":{}},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"}},"required":["id","orgId","name","type","description","status","metadata","createdAt","updatedAt"]},"AgentListItem":{"allOf":[{"$ref":"#/components/schemas/Agent"},{"type":"object","properties":{"calendar_count":{"type":"integer","example":2,"description":"Live calendars owned by the agent. Present only with `include_counts=true`."},"scoped_key_count":{"type":"integer","example":1,"description":"Live (not revoked) Agent keys for the agent. Present only with `include_counts=true`."}}}]},"AgentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentListItem"}},"total":{"type":"integer","example":3,"description":"Every matching agent, not only this page"},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"next_cursor":{"type":["string","null"],"example":null,"description":"Pass as `cursor` to fetch the next page; null on the last page"}},"required":["data","total","limit","offset","next_cursor"]},"Calendar":{"type":"object","properties":{"id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"orgId":{"type":"string","example":"org_01H9X4M2P5R8T6V0"},"agentId":{"type":["string","null"],"example":"agt_01H9X4M2P5R8T6V0"},"name":{"type":"string","example":"Work Calendar"},"timezone":{"type":"string","example":"America/Los_Angeles"},"metadata":{"type":"object","additionalProperties":{},"example":{}},"externalId":{"type":["string","null"],"example":null,"description":"Provider calendar ID when bridged to an external provider (Phase 3); null otherwise."},"provider":{"type":["string","null"],"example":null,"description":"External provider this calendar is bridged to (google | microsoft | apple); null otherwise."},"deletedAt":{"type":["string","null"],"format":"date-time","example":null},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"},"agent_status":{"type":"string","enum":["idle","working","waiting","error"],"example":"idle"},"default_reminders":{"type":["array","null"],"items":{"type":"integer"},"example":[10],"description":"Default reminder offsets (minutes before start) inherited by events that don't set their own. null = use the system default (10 min); [] = no reminders."},"ical_url":{"type":"string","format":"uri","example":"https://api.chronary.ai/ical/abc123def456ghi789.ics"}},"required":["id","orgId","agentId","name","timezone","metadata","externalId","provider","deletedAt","createdAt","updatedAt","agent_status","default_reminders","ical_url"]},"CalendarList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Calendar"}},"total":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}},"required":["data","total","limit","offset"]},"CalendarPage":{"allOf":[{"$ref":"#/components/schemas/CalendarList"},{"type":"object","properties":{"total":{"type":"integer","example":2,"description":"Every matching calendar, not only this page"},"next_cursor":{"type":["string","null"],"example":null,"description":"Pass as `cursor` to fetch the next page; null on the last page"}},"required":["next_cursor"]}]},"BookingPage":{"type":"object","properties":{"id":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0"},"org_id":{"type":"string","example":"5f8e..."},"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"agent_id":{"type":["string","null"],"example":"agt_01H9X4M2P5R8T6V0","description":"Owner agent of the bound calendar; null for shared/org calendars."},"slug":{"type":"string","example":"a1b2c3d4e5f6g7h8i9j0k1","description":"Unguessable public token in the hosted URL."},"title":{"type":"string","example":"Intro call"},"description":{"type":["string","null"],"example":"A 30-minute intro chat."},"duration_minutes":{"type":"integer","example":30},"buffer_minutes":{"type":"integer","example":0,"description":"Padding added before and after each existing event when computing slots."},"window_days":{"type":"integer","example":14,"description":"How far ahead bookings are allowed."},"min_notice_minutes":{"type":"integer","example":0,"description":"Minimum lead time before a bookable slot."},"timezone":{"type":"string","example":"America/Los_Angeles"},"availability_constraints":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"start":{"type":"string","example":"09:00","description":"HH:MM 24-hour"},"end":{"type":"string","example":"17:00","description":"HH:MM 24-hour"}},"required":["start","end"]},"example":{"mon":{"start":"09:00","end":"17:00"}},"description":"Weekly working hours; null = any time inside the window (calendar events still block)."},"active":{"type":"boolean","example":true},"bookings_count":{"type":"integer","example":3,"description":"Number of bookings made through this page."},"booking_url":{"type":"string","format":"uri","example":"https://api.chronary.ai/book/a1b2c3d4e5f6g7h8i9j0k1"},"created_at":{"type":"string","format":"date-time","example":"2026-07-14T10:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-07-14T10:00:00.000Z"}},"required":["id","org_id","calendar_id","agent_id","slug","title","description","duration_minutes","buffer_minutes","window_days","min_notice_minutes","timezone","availability_constraints","active","bookings_count","booking_url","created_at","updated_at"]},"BookingPageList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BookingPage"}},"total":{"type":"integer","example":1},"limit":{"type":"integer","example":50},"offset":{"type":"integer","example":0}},"required":["data","total","limit","offset"]},"Booking":{"type":"object","properties":{"id":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"The event the booking created"},"booking_page_id":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0"},"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"start_time":{"type":"string","format":"date-time","example":"2026-07-15T16:00:00.000Z"},"end_time":{"type":"string","format":"date-time","example":"2026-07-15T16:30:00.000Z"},"status":{"type":"string","example":"confirmed","description":"The event status, for example `confirmed`, or `cancelled` once the booking was cancelled"},"invitee_name":{"type":["string","null"],"example":"Ada Lovelace"},"invitee_email":{"type":["string","null"],"example":"ada@example.com"},"invitee_notes":{"type":["string","null"],"example":"Looking forward to it.","description":"Notes from the booking form; null when none were given"},"created_at":{"type":"string","format":"date-time","example":"2026-07-14T10:00:00.000Z","description":"When the booking was made"}},"required":["id","booking_page_id","calendar_id","start_time","end_time","status","invitee_name","invitee_email","invitee_notes","created_at"]},"BookingList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"next_cursor":{"type":["string","null"],"example":null,"description":"Pass as `cursor` to fetch the next page; null on the last page"}},"required":["data","next_cursor"]},"BookingSlotsResponse":{"type":"object","properties":{"booking_page":{"type":"object","properties":{"slug":{"type":"string","example":"a1b2c3d4e5f6g7h8i9j0k1"},"title":{"type":"string","example":"Intro call"},"description":{"type":["string","null"],"example":null},"duration_minutes":{"type":"integer","example":30},"timezone":{"type":"string","example":"America/Los_Angeles"}},"required":["slug","title","description","duration_minutes","timezone"]},"slots":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","example":"2026-07-15T16:00:00.000Z"},"end":{"type":"string","format":"date-time","example":"2026-07-15T16:30:00.000Z"}},"required":["start","end"]}}},"required":["booking_page","slots"]},"BookingSubmissionResult":{"type":"object","properties":{"booking_page_id":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0"},"event":{"type":"object","properties":{"id":{"type":"string","example":"evt_01H9X4M2P5R8T6V0"},"title":{"type":"string","example":"Intro call — Ada Lovelace"},"start_time":{"type":"string","format":"date-time","example":"2026-07-15T16:00:00.000Z"},"end_time":{"type":"string","format":"date-time","example":"2026-07-15T16:30:00.000Z"},"status":{"type":"string","example":"confirmed"}},"required":["id","title","start_time","end_time","status"]}},"required":["booking_page_id","event"]},"Event":{"type":"object","properties":{"id":{"type":"string","example":"evt_01H9X4M2P5R8T6V0"},"calendarId":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"orgId":{"type":"string","example":"org_01H9X4M2P5R8T6V0"},"title":{"type":"string","example":"Team standup"},"description":{"type":["string","null"],"example":"Daily sync meeting."},"startTime":{"type":"string","format":"date-time","example":"2025-01-20T09:00:00.000Z"},"endTime":{"type":"string","format":"date-time","example":"2025-01-20T09:30:00.000Z"},"allDay":{"type":"boolean","example":false},"status":{"type":"string","enum":["confirmed","tentative","cancelled","hold"],"example":"confirmed"},"source":{"type":"string","enum":["internal","external_ical"],"example":"internal"},"metadata":{"type":"object","additionalProperties":{},"example":{}},"reminders":{"type":["array","null"],"items":{"type":"integer"},"example":[10],"description":"Reminder offsets (minutes before start). Each fires an event.reminder webhook and emits a VALARM in the iCal feed. null = inherit the calendar default (then the system default of 10 min); [] = no reminders."},"holdExpiresAt":{"type":["string","null"],"format":"date-time","example":null,"description":"When set, the event is a tentative hold that auto-expires at this timestamp. Must be 30 seconds to 15 minutes in the future when creating a hold; the cap exists to keep held slots short enough that they do not block real scheduling for long."},"holdPriority":{"type":"integer","example":0,"description":"Priority for conflict resolution. Higher values pre-empt lower-priority overlapping holds."},"recurrenceRule":{"type":["string","null"],"example":null,"description":"RFC 5545 RRULE subset (no \"RRULE:\" prefix) when this event is a recurring series master, e.g. \"FREQ=WEEKLY;BYDAY=MO,WE;COUNT=12\". Expanded in `timezone` when set (DST-correct: a weekly 16:00 stays 16:00 local), otherwise in UTC. null = one-off event."},"recurrenceExdates":{"type":"array","items":{"type":"string","format":"date-time"},"example":[],"description":"ISO 8601 starts of individually cancelled occurrences (EXDATE). When an update moves the series (start_time, recurrence_rule or timezone), each is carried to the new occurrence on the same local date; see droppedExdates."},"timezone":{"type":["string","null"],"example":"America/Los_Angeles","description":"IANA time zone the series repeats in. BYDAY/BYMONTHDAY, the start_time match and a date-only UNTIL are evaluated in it; a local time skipped by a DST gap moves forward by the gap, a repeated one uses the first instance, and duration is elapsed time. null = UTC. Never follows later changes to the calendar time zone. Ignored for expansion on all-day events."},"recurringEventId":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Present only on expanded instances (expand=true): the id of the recurring series master this instance belongs to."},"originalStartTime":{"type":"string","format":"date-time","example":"2025-01-20T09:00:00.000Z","description":"Present only on expanded instances: the occurrence start this instance was generated for (UTC instant; the occurrence_start for DELETE and reminders)."},"startLocal":{"type":"string","example":"2025-01-20T09:00:00","description":"Present only on expanded instances: the start as local wall time in the series time zone (UTC when the series has none), without offset."},"utcOffset":{"type":"string","example":"-08:00","description":"Present only on expanded instances: the UTC offset that applies at startLocal."},"dstAdjusted":{"type":["string","null"],"enum":["gap",null],"example":null,"description":"Present only on expanded instances: \"gap\" when the local start did not exist (DST spring-forward) and was moved forward by the gap; otherwise null."},"droppedExdates":{"type":"array","items":{"type":"string"},"example":[],"description":"Present only on update responses that moved a recurring series: cancelled occurrences whose local date has no occurrence in the new series. They were removed; re-cancel the right occurrence with DELETE ?occurrence_start= if needed."},"external_sync":{"type":"object","properties":{"status":{"type":"string","example":"not_configured","description":"not_configured | queued | published | skipped | failed"}},"required":["status"],"description":"Present only on create/update/hold mutation responses — the outcome of publishing this event to a connected human calendar (opt-in). Absent on read/list responses."},"deletedAt":{"type":["string","null"],"format":"date-time","example":null},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"}},"required":["id","calendarId","orgId","title","description","startTime","endTime","allDay","status","source","metadata","reminders","holdExpiresAt","holdPriority","recurrenceRule","recurrenceExdates","timezone","deletedAt","createdAt","updatedAt"]},"EventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"total":{"type":"integer","example":42},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}},"required":["data","total","limit","offset"]},"OrgEventList":{"allOf":[{"$ref":"#/components/schemas/EventList"},{"type":"object","properties":{"total":{"type":"integer","example":42,"description":"Every matching event (or occurrence with expand), not only this page"},"limit":{"type":"integer","example":50},"next_cursor":{"type":["string","null"],"example":null,"description":"Pass as `cursor` to fetch the next page; null on the last page"}},"required":["next_cursor"]}]},"CalendarContext":{"type":"object","properties":{"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"now":{"type":"string","format":"date-time","example":"2026-04-14T10:30:00.000Z"},"agent_status":{"type":"string","enum":["idle","working","waiting","error"],"example":"idle"},"current_event":{"description":"Currently active event, or null","anyOf":[{"$ref":"#/components/schemas/Event"},{"type":"null"}]},"next_event":{"description":"Next upcoming event, or null","anyOf":[{"$ref":"#/components/schemas/Event"},{"type":"null"}]},"recent_events":{"type":"array","items":{"$ref":"#/components/schemas/Event"},"description":"Up to 3 most recently ended events"},"upcoming":{"type":"array","items":{"$ref":"#/components/schemas/Event"},"description":"Up to 5 events starting within the next 24 hours"}},"required":["calendar_id","now","agent_status","current_event","next_event","recent_events","upcoming"]},"Slot":{"type":"object","properties":{"start":{"type":"string","format":"date-time","example":"2025-01-20T09:00:00.000Z"},"end":{"type":"string","format":"date-time","example":"2025-01-20T09:30:00.000Z"}},"required":["start","end"]},"AgentAvailabilityResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"string"},"example":["agt_01H9X4M2P5R8T6V0"]},"slots":{"type":"array","items":{"$ref":"#/components/schemas/Slot"}},"per_agent_busy":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","example":"2025-01-20T09:00:00.000Z"},"end":{"type":"string","format":"date-time","example":"2025-01-20T09:30:00.000Z"},"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"}},"required":["start","end"]}},"description":"Busy blocks keyed by agent id. Present only when include_busy=true.","example":{"agt_01H9X4M2P5R8T6V0":[{"start":"2025-01-20T09:00:00.000Z","end":"2025-01-20T09:30:00.000Z","calendar_id":"cal_01H9X4M2P5R8T6V0"}]}},"availability_state":{"type":"string","enum":["complete","stale","partial","unavailable"],"description":"Whether all required Chronary and authorized human-calendar data was current for this result."},"sources":{"type":"object","properties":{"chronary":{"type":"string","enum":["current"]},"external":{"type":"string","enum":["current","stale","partial","unavailable"]},"last_synced_at":{"type":["string","null"],"format":"date-time"}},"required":["chronary","external"]},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["availability_incomplete"]},"message":{"type":"string"}},"required":["code","message"]}}},"required":["agents","slots","availability_state","sources","warnings"]},"CalendarAvailabilityResponse":{"type":"object","properties":{"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/Slot"}},"busy":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","example":"2025-01-20T09:00:00.000Z"},"end":{"type":"string","format":"date-time","example":"2025-01-20T09:30:00.000Z"}},"required":["start","end"]},"description":"Flat busy-block list. Present only when include_busy=true."},"availability_state":{"type":"string","enum":["complete","stale","partial","unavailable"],"description":"Whether all required Chronary and authorized human-calendar data was current for this result."},"sources":{"type":"object","properties":{"chronary":{"type":"string","enum":["current"]},"external":{"type":"string","enum":["current","stale","partial","unavailable"]},"last_synced_at":{"type":["string","null"],"format":"date-time"}},"required":["chronary","external"]},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["availability_incomplete"]},"message":{"type":"string"}},"required":["code","message"]}}},"required":["calendar_id","slots","availability_state","sources","warnings"]},"Webhook":{"type":"object","properties":{"id":{"type":"string","example":"whk_01H9X4M2P5R8T6V0"},"orgId":{"type":"string","example":"org_01H9X4M2P5R8T6V0"},"url":{"type":"string","format":"uri","example":"https://example.com/webhooks/chronary"},"events":{"type":"array","items":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"]},"example":["event.created","event.updated"]},"active":{"type":"boolean","example":true},"consecutiveFailures":{"type":"integer","example":0,"description":"Circuit-breaker counter: consecutive terminal delivery failures. Reset to 0 on any successful delivery; the endpoint is auto-deactivated at 20 or after 24h of continuous failure."},"firstFailureAt":{"type":["string","null"],"format":"date-time","example":null,"description":"Timestamp of the first failure in the current failure streak; null when there is no active streak."},"deletionPausedAt":{"type":["string","null"],"format":"date-time","example":null,"description":"When a scheduled account deletion paused this endpoint (`active` is then false); null otherwise. Cancelling the deletion resumes it."},"deactivatedAt":{"type":["string","null"],"format":"date-time","example":null,"description":"When the endpoint last went inactive; null while it is active. Cleared when it is re-enabled."},"deactivatedReason":{"type":["string","null"],"enum":["manual","circuit_breaker","unsafe_destination_url","account_deletion",null],"example":null,"description":"Why the endpoint is inactive: `manual` (paused with `active: false`), `circuit_breaker` (too many consecutive failed deliveries), `unsafe_destination_url` (the URL points to a private or local address) or `account_deletion`. Null while it is active."},"previousSecretExpiresAt":{"type":["string","null"],"format":"date-time","example":null,"description":"While a secret rotation's grace window is open, when the replaced signing secret stops working; until then every delivery also carries `X-Signature-Previous` signed with it. Null when no grace window is open. The secrets themselves are never returned here."},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"}},"required":["id","orgId","url","events","active","consecutiveFailures","firstFailureAt","deactivatedAt","deactivatedReason","previousSecretExpiresAt","createdAt"]},"WebhookLastDelivery":{"type":"object","properties":{"id":{"type":"string","example":"whd_01H9X4M2P5R8T6V0"},"status":{"type":"string","enum":["pending","delivered","failed","dropped"],"example":"delivered"},"attempted_at":{"type":["string","null"],"format":"date-time","description":"When the delivery was last attempted; null before its first attempt or when it was dropped.","example":"2026-04-18T10:00:00.000Z"},"response_status":{"type":["integer","null"],"description":"HTTP status of the last attempt; null when no response was received.","example":200}},"required":["id","status","attempted_at","response_status"]},"WebhookListItem":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"last_delivery":{"type":["object","null"],"properties":{"id":{"type":"string","example":"whd_01H9X4M2P5R8T6V0"},"status":{"type":"string","enum":["pending","delivered","failed","dropped"],"example":"delivered"},"attempted_at":{"type":["string","null"],"format":"date-time","description":"When the delivery was last attempted; null before its first attempt or when it was dropped.","example":"2026-04-18T10:00:00.000Z"},"response_status":{"type":["integer","null"],"description":"HTTP status of the last attempt; null when no response was received.","example":200}},"required":["id","status","attempted_at","response_status"],"description":"Only with `expand=last_delivery`: the newest delivery to this endpoint, or null when it has none."},"failures_24h":{"type":"integer","description":"Only with `expand=failures_24h`: failed deliveries created in the last 24 hours, not counting test events.","example":0}}}]},"WebhookList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookListItem"}},"total":{"type":"integer","example":1},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}},"required":["data","total","limit","offset"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","example":"whd_01H9X4M2P5R8T6V0"},"subscription_id":{"type":"string","example":"whk_01H9X4M2P5R8T6V0"},"event_type":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"],"example":"event.created"},"status":{"type":"string","enum":["pending","delivered","failed","dropped"],"description":"`dropped` is a delivery the Free plan monthly limit stopped: it was never sent, counted or retried, and its `last_error_code` is `quota_exceeded`.","example":"delivered"},"attempts":{"type":"integer","example":1},"last_attempt_at":{"type":["string","null"],"format":"date-time","example":"2026-04-18T10:00:00.000Z"},"next_retry_at":{"type":["string","null"],"format":"date-time","example":null},"created_at":{"type":"string","format":"date-time","example":"2026-04-18T09:55:00.000Z"},"last_response_status":{"type":["integer","null"],"description":"HTTP status of the most recent attempt. Null when no response was received (timeout, connection or TLS error, unsafe URL) or before the first attempt.","example":200},"last_error_code":{"type":["string","null"],"enum":["timeout","connection_error","tls_error","redirect_not_followed","unsafe_destination_url","non_2xx","endpoint_disabled","quota_exceeded",null],"description":"Why the most recent attempt failed; null when it succeeded or before the first attempt.","example":null},"last_duration_ms":{"type":["integer","null"],"description":"Time to response headers of the most recent attempt, in milliseconds. Null when no request was made.","example":142},"is_test":{"type":"boolean","description":"True for a test event sent with `POST /v1/webhooks/{id}/test`.","example":false},"replay_of_delivery_id":{"type":["string","null"],"description":"Set on a replay sent with `POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay`: the first delivery of the chain (the original, even when a replay is replayed). Null otherwise.","example":null},"payload":{"type":"object","additionalProperties":{},"description":"Present only when include_payload=true","example":{"id":"evt_abc","title":"Meeting"}}},"required":["id","subscription_id","event_type","status","attempts","last_attempt_at","next_retry_at","created_at","last_response_status","last_error_code","last_duration_ms","is_test","replay_of_delivery_id"]},"WebhookDeliveryAttempt":{"type":"object","properties":{"id":{"type":"string","example":"wha_01H9X4M2P5R8"},"attempt_number":{"type":"integer","minimum":1,"description":"1-based attempt number","example":1},"started_at":{"type":"string","format":"date-time","example":"2026-04-18T10:00:00.000Z"},"duration_ms":{"type":["integer","null"],"description":"Time to response headers in milliseconds; null when no request was made.","example":142},"response_status":{"type":["integer","null"],"description":"HTTP status the endpoint returned; null when no response was received.","example":503},"response_body":{"type":["string","null"],"description":"Up to the first 2048 bytes of the endpoint's response body. Null when the body was empty, unreadable, or redacted after the retention window.","example":"Service Unavailable"},"error_code":{"type":["string","null"],"enum":["timeout","connection_error","tls_error","redirect_not_followed","unsafe_destination_url","non_2xx",null],"description":"Why the attempt failed; null on success.","example":"non_2xx"}},"required":["id","attempt_number","started_at","duration_ms","response_status","response_body","error_code"]},"WebhookDeliveryDetail":{"type":"object","properties":{"id":{"type":"string","example":"whd_01H9X4M2P5R8T6V0"},"subscription_id":{"type":"string","example":"whk_01H9X4M2P5R8T6V0"},"event_type":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"],"example":"event.created"},"status":{"type":"string","enum":["pending","delivered","failed","dropped"],"description":"`dropped` is a delivery the Free plan monthly limit stopped: it was never sent, counted or retried, and its `last_error_code` is `quota_exceeded`.","example":"delivered"},"attempts":{"type":"integer","example":1},"last_attempt_at":{"type":["string","null"],"format":"date-time","example":"2026-04-18T10:00:00.000Z"},"next_retry_at":{"type":["string","null"],"format":"date-time","example":null},"created_at":{"type":"string","format":"date-time","example":"2026-04-18T09:55:00.000Z"},"last_response_status":{"type":["integer","null"],"description":"HTTP status of the most recent attempt. Null when no response was received (timeout, connection or TLS error, unsafe URL) or before the first attempt.","example":200},"last_error_code":{"type":["string","null"],"enum":["timeout","connection_error","tls_error","redirect_not_followed","unsafe_destination_url","non_2xx","endpoint_disabled","quota_exceeded",null],"description":"Why the most recent attempt failed; null when it succeeded or before the first attempt.","example":null},"last_duration_ms":{"type":["integer","null"],"description":"Time to response headers of the most recent attempt, in milliseconds. Null when no request was made.","example":142},"is_test":{"type":"boolean","description":"True for a test event sent with `POST /v1/webhooks/{id}/test`.","example":false},"replay_of_delivery_id":{"type":["string","null"],"description":"Set on a replay sent with `POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay`: the first delivery of the chain (the original, even when a replay is replayed). Null otherwise.","example":null},"max_attempts":{"type":"integer","description":"Attempts allowed by the organization's current plan. The schedule a delivery follows is fixed when it is enqueued, so after a plan change this can differ from the schedule it used.","example":4},"payload":{"description":"The payload as stored. Replaced by a redaction marker after the retention window.","example":{"id":"evt_abc","title":"Meeting"}},"payload_redacted":{"type":"boolean","description":"True when the payload was redacted under the retention policy.","example":false},"request_headers":{"type":"object","properties":{"content-type":{"type":"string","enum":["application/json"]},"x-delivery-id":{"type":"string"},"x-chronary-event-type":{"type":"string"},"x-chronary-replay-of":{"type":"string","description":"Only on a replay: the delivery id in `replay_of_delivery_id`."}},"required":["content-type","x-delivery-id","x-chronary-event-type"],"description":"The stable request headers. X-Signature, X-Signature-Previous and X-Timestamp change on every attempt and are not stored.","example":{"content-type":"application/json","x-delivery-id":"whd_01H9X4M2P5R8T6V0","x-chronary-event-type":"event.created"}},"attempt_log":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryAttempt"},"description":"Every attempt of this delivery, oldest first."}},"required":["id","subscription_id","event_type","status","attempts","last_attempt_at","next_retry_at","created_at","last_response_status","last_error_code","last_duration_ms","is_test","replay_of_delivery_id","max_attempts","payload_redacted","request_headers","attempt_log"]},"WebhookDeliveryList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"total":{"type":"integer","example":42,"description":"Deliveries matching the filters, ignoring the cursor and offset"},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"next_cursor":{"type":["string","null"],"description":"Pass as `cursor` to get the next page; null on the last page.","example":"WyIyMDI2LTA0LTE4IDA5OjU1OjAwLjEyMzQ1NiswMCIsIndoZF8wMUg5WDRNMlA1UjhUNlYwIl0"},"has_more":{"type":"boolean","description":"True when another page follows.","example":true},"stats":{"type":"object","properties":{"pending":{"type":"integer","example":2},"delivered":{"type":"integer","example":35},"failed":{"type":"integer","example":5},"dropped":{"type":"integer","example":0,"description":"Deliveries the Free plan monthly limit stopped"}},"required":["pending","delivered","failed","dropped"],"description":"All-time delivery counts for this webhook"}},"required":["data","total","limit","offset","next_cursor","has_more","stats"]},"WebhookTestSent":{"type":"object","properties":{"delivery_id":{"type":"string","example":"whd_01H9X4M2P5R8T6V0"},"webhook_id":{"type":"string","example":"whk_01H9X4M2P5R8T6V0"},"event_type":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"],"example":"event.created"},"status":{"type":"string","enum":["pending"],"example":"pending"},"is_test":{"type":"boolean","enum":[true],"example":true}},"required":["delivery_id","webhook_id","event_type","status","is_test"]},"WebhookReplaySent":{"type":"object","properties":{"delivery_id":{"type":"string","description":"The new delivery","example":"whd_01H9X4M2P5R8T6V1"},"webhook_id":{"type":"string","example":"whk_01H9X4M2P5R8T6V0"},"event_type":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"],"example":"event.created"},"status":{"type":"string","enum":["pending"],"example":"pending"},"replay_of_delivery_id":{"type":"string","description":"The first delivery of the chain; sent as the `X-Chronary-Replay-Of` header.","example":"whd_01H9X4M2P5R8T6V0"}},"required":["delivery_id","webhook_id","event_type","status","replay_of_delivery_id"]},"RotatedWebhookSecret":{"type":"object","properties":{"webhook_id":{"type":"string","example":"whk_01H9X4M2P5R8T6V0"},"secret":{"type":"string","example":"whsec_abc123...","description":"The new HMAC-SHA256 signing secret. Returned once, by this response only. Store it securely."},"previous_secret_expires_at":{"type":["string","null"],"format":"date-time","example":"2026-11-05T10:00:00.000Z","description":"When the replaced secret stops working. Until then deliveries carry `X-Signature` (new secret) and `X-Signature-Previous` (replaced secret). Null when `expire_old_in` was `now`."}},"required":["webhook_id","secret","previous_secret_expires_at"]},"ICalSubscription":{"type":"object","properties":{"id":{"type":"string","example":"ics_01H9X4M2P5R8T6V0"},"agent_id":{"type":"string","example":"agt_01H9X4M2P5R8T6V0"},"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"url":{"type":"string","format":"uri","example":"https://calendar.google.com/calendar/ical/example/basic.ics"},"label":{"type":["string","null"],"example":"Google Calendar"},"status":{"type":"string","enum":["active","error","paused"],"example":"active"},"last_synced_at":{"type":["string","null"],"format":"date-time","example":"2025-01-15T10:00:00.000Z"},"last_error":{"type":["string","null"],"example":null},"created_at":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"}},"required":["id","agent_id","calendar_id","url","label","status","last_synced_at","last_error","created_at"]},"ICalSubscriptionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ICalSubscription"}},"total":{"type":"integer","example":1},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}},"required":["data","total","limit","offset"]},"Usage":{"type":"object","properties":{"plan":{"type":"string","example":"free"},"period_start":{"type":"string","format":"date-time","example":"2026-04-01T00:00:00.000Z"},"period_end":{"type":"string","format":"date-time","example":"2026-04-30T23:59:59.000Z"},"resets_at":{"type":"string","format":"date-time","example":"2026-05-01T00:00:00.000Z","description":"First instant of the next UTC month, when monthly counters reset."},"generated_at":{"type":"string","format":"date-time","example":"2026-04-25T12:04:07.000Z","description":"When this response was computed. API calls can lag by up to 30 seconds."},"agents":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"calendars":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"events":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"api_calls":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"webhooks":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"webhook_endpoints":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"availability_queries":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"ical_subscriptions":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"proposals":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"]},"recurring_events":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"],"description":"Active recurring event series (DB-counted masters). Deleting a series frees its slot."},"booking_pages":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"],"description":"Active public booking pages (DB-counted). Deleting a page frees its slot."},"calendar_connections":{"type":"object","properties":{"used":{"type":"integer","example":120},"limit":{"type":["integer","null"],"example":100,"description":"`null` means unlimited."}},"required":["used","limit"],"description":"Live Google and Microsoft calendar connections (provider accounts, DB-counted). Disconnecting one frees its slot. `limit` is the plan cap (`null` = unlimited)."},"scoped_keys":{"type":"object","properties":{"count":{"type":"integer","example":3},"limit":{"type":["integer","null"],"example":50,"description":"Plan cap on active agent-scoped keys. `null` means unlimited (Scale)."}},"required":["count","limit"],"description":"Active agent-scoped (`chr_ak_*`) keys. `count` is a direct count; `limit` is the plan cap (`null` = unlimited)."},"holds":{"type":"object","properties":{"created":{"type":"integer","example":24},"confirmed":{"type":"integer","example":18},"expired":{"type":"integer","example":4},"active":{"type":"integer","example":2}},"required":["created","confirmed","expired","active"],"description":"Temporal-hold lifecycle counters for the current period. Informational — not gated by any plan limit. `created`, `confirmed` and `expired` are monthly counters; `expired` covers all three end-of-hold paths (TTL expiry, manual release, priority bump). `active` is a live count of unexpired holds, not a monthly counter."},"cross_calendar_queries":{"type":"object","properties":{"used":{"type":"integer","example":11}},"required":["used"],"description":"Availability requests that touched more than one calendar in the current period. Informational — gated separately by the `cross_calendar_availability` capability, not by this counter."}},"required":["plan","period_start","period_end","resets_at","generated_at","agents","calendars","events","api_calls","webhooks","webhook_endpoints","availability_queries","ical_subscriptions","proposals","recurring_events","booking_pages","calendar_connections","scoped_keys","holds","cross_calendar_queries"]},"UsageHistory":{"type":"object","properties":{"plan":{"type":"string","example":"free"},"months":{"type":"integer","example":6},"limits":{"type":"object","properties":{"api_calls":{"type":["integer","null"],"example":1000},"events":{"type":["integer","null"],"example":100},"webhook_deliveries":{"type":["integer","null"],"example":1000},"availability_queries":{"type":["integer","null"],"example":100},"proposals":{"type":["integer","null"],"example":0}},"required":["api_calls","events","webhook_deliveries","availability_queries","proposals"],"description":"The current plan's limits for the five limited monthly metrics. `null` means unlimited. Historical limits are not recorded, so every month is compared against the current plan."},"data":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$","example":"2026-05"},"period_start":{"type":"string","format":"date-time","example":"2026-05-01T00:00:00.000Z"},"period_end":{"type":"string","format":"date-time","example":"2026-05-31T23:59:59.000Z"},"is_current":{"type":"boolean","description":"True only for the last entry, the current (partial) month.","example":false},"metrics":{"type":"object","properties":{"api_calls":{"type":"integer","minimum":0,"example":1204},"events":{"type":"integer","minimum":0},"webhook_deliveries":{"type":"integer","minimum":0},"availability_queries":{"type":"integer","minimum":0},"proposals":{"type":"integer","minimum":0},"holds_created":{"type":"integer","minimum":0},"holds_confirmed":{"type":"integer","minimum":0},"holds_expired":{"type":"integer","minimum":0},"cross_calendar_queries":{"type":"integer","minimum":0}},"required":["api_calls","events","webhook_deliveries","availability_queries","proposals","holds_created","holds_confirmed","holds_expired","cross_calendar_queries"]}},"required":["period","period_start","period_end","is_current","metrics"]},"description":"One entry per UTC calendar month, oldest first. Months with no usage are zero-filled."}},"required":["plan","months","limits","data"]},"AuditLogEntry":{"type":"object","properties":{"id":{"type":"string","example":"aud_abc123def456"},"action":{"type":"string","example":"agent.create"},"actor_key_prefix":{"type":["string","null"],"description":"First 20 characters of the API key that acted. Only ever a real `chr_` key; null for console sessions and the system.","example":"chr_sk_abcdef12345"},"actor_type":{"type":["string","null"],"enum":["session","org_key","agent_key","system",null],"description":"Who acted: `session` (a console session), `org_key` (the Organization key), `agent_key` (an Agent key) or `system` (Chronary). Null on older entries that could not be attributed.","example":"org_key"},"actor_id":{"type":["string","null"],"description":"API key id for a key, the organization id for a console session, null for the system.","example":"0b6f8c1e-3d2a-4c55-9f7e-1a2b3c4d5e6f"},"actor_label":{"type":["string","null"],"description":"Display name for the actor: the key label (or key prefix), the session email, or `Chronary`.","example":"Production agent key"},"agent_id":{"type":["string","null"],"example":null},"resource":{"type":["string","null"],"example":"agt_1"},"ip":{"type":["string","null"],"example":"203.0.113.10"},"status":{"type":"integer","example":201},"method":{"type":"string","example":"POST"},"path":{"type":"string","description":"Route template (entity IDs replaced with `:id`).","example":"/v1/agents"},"duration_ms":{"type":"integer","example":42},"request_id":{"type":["string","null"],"example":"req_8e9f..."},"created_at":{"type":"string","format":"date-time","example":"2026-05-10T10:00:00.000Z"}},"required":["id","action","actor_key_prefix","actor_type","actor_id","actor_label","agent_id","resource","ip","status","method","path","duration_ms","request_id","created_at"]},"AuditLogResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogEntry"}},"pagination":{"type":"object","properties":{"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. Null if no more results.","example":"MjAyNi0wNS0xMFQxMDowMDowMC4wMDBafGF1ZF8x"}},"required":["next_cursor"]},"retention_days":{"type":["integer","null"],"description":"Audit-log retention window for the caller plan (days). Null = no fixed window (Custom plan: per contract).","example":90},"range_clamped":{"type":"boolean","description":"True when the requested `from` was outside the retention window and the server clamped it. UI uses this to render an upgrade hint.","example":false}},"required":["data","pagination","retention_days","range_clamped"]},"ScopedApiKey":{"type":"object","properties":{"id":{"type":"string","example":"db59cb2d-5bd6-4631-84e7-c65db55ff9f9"},"key_prefix":{"type":"string","example":"chr_ak_0A1B2C3D4E5F6G7H"},"agent_id":{"type":"string","example":"agt_01H9X4M2P5R8T6V0"},"label":{"type":["string","null"],"example":"Customer A"},"created_at":{"type":"string","format":"date-time","example":"2026-04-17T16:20:00.000Z"},"last_used_at":{"type":["string","null"],"format":"date-time","description":"When the key last authenticated a request. Approximate; updated at most every 5 minutes. `null` if never used.","example":"2026-04-17T16:25:00.000Z"},"last_used_user_agent":{"type":["string","null"],"description":"The `User-Agent` of the last request recorded in `last_used_at` (first 256 characters).","example":"chronary-node/1.4.0"},"created_via":{"type":"string","enum":["signup","console","api","mcp","unknown"],"description":"Which surface created the key. `unknown` for keys created before this was recorded.","example":"api"},"created_by_key_prefix":{"type":["string","null"],"description":"Prefix of the Organization key that created this key. Set for `api` and `mcp`, otherwise `null`.","example":"chr_sk_0A1B2C3D4E5F6"},"note":{"type":["string","null"],"description":"Free-text note about the key (where it is stored). Visible only to your team; set in the console.","example":"Used by the scheduler worker"},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the key stops working; after it, requests fail with 401 `key_expired`. Set with `expires_in` at creation. `null` = never expires.","example":"2026-07-16T16:20:00.000Z"}},"required":["id","key_prefix","agent_id","label","created_at","last_used_at","last_used_user_agent","created_via","created_by_key_prefix","note","expires_at"]},"CreatedScopedApiKey":{"allOf":[{"$ref":"#/components/schemas/ScopedApiKey"},{"type":"object","properties":{"key":{"type":"string","example":"chr_ak_0123456789ABCDEFghijklmnopqrstuvwxyz0123456"}},"required":["key"]}]},"ScopedApiKeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ScopedApiKey"}}},"required":["keys"]},"CreateAgent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"type":{"type":"string","enum":["ai","human","resource"]},"description":{"type":"string","maxLength":5000},"metadata":{"type":"object","additionalProperties":{}}},"required":["name","type"]},"UpdateAgent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":["string","null"],"maxLength":5000},"metadata":{"type":"object","additionalProperties":{}},"status":{"type":"string","enum":["active","paused"]}}},"ListAgentsQuery":{"type":"object","properties":{"type":{"type":"string","enum":["ai","human","resource"]},"status":{"type":"string","enum":["active","paused","decommissioned"]},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"q":{"type":"string","minLength":1,"maxLength":100,"description":"Search: a case-insensitive substring of the agent name, or an exact agent id"},"sort":{"type":"string","enum":["created_at","name"],"description":"Sort order: `created_at` (default) is newest first; `name` is A to Z. Ties break on id"},"include_decommissioned":{"type":"string","enum":["true","false"],"description":"Include decommissioned (deleted) agents. Default false; ignored when `status` is set"},"include_counts":{"type":"string","enum":["true","false"],"description":"Add `calendar_count` and `scoped_key_count` to each agent"},"cursor":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"}}},"CreateCalendar":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"timezone":{"type":"string","minLength":1,"maxLength":64},"agent_status":{"type":"string","enum":["idle","working","waiting","error"]},"default_reminders":{"type":["array","null"],"items":{"type":"integer","minimum":1,"maximum":40320},"maxItems":5},"metadata":{"type":"object","additionalProperties":{}}},"required":["name","timezone"]},"UpdateCalendar":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"timezone":{"type":"string","minLength":1,"maxLength":64},"agent_status":{"type":"string","enum":["idle","working","waiting","error"]},"default_reminders":{"type":["array","null"],"items":{"type":"integer","minimum":1,"maximum":40320},"maxItems":5},"metadata":{"type":"object","additionalProperties":{}}}},"ListCalendarsQuery":{"type":"object","properties":{"include":{"type":"string","enum":["all"]},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"q":{"type":"string","minLength":1,"maxLength":100,"description":"Search: a case-insensitive substring of the calendar name, or an exact calendar id"},"cursor":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"}}},"ListAgentCalendarsQuery":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"q":{"type":"string","minLength":1,"maxLength":100,"description":"Search: a case-insensitive substring of the calendar name, or an exact calendar id"},"cursor":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"}}},"CreateBookingPage":{"type":"object","properties":{"calendar_id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"duration_minutes":{"type":"integer","minimum":5,"maximum":480,"default":30},"buffer_minutes":{"type":"integer","minimum":0,"maximum":120,"default":0},"window_days":{"type":"integer","minimum":1,"maximum":365,"default":14},"min_notice_minutes":{"type":"integer","minimum":0,"maximum":40320,"default":0},"timezone":{"type":"string","minLength":1,"maxLength":64,"default":"UTC"},"availability_constraints":{"type":["object","null"],"properties":{"mon":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"tue":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"wed":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"thu":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"fri":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sat":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sun":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]}}},"active":{"type":"boolean","default":true}},"required":["calendar_id","title"]},"UpdateBookingPage":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000},"duration_minutes":{"type":"integer","minimum":5,"maximum":480},"buffer_minutes":{"type":"integer","minimum":0,"maximum":120},"window_days":{"type":"integer","minimum":1,"maximum":365},"min_notice_minutes":{"type":"integer","minimum":0,"maximum":40320},"timezone":{"type":"string","minLength":1,"maxLength":64},"availability_constraints":{"type":["object","null"],"properties":{"mon":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"tue":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"wed":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"thu":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"fri":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sat":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sun":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]}}},"active":{"type":"boolean"}}},"ListBookingPagesQuery":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"calendar_id":{"type":"string","maxLength":64,"description":"Only pages bound to this calendar"}}},"ListBookingsQuery":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":50},"cursor":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page"}}},"SubmitBooking":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","maxLength":320,"format":"email"},"notes":{"type":"string","maxLength":2000},"start":{"type":"string","format":"date-time"}},"required":["name","email","start"]},"BookingSlotsQuery":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}}},"CreateEvent":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"start_time":{"type":"string","format":"date-time"},"end_time":{"type":"string","format":"date-time"},"description":{"type":"string","maxLength":10000},"all_day":{"type":"boolean","default":false},"status":{"type":"string","enum":["confirmed","tentative","cancelled","hold"],"default":"confirmed"},"metadata":{"type":"object","additionalProperties":{}},"reminders":{"type":["array","null"],"items":{"type":"integer","minimum":1,"maximum":40320},"maxItems":5},"recurrence_rule":{"type":"string","minLength":1,"maxLength":256},"timezone":{"type":"string","minLength":1,"maxLength":64},"hold_expires_at":{"type":"string","format":"date-time"},"hold_priority":{"type":"integer","minimum":0,"maximum":100}},"required":["title","start_time","end_time"]},"UpdateEvent":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":["string","null"],"maxLength":10000},"start_time":{"type":"string","format":"date-time"},"end_time":{"type":"string","format":"date-time"},"all_day":{"type":"boolean"},"status":{"type":"string","enum":["confirmed","tentative","cancelled"]},"metadata":{"type":"object","additionalProperties":{}},"reminders":{"type":["array","null"],"items":{"type":"integer","minimum":1,"maximum":40320},"maxItems":5},"recurrence_rule":{"type":["string","null"],"minLength":1,"maxLength":256},"timezone":{"type":["string","null"],"minLength":1,"maxLength":64}}},"ListEventsQuery":{"type":"object","properties":{"start_after":{"type":"string","format":"date-time"},"start_before":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["confirmed","tentative","cancelled","hold"]},"source":{"type":"string","enum":["internal","external_ical"]},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"expand":{"type":"string","enum":["true","false"],"default":"false"}}},"ListOrgEventsQuery":{"type":"object","properties":{"start_after":{"type":"string","format":"date-time"},"start_before":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["confirmed","tentative","cancelled","hold"]},"source":{"type":"string","enum":["internal","external_ical"]},"limit":{"type":"integer","minimum":1,"maximum":100,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"expand":{"type":"string","enum":["true","false"],"default":"false"},"calendar_id":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Only these calendars. Repeat the parameter for several (at most 50)"},"agent_id":{"type":"string","description":"Only this agent's calendars"},"q":{"type":"string","minLength":1,"maxLength":100,"description":"Case-insensitive title search. Requires start_after and start_before at most 31 days apart"},"cursor":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"}}},"DeleteEventQuery":{"type":"object","properties":{"occurrence_start":{"type":"string","format":"date-time"}}},"AvailabilityQuery":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"},"duration":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"slot_duration":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"include_busy":{"type":"string","enum":["true","false"],"default":"false"},"allow_stale":{"type":"string","enum":["true","false"],"default":"false"}},"required":["start","end"]},"CrossAgentAvailabilityQuery":{"type":"object","properties":{"agents":{"type":"string","minLength":1},"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"},"duration":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"slot_duration":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"calendars":{"type":"string","description":"Comma-separated calendar ids whose busy time also blocks slots, at most 50"},"include_busy":{"type":"string","enum":["true","false"],"default":"false"},"allow_stale":{"type":"string","enum":["true","false"],"default":"false"}},"required":["agents","start","end"]},"UpdateAvailabilityRules":{"type":"object","properties":{"buffer_before_minutes":{"type":"integer","minimum":0,"maximum":120,"default":0},"buffer_after_minutes":{"type":"integer","minimum":0,"maximum":120,"default":0},"working_hours":{"type":["object","null"],"properties":{"mon":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"tue":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"wed":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"thu":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"fri":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sat":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sun":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]}},"default":null},"timezone":{"type":"string","minLength":1,"maxLength":64,"default":"UTC"}}},"AvailabilityRules":{"type":"object","properties":{"id":{"type":"string","example":"avr_01H9X4M2P5R8T6V0"},"calendar_id":{"type":"string","example":"cal_01H9X4M2P5R8T6V0"},"buffer_before_minutes":{"type":"number","example":10},"buffer_after_minutes":{"type":"number","example":5},"working_hours":{"example":{"mon":{"start":"09:00","end":"17:00"}}},"timezone":{"type":"string","example":"America/New_York"},"created_at":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"}},"required":["id","calendar_id","buffer_before_minutes","buffer_after_minutes","timezone","created_at","updated_at"]},"CreateWebhook":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"]},"minItems":1}},"required":["url","events"]},"UpdateWebhook":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"]},"minItems":1},"active":{"type":"boolean"}}},"ListWebhooksQuery":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":20},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"expand":{"type":"string","maxLength":100,"description":"Comma-separated extras for each endpoint: `last_delivery`, `failures_24h`"}}},"ListDeliveriesQuery":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":20},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"status":{"type":"string","enum":["pending","delivered","failed","dropped"]},"include_payload":{"type":"string","enum":["true","false"]},"event_type":{"type":"string","maxLength":100,"pattern":"^[a-z_]+\\.(?:[a-z_]+)?$","description":"An exact event type (`event.created`), or a prefix ending in a dot (`event.`) for every type in that group"},"created_after":{"type":"string","format":"date-time","description":"Only deliveries created at or after this time (ISO 8601; `Z` or a numeric offset)"},"created_before":{"type":"string","format":"date-time","description":"Only deliveries created before this time (ISO 8601; `Z` or a numeric offset)"},"delivery_id":{"type":"string","maxLength":100,"pattern":"^whd_[A-Za-z0-9_-]+$","description":"Only the delivery with this id"},"is_test":{"type":"string","enum":["true","false"],"description":"`true` for test events only, `false` to leave them out"},"cursor":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"}}},"SendTestWebhook":{"type":"object","properties":{"event_type":{"type":"string","enum":["agent.created","agent.updated","event.created","event.updated","event.deleted","event.started","event.ended","event.reminder","event.hold_created","event.hold_expired","event.hold_released","event.hold_confirmed","proposal.created","proposal.responded","proposal.confirmed","proposal.expired","proposal.cancelled","webhook.deactivated","org.plan_changed","calendar_connection.reauthorization_required","usage.threshold_crossed"]}},"required":["event_type"]},"RotateWebhookSecret":{"type":"object","properties":{"expire_old_in":{"type":"string","enum":["now","1h","24h","7d"],"default":"24h"}}},"CreateScopedApiKey":{"type":"object","properties":{"agent_id":{"type":"string","pattern":"^agt_"},"label":{"type":"string","minLength":1,"maxLength":100},"expires_in":{"type":"string","enum":["30d","60d","90d","180d","365d"],"description":"When the key stops working, from now. Omit for a key that never expires. After it expires, requests fail with 401 `key_expired`.","example":"90d"}},"required":["agent_id"]},"CreateICalSubscription":{"type":"object","properties":{"calendar_id":{"type":"string","minLength":1},"url":{"type":"string","maxLength":2048,"format":"uri"},"label":{"type":"string","minLength":1,"maxLength":255}},"required":["calendar_id","url"]},"UpdateICalSubscription":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":255},"url":{"type":"string","maxLength":2048,"format":"uri"}}},"ListICalSubscriptionsQuery":{"type":"object","properties":{"status":{"type":"string","enum":["active","error","paused"]},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"}}},"TermsVersion":{"type":"object","properties":{"version":{"type":"string","example":"2026-11-12"},"effective_at":{"type":"string","example":"2026-04-26"},"url":{"type":"string","example":"https://chronary.ai/terms/v/2026-11-12"},"material":{"type":"boolean","description":"When `true`, clients should block on re-acceptance."}},"required":["version","effective_at","url","material"]},"ReacceptRequest":{"type":"object","properties":{"tos_version":{"type":"string","minLength":1,"example":"2026-11-12","description":"Must equal `CURRENT_TERMS_VERSION`."}},"required":["tos_version"]},"ReacceptResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"accepted_terms_version":{"type":"string","example":"2026-11-12"},"accepted_terms_at":{"type":"string","format":"date-time","example":"2026-04-24T02:30:00.000Z"}},"required":["accepted_terms_version","accepted_terms_at"]}},"required":["data"]},"TermsAcceptResponse":{"type":"object","properties":{"accepted_terms_version":{"type":"string","example":"2026-11-12"},"accepted_terms_at":{"type":"string","format":"date-time","example":"2026-05-11T00:00:00.000Z"}},"required":["accepted_terms_version","accepted_terms_at"]},"DataExport":{"type":"object","properties":{"exported_at":{"type":"string","format":"date-time"},"format_version":{"type":"string","enum":["1"]},"org":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"plan":{"type":"string"},"signup_source":{"type":"string"},"status":{"type":"string"},"oauth_provider":{"type":["string","null"]},"oauth_provider_id":{"type":["string","null"]},"email_verified":{"type":"boolean"},"onboarding_completed_at":{"type":["string","null"],"format":"date-time"},"accepted_terms_version":{"type":["string","null"]},"accepted_terms_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","email","plan","signup_source","status","oauth_provider","oauth_provider_id","email_verified","onboarding_completed_at","accepted_terms_version","accepted_terms_at","created_at","updated_at"]},"agents":{"type":"array","items":{}},"calendars":{"type":"array","items":{}},"events":{"type":"array","items":{}},"availability_rules":{"type":"array","items":{}},"ical_subscriptions":{"type":"array","items":{}},"webhook_subscriptions":{"type":"array","items":{}},"api_keys":{"type":"array","items":{}},"scheduling_proposals":{"type":"array","items":{}},"proposal_slots":{"type":"array","items":{}},"proposal_responses":{"type":"array","items":{}},"usage_records":{"type":"array","items":{}},"quota_counters":{"type":"array","items":{}},"tos_acceptances":{"type":"array","items":{}},"account_claims_initiated":{"type":"array","items":{}},"account_claims_targeting_this_org":{"type":"array","items":{}},"feedback_submissions":{"type":"array","items":{}},"upgrade_requests":{"type":"array","items":{}},"booking_pages":{"type":"array","items":{}},"audit_log":{"type":"array","items":{}},"provider_accounts":{"type":"array","items":{}},"external_calendars":{"type":"array","items":{}},"availability_grants":{"type":"array","items":{}},"publication_bindings":{"type":"array","items":{}},"connection_setup_links":{"type":"array","items":{}},"webhook_deliveries":{"type":"array","items":{}}},"required":["exported_at","format_version","org","agents","calendars","events","availability_rules","ical_subscriptions","webhook_subscriptions","api_keys","scheduling_proposals","proposal_slots","proposal_responses","usage_records","quota_counters","tos_acceptances","account_claims_initiated","account_claims_targeting_this_org","feedback_submissions","upgrade_requests","booking_pages","audit_log","provider_accounts","external_calendars","availability_grants","publication_bindings","connection_setup_links","webhook_deliveries"]},"ClaimInitiateRequest":{"type":"object","properties":{"agent_org_email":{"type":"string","format":"email","example":"agent@example.com"}},"required":["agent_org_email"]},"ClaimInitiateResponse":{"type":"object","properties":{"claim_id":{"type":"string","format":"uuid"},"message":{"type":"string"}},"required":["claim_id","message"]},"ClaimVerifyRequest":{"type":"object","properties":{"claim_id":{"type":"string","format":"uuid"},"otp":{"type":"string","pattern":"^\\d{6}$","example":"123456"}},"required":["claim_id","otp"]},"ClaimVerifyResponse":{"type":"object","properties":{"claim_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["verified"]},"revocation_window_ends_at":{"type":"string","format":"date-time"},"expected_completion_at":{"type":"string","format":"date-time"}},"required":["claim_id","status","revocation_window_ends_at","expected_completion_at"]},"ClaimRevokeRequest":{"type":"object","properties":{"revocation_token":{"type":"string"}},"required":["revocation_token"]},"ClaimRevokeResponse":{"type":"object","properties":{"revoked":{"type":"boolean","enum":[true]}},"required":["revoked"]},"ClaimRevokePreviewResponse":{"type":"object","properties":{"claim_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["verified"]},"target_org_email_masked":{"type":"string"},"claiming_org_email_masked":{"type":["string","null"]},"verified_at":{"type":"string","format":"date-time"},"revocation_window_ends_at":{"type":"string","format":"date-time"}},"required":["claim_id","status","target_org_email_masked","claiming_org_email_masked","verified_at","revocation_window_ends_at"]},"Claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"target_org_email_masked":{"type":"string"},"status":{"type":"string","enum":["pending","verified","completed","revoked","failed"]},"created_at":{"type":"string","format":"date-time"},"verified_at":{"type":["string","null"],"format":"date-time"},"revocation_window_ends_at":{"type":["string","null"],"format":"date-time"},"expected_completion_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"revoked_at":{"type":["string","null"],"format":"date-time"},"failure_reason":{"type":["string","null"]}},"required":["id","target_org_email_masked","status","created_at","verified_at","revocation_window_ends_at","expected_completion_at","completed_at","revoked_at","failure_reason"]},"ClaimsListResponse":{"type":"object","properties":{"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}}},"required":["claims"]},"EmailChangeRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]},"EmailChangePendingResponse":{"type":"object","properties":{"pending_email":{"type":"string","format":"email"},"pending_email_expires_at":{"type":"string","format":"date-time"}},"required":["pending_email","pending_email_expires_at"]},"EmailChangeTokenRequest":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":128}},"required":["token"]},"EmailChangeConfirmResponse":{"type":"object","properties":{"email":{"type":"string","format":"email"},"email_verified":{"type":"boolean","enum":[true]},"signed_in":{"type":"boolean"},"token":{"type":"string","description":"Session token; non-production only, when signed_in is true."}},"required":["email","email_verified","signed_in"]},"ChangePasswordRequest":{"type":"object","properties":{"current_password":{"type":"string","minLength":1,"maxLength":256},"new_password":{"type":"string","minLength":1,"maxLength":256,"description":"8 to 128 characters. Passwords found in known data breaches are rejected."}},"required":["current_password","new_password"]},"ChangePasswordResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"password_updated_at":{"type":"string","format":"date-time"},"token":{"type":"string","description":"Session token; non-production only."}},"required":["ok","password_updated_at"]},"SetPasswordLinkResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"expires_at":{"type":"string","format":"date-time","description":"When the emailed link stops working (1 hour)."}},"required":["ok","expires_at"]},"OAuthLinkStartResponse":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"Send the browser here to sign in at the provider."}},"required":["authorization_url"]},"OAuthLinkConfirmRequest":{"type":"object","properties":{"link_token":{"type":"string","minLength":16,"maxLength":128,"description":"The single-use `link_token` the provider callback appended to the Security page URL."}},"required":["link_token"]},"OAuthLinkConfirmResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"provider":{"type":"string","enum":["google","github","microsoft"]}},"required":["ok","provider"]},"AccountDeletionScheduled":{"type":"object","properties":{"deletion_scheduled_at":{"type":"string","format":"date-time","description":"When the organization and its data are permanently deleted (7 days after the request).","example":"2026-11-07T12:00:00.000Z"}},"required":["deletion_scheduled_at"]},"AccountDeletionCancelled":{"type":"object","properties":{"deletion_scheduled_at":{"type":"null"},"billing_resumed":{"type":"boolean","description":"True when the plan renews again; false when there is no plan to resume or it was already set to end before the deletion."}},"required":["deletion_scheduled_at","billing_resumed"]},"WebhookCreated":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string","example":"whsec_abc123...","description":"HMAC-SHA256 signing secret — returned once at creation time only. Store it securely."}},"required":["secret"]}]},"ProposalSlot":{"type":"object","properties":{"id":{"type":"string","example":"slt_abc123def456"},"start_time":{"type":"string","format":"date-time","example":"2026-05-01T10:00:00.000Z"},"end_time":{"type":"string","format":"date-time","example":"2026-05-01T11:00:00.000Z"},"weight":{"type":"number","example":1.5},"calendar_id":{"type":["string","null"],"example":"cal_abc123def456"}},"required":["id","start_time","end_time","weight","calendar_id"]},"ProposalResponse":{"type":"object","properties":{"id":{"type":"string","example":"rsp_abc123def456"},"agent_id":{"type":"string","example":"agt_abc123def456"},"response":{"type":"string","enum":["accept","decline","counter"],"example":"accept"},"selected_slot_id":{"type":["string","null"],"example":"slt_abc123def456"},"counter_slots":{"type":["array","null"],"items":{"type":"object","additionalProperties":{}},"example":null},"message":{"type":["string","null"],"example":null},"created_at":{"type":"string","format":"date-time","example":"2026-04-15T10:00:00.000Z"}},"required":["id","agent_id","response","selected_slot_id","counter_slots","message","created_at"]},"Proposal":{"type":"object","properties":{"id":{"type":"string","example":"spr_abc123def456"},"title":{"type":"string","example":"Q2 planning sync"},"description":{"type":["string","null"],"example":"Quarterly planning discussion"},"organizer_agent_id":{"type":"string","example":"agt_abc123def456"},"participant_agent_ids":{"type":"array","items":{"type":"string"},"example":["agt_abc123def456","agt_xyz789"]},"calendar_id":{"type":"string","example":"cal_abc123def456"},"status":{"type":"string","enum":["pending","resolving","confirmed","expired","cancelled"],"example":"pending","description":"`resolving` is the brief state while a resolve creates the event; it returns to `pending` if the resolve fails. `confirmed`, `expired` and `cancelled` are terminal."},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-05-01T00:00:00.000Z"},"resolved_slot":{"type":["object","null"],"additionalProperties":{},"example":null},"created_event_id":{"type":["string","null"],"example":null},"metadata":{"type":"object","additionalProperties":{},"example":{}},"created_at":{"type":"string","format":"date-time","example":"2026-04-15T10:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-04-15T10:00:00.000Z"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/ProposalSlot"}},"responses":{"type":"array","items":{"$ref":"#/components/schemas/ProposalResponse"}}},"required":["id","title","description","organizer_agent_id","participant_agent_ids","calendar_id","status","expires_at","resolved_slot","created_event_id","metadata","created_at","updated_at","slots","responses"]},"ProposalSummary":{"type":"object","properties":{"id":{"type":"string","example":"spr_abc123def456"},"title":{"type":"string","example":"Q2 planning sync"},"description":{"type":["string","null"],"example":null},"organizer_agent_id":{"type":"string","example":"agt_abc123def456"},"participant_agent_ids":{"type":"array","items":{"type":"string"},"example":["agt_abc123def456"]},"calendar_id":{"type":"string","example":"cal_abc123def456"},"status":{"type":"string","enum":["pending","resolving","confirmed","expired","cancelled"],"example":"pending","description":"`resolving` is the brief state while a resolve creates the event; it returns to `pending` if the resolve fails. `confirmed`, `expired` and `cancelled` are terminal."},"expires_at":{"type":["string","null"],"format":"date-time","example":null},"resolved_slot":{"type":["object","null"],"additionalProperties":{},"example":null},"created_event_id":{"type":["string","null"],"example":null},"metadata":{"type":"object","additionalProperties":{},"example":{}},"created_at":{"type":"string","format":"date-time","example":"2026-04-15T10:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-04-15T10:00:00.000Z"}},"required":["id","title","description","organizer_agent_id","participant_agent_ids","calendar_id","status","expires_at","resolved_slot","created_event_id","metadata","created_at","updated_at"]},"ProposalList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProposalSummary"}},"total":{"type":"integer","example":5},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}},"required":["data","total","limit","offset"]},"RespondToProposalBody":{"type":"object","properties":{"agent_id":{"type":"string"},"response":{"type":"string","enum":["accept","decline","counter"]},"selected_slot_id":{"type":"string","description":"Required when response is \"accept\""},"counter_slots":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Informational alternatives when countering"},"message":{"type":"string"}},"required":["agent_id","response"]},"ResolveResult":{"type":"object","properties":{"status":{"type":"string"},"resolved_slot":{"type":["object","null"],"additionalProperties":{}}},"required":["status","resolved_slot"]},"CancelResult":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]},"AgentSignUpBody":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"agent@example.com"},"agent_name":{"type":"string","minLength":1,"maxLength":100,"example":"Support Agent"},"tos_version":{"type":"string","minLength":1,"example":"2026-11-12"}},"required":["email","agent_name","tos_version"]},"AgentSignUpNewOrgResponse":{"type":"object","properties":{"org_id":{"type":"string","example":"org_a1b2c3d4-e5f6-7890-1234-567890abcdef"},"agent_id":{"type":"string","example":"agt_abcd1234xyz0"},"api_key":{"type":"string","example":"chr_sk_..."},"message":{"type":"string","example":"Verification code sent to email"}},"required":["org_id","agent_id","api_key","message"]},"AgentSignUpOpaqueResponse":{"type":"object","properties":{"message":{"type":"string","example":"Verification code sent to email"}},"required":["message"]},"AgentSignUpWaitlistedResponse":{"type":"object","properties":{"waitlisted":{"type":"boolean","enum":[true],"example":true},"message":{"type":"string","example":"Sign-ups are paused, so no API key was issued. If this email is new, it's on the waitlist and an admin will activate the account. Already have an account? Use its existing API key."}},"required":["waitlisted","message"]},"AgentVerifyBody":{"type":"object","properties":{"otp":{"type":"string","minLength":6,"maxLength":6,"pattern":"^\\d+$","example":"123456"}},"required":["otp"]},"AgentVerifyResponse":{"type":"object","properties":{"verified":{"type":"boolean","enum":[true],"example":true},"sandbox_promotion":{"type":["string","null"],"enum":["promoted","capacity_full",null],"example":"promoted","description":"`promoted`: the org left the Sandbox tier. `capacity_full` (only before general availability): verified, but early access is full, so the org keeps Sandbox limits until a spot opens. `null`: the org was not on Sandbox."},"message":{"type":"string","example":"Full access unlocked"}},"required":["verified","sandbox_promotion","message"]},"WaitlistJoinRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"dev@acme.ai"},"name":{"type":"string","minLength":2,"maxLength":100,"example":"Acme AI"},"tos_version":{"type":"string","minLength":1,"example":"2026-11-12"},"intent":{"type":"string","maxLength":200,"example":"Building an AI scheduling agent for sales teams.","description":"\"What are you building?\" — free-text, capped at 200 chars."},"turnstile_token":{"type":"string","maxLength":2048,"description":"Human-verification token from the challenge on the console waitlist form. Required only while the challenge is switched on; a missing or rejected token then returns 400 `challenge_failed`."}},"required":["email"]},"WaitlistJoinResponse":{"type":"object","properties":{"waitlisted":{"type":"boolean","enum":[true],"example":true},"message":{"type":"string","example":"Thanks, you're on the list. We'll email you when your spot opens. Already have an account? Sign in instead."}},"required":["waitlisted","message"]},"CapacityResponse":{"type":"object","properties":{"percent_full":{"type":"integer","minimum":0,"maximum":100,"example":42,"description":"Percent of soft-launch slots currently occupied. 0–100."},"status":{"type":"string","enum":["open","full"],"example":"open","description":"`open` when new auto-approvals are accepted; `full` when at capacity."}},"required":["percent_full","status"]},"InviteVerifyResponse":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"dev@acme.ai"},"expires_at":{"type":"string","example":"2026-05-22T12:00:00.000Z"}},"required":["email","expires_at"]},"InviteClaimRequest":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":4096,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.…"}},"required":["token"]},"InviteClaimResponse":{"type":"object","properties":{"org_id":{"type":"string","example":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"},"agent_id":{"type":"string","example":"agt_abc123"},"api_key":{"type":"string","example":"chr_sk_…"},"plan":{"type":"string","enum":["pro"],"example":"pro"},"plan_expires_at":{"type":["string","null"],"example":"2026-12-01T00:00:00.000Z"}},"required":["org_id","agent_id","api_key","plan","plan_expires_at"]},"CreateFeedback":{"type":"object","properties":{"type":{"type":"string","enum":["bug","feature","friction","support"],"example":"bug"},"message":{"type":"string","minLength":10,"maxLength":2000,"example":"The availability endpoint returns empty slots when timezone is UTC+13."},"context":{"type":"object","additionalProperties":{},"example":{"sdk_name":"chronary-python","sdk_version":"0.4.2","endpoint":"GET /v1/availability"}}},"required":["type","message"]},"FeedbackAccepted":{"type":"object","properties":{"status":{"type":"string","enum":["accepted"],"example":"accepted"}},"required":["status"]},"CalendarConnectionSummary":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["google","microsoft"]},"account_label":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."},"status":{"type":"string","enum":["active","paused","reauthorization_required","disconnected"]},"reauthorization_reason":{"type":["string","null"]},"selected_calendar_count":{"type":"integer","minimum":0},"last_authenticated_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"health":{"type":"object","properties":{"freshness":{"type":"string","enum":["current","stale","never_synced"]},"last_successful_sync_at":{"type":["string","null"],"format":"date-time"},"impacted_agent_count":{"type":"integer","minimum":0}},"required":["freshness","last_successful_sync_at","impacted_agent_count"]}},"required":["id","provider","account_label","status","reauthorization_reason","selected_calendar_count","last_authenticated_at","created_at","health"]},"CalendarConnectionDetail":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["google","microsoft"]},"account_label":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."},"status":{"type":"string","enum":["active","paused","reauthorization_required","disconnected"]},"reauthorization_reason":{"type":["string","null"]},"health":{"type":"object","properties":{"freshness":{"type":"string","enum":["current","stale","never_synced"]},"last_successful_sync_at":{"type":["string","null"],"format":"date-time"},"impacted_agent_count":{"type":"integer","minimum":0}},"required":["freshness","last_successful_sync_at","impacted_agent_count"]},"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"access_role":{"type":["string","null"]},"primary":{"type":"boolean"},"timezone":{"type":["string","null"]},"availability_readable":{"type":"boolean"},"writable":{"type":"boolean"},"selected":{"type":"boolean"},"availability_source_active":{"type":"boolean"},"active_elsewhere":{"type":"boolean"},"sync":{"type":"object","properties":{"status":{"type":["string","null"],"enum":["pending","syncing","current","stale","partial","unavailable",null]},"last_attempted_at":{"type":["string","null"],"format":"date-time"},"last_successful_sync_at":{"type":["string","null"],"format":"date-time"},"last_error_category":{"type":["string","null"]}},"required":["status","last_attempted_at","last_successful_sync_at","last_error_category"]}},"required":["id","name","access_role","primary","timezone","availability_readable","writable","selected","availability_source_active","active_elsewhere","sync"]}}},"required":["id","provider","account_label","status","reauthorization_reason","health","calendars"]},"ExternalCalendar":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"access_role":{"type":["string","null"]},"primary":{"type":"boolean"},"timezone":{"type":["string","null"]},"availability_readable":{"type":"boolean"},"writable":{"type":"boolean"},"selected":{"type":"boolean"},"availability_source_active":{"type":"boolean"},"active_elsewhere":{"type":"boolean"},"sync":{"type":"object","properties":{"status":{"type":["string","null"],"enum":["pending","syncing","current","stale","partial","unavailable",null]},"last_attempted_at":{"type":["string","null"],"format":"date-time"},"last_successful_sync_at":{"type":["string","null"],"format":"date-time"},"last_error_category":{"type":["string","null"]}},"required":["status","last_attempted_at","last_successful_sync_at","last_error_category"]}},"required":["id","name","access_role","primary","timezone","availability_readable","writable","selected","availability_source_active","active_elsewhere","sync"]},"AvailabilityGrant":{"type":"object","properties":{"id":{"type":"string"},"audience":{"type":"string","enum":["selected_agents","all_current_agents","all_org_agents"]},"audience_cutoff_at":{"type":["string","null"],"format":"date-time"},"active":{"type":"boolean"},"external_calendar_ids":{"type":"array","items":{"type":"string"}},"agent_ids":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"}},"required":["id","audience","audience_cutoff_at","active","external_calendar_ids","agent_ids","created_at"]},"ExternalDestination":{"type":"object","properties":{"id":{"type":"string"},"calendar_id":{"type":"string"},"external_calendar_id":{"type":"string"},"policy":{"type":"string","enum":["confirmed","confirmed_tentative"]},"active":{"type":"boolean"}},"required":["id","calendar_id","external_calendar_id","policy","active"]},"ConnectionLink":{"type":"object","properties":{"id":{"type":"string"},"calendar_id":{"type":"string"},"status":{"type":"string","enum":["awaiting_human","in_progress","completed","declined","expired","cancelled"]},"expires_at":{"type":"string","format":"date-time"},"connection_id":{"type":["string","null"]},"requesting_agent_id":{"type":["string","null"]},"requested_capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."},"requested_publication_policy":{"type":["string","null"],"enum":["confirmed","confirmed_tentative",null]},"created_at":{"type":"string","format":"date-time"}},"required":["id","calendar_id","status","expires_at"]},"CreatedConnectionLink":{"type":"object","properties":{"id":{"type":"string"},"calendar_id":{"type":"string"},"status":{"type":"string","enum":["awaiting_human","in_progress","completed","declined","expired","cancelled"]},"expires_at":{"type":"string","format":"date-time"},"setup_url":{"type":["string","null"],"format":"uri"},"reused":{"type":"boolean"}},"required":["id","calendar_id","status","expires_at","setup_url","reused"]},"ConnectionLinkList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionLink"}}},"required":["data"]},"DeclinedConnectionLink":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["declined"]}},"required":["id","status"]},"PublishingFailure":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"calendar_id":{"type":"string"},"last_error_category":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}},"required":["id","event_id","calendar_id","last_error_category","updated_at"]},"PublishingFailureList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PublishingFailure"}}},"required":["data"]},"PublishingFailureRetry":{"type":"object","properties":{"id":{"type":"string"},"sync_status":{"type":"string"}},"required":["id","sync_status"]},"PublishingDestination":{"type":"object","properties":{"calendar_id":{"type":"string"},"calendar_name":{"type":"string"},"agent_id":{"type":["string","null"]},"agent_name":{"type":["string","null"]},"external_calendar_id":{"type":"string"},"policy":{"type":"string","enum":["confirmed","confirmed_tentative"]},"last_publish_status":{"type":["string","null"],"enum":["ok","failed",null]},"last_published_at":{"type":["string","null"],"format":"date-time"},"failures_7d":{"type":"integer","minimum":0},"recent_failures":{"type":"array","items":{"$ref":"#/components/schemas/PublishingFailure"}}},"required":["calendar_id","calendar_name","agent_id","agent_name","external_calendar_id","policy","last_publish_status","last_published_at","failures_7d","recent_failures"]},"PublishingDestinationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PublishingDestination"}}},"required":["data"]},"CalendarConnectionOAuthStart":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri"}},"required":["authorization_url"]},"CalendarConnectionOAuthComplete":{"type":"object","properties":{"connection_id":{"type":"string"},"setup_link_id":{"type":["string","null"]},"provider":{"type":"string","enum":["google","microsoft"]}},"required":["connection_id","setup_link_id","provider"]},"CalendarConnectionMutation":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","paused","reauthorization_required","disconnected"]}},"required":["id","status"]},"CalendarConnectionRefresh":{"type":"object","properties":{"status":{"type":"string","enum":["current","partial"]},"synced_calendars":{"type":"integer","minimum":0},"refreshed":{"type":"boolean"}},"required":["status","synced_calendars","refreshed"]},"CalendarConnectionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CalendarConnectionSummary"}}},"required":["data"]},"ExternalCalendarList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExternalCalendar"}}},"required":["data"]},"AvailabilityGrantList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AvailabilityGrant"}}},"required":["data"]},"ExternalDestinationResult":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/ExternalDestination"},{"type":"null"}]}},"required":["data"]},"UpgradeRequest":{"type":"object","properties":{"id":{"type":"string","example":"upr_V1StGXR8Z5jd"},"status":{"type":"string","enum":["pending","completed","declined","canceled","expired"],"example":"pending"},"plan":{"type":"string","enum":["developer","pro"]},"interval":{"type":"string","enum":["month","year"],"example":"month"},"reason":{"type":["string","null"],"description":"Note from the agent, shown to the human as plain text on the approval page. Never emailed."},"feature":{"type":["string","null"],"example":"scoped_keys","description":"Paid-plan feature that triggered the request"},"metric":{"type":["string","null"],"example":null,"description":"Usage limit that triggered the request"},"requested_via":{"type":"string","enum":["api","mcp"]},"requested_by_key_prefix":{"type":["string","null"],"description":"First 20 characters of the requesting key; never the full key"},"approval_url":{"type":["string","null"],"example":"https://console.chronary.ai/settings/billing/requests/upr_V1StGXR8Z5jd","description":"Give this to your human. Null once the request is no longer pending."},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time","description":"Pending requests expire 7 days after creation"},"completed_at":{"type":["string","null"],"format":"date-time"},"declined_at":{"type":["string","null"],"format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"owner_notification":{"type":"string","enum":["queued","not_configured","skipped_internal","already_notified","muted"],"description":"Create responses only — whether the account owner was emailed. `muted` means the owner turned upgrade-request emails off."},"reused":{"type":"boolean","description":"Create responses only — true when a pending request already existed; do not create again"}},"required":["id","status","plan","interval","reason","feature","metric","requested_via","requested_by_key_prefix","approval_url","created_at","expires_at","completed_at","declined_at","canceled_at"]},"BillingOffer":{"type":"object","properties":{"kind":{"type":"string","enum":["founding"]},"status":{"type":"string","enum":["upcoming","available","redeemed"],"description":"`upcoming` — early-access account; the offer opens at launch (checkout returns 409 `founding_offer_pending` until then). `available` — free Pro until `ends_at`; subscribe before then at the founding discount. The offer is withdrawn 35 minutes before `ends_at`, when a founding checkout can no longer complete. `redeemed` — the subscription was created on founding terms."},"ends_at":{"type":["string","null"],"format":"date-time","description":"available: when free Pro and the offer end"},"trial_until":{"type":["string","null"],"format":"date-time","description":"available: billing starts on this date if you subscribe now (the founding trial end, 12:00 UTC on the day `ends_at` falls on; null in the last ~2 days: billing starts at checkout). redeemed: trial end while trialing."},"discount_percent":{"type":["integer","null"],"example":50,"description":"The founding discount in percent, or null when none applies. redeemed: the discount on the subscription. During a founding trial heading to a plan below Pro (`pending_plan`, no cancellation scheduled), the discount the account gets back by switching back to Pro before the trial ends (that plan carries none)."},"discount_months":{"type":["integer","null"],"example":12,"description":"Paid months the discount covers (annual: the first year); same cases as `discount_percent`"},"renewal_consent":{"type":["string","null"],"enum":["required","given",null],"description":"redeemed: `required` while a trial with a Washington DC billing address waits for the human to choose \"Continue to paid Pro\" (or the plan billing starts on) on the console Billing page (otherwise the subscription ends at the trial end, with no charge); `given` once they have. Null otherwise. Agents cannot give this consent."}},"required":["kind","status","ends_at","trial_until","discount_percent","discount_months","renewal_consent"]},"BillingSummary":{"type":"object","properties":{"plan":{"type":"string","example":"free"},"plan_source":{"type":["string","null"]},"plan_expires_at":{"type":["string","null"],"format":"date-time"},"status":{"type":["string","null"],"description":"Subscription status (active, trialing, past_due, canceled, …); null if never subscribed"},"interval":{"type":["string","null"],"enum":["month","year",null],"example":"month"},"current_period_end":{"type":["string","null"],"format":"date-time"},"cancel_at":{"type":["string","null"],"format":"date-time","description":"When a scheduled cancellation takes effect"},"cancel_at_period_end":{"type":"boolean"},"renews_at":{"type":["string","null"],"format":"date-time"},"pending_plan":{"type":["string","null"],"example":null,"description":"A plan switch scheduled for the end of the current period (a move from Pro down to Developer): the plan the subscription moves to. During a founding trial (which grants Pro whatever the price) it is the plan billing starts on at the trial end. `plan` stays as it is until then. Null when nothing is scheduled."},"pending_plan_interval":{"type":["string","null"],"enum":["month","year",null],"example":"month","description":"Billing interval after the scheduled switch; null when none"},"pending_plan_at":{"type":["string","null"],"format":"date-time","description":"When the scheduled switch takes effect; null when none"},"price":{"type":["object","null"],"properties":{"amount":{"type":"integer","example":2900},"currency":{"type":"string","example":"usd"},"interval":{"type":"string","enum":["month","year"],"example":"month"},"tax_exclusive":{"type":"boolean","enum":[true]}},"required":["amount","currency","interval","tax_exclusive"],"description":"What the live subscription bills, for its plan and interval; null without one. During a founding trial heading to another plan (`pending_plan`), the price billing starts on at the trial end"},"has_billing_account":{"type":"boolean"},"self_serve_upgrade":{"type":"boolean"},"upgrade_options":{"type":"array","items":{"type":"object","properties":{"plan":{"type":"string","enum":["developer","pro"],"example":"pro"},"interval":{"type":"string","enum":["month","year"],"example":"month"},"amount":{"type":"integer","example":2900,"description":"Minor units (cents)"},"currency":{"type":"string","example":"usd"},"savings_vs_monthly":{"type":"integer","example":0},"via":{"type":"string","enum":["checkout","switch_plan"],"description":"How the owner buys it: `checkout` (no live subscription yet) or `switch_plan` (a live subscriber moves up from the console Billing page, which shows the prorated charge before confirming; during a founding trial heading below Pro, switching back to Pro charges nothing today and billing starts on Pro at the trial end). Agents cannot do either; they ask with POST /v1/billing/upgrade-requests."}},"required":["plan","interval","amount","currency","savings_vs_monthly","via"]},"description":"Plans the account can move up to, monthly and annual, cheapest first, at list price. A founding account inside its window gets every plan (it keeps free Pro until the founding trial ends whichever it buys). A founding trial heading to a plan below Pro (`pending_plan`, no cancellation scheduled) lists Pro via `switch_plan`: the plan billing would start on at the trial end if the owner switches back, with the founding discount in `offer.discount_percent`. Empty when there is none."},"upgrade_url":{"type":["string","null"]},"manage_url":{"type":"string"},"contact_url":{"type":["string","null"]},"pending_upgrade_request":{"anyOf":[{"$ref":"#/components/schemas/UpgradeRequest"},{"type":"null"}]},"offer":{"description":"Founding-member offer for early-access accounts; null otherwise","anyOf":[{"$ref":"#/components/schemas/BillingOffer"},{"type":"null"}]},"payment_method":{"type":["object","null"],"properties":{"type":{"type":"string","example":"card"},"brand":{"type":["string","null"],"example":"visa"},"last4":{"type":["string","null"],"example":"4242"},"exp_month":{"type":["integer","null"],"example":4},"exp_year":{"type":["integer","null"],"example":2027}},"required":["type","brand","last4","exp_month","exp_year"],"description":"Console sessions only: the payment method on file. Never returned to API-key callers."},"past_due":{"type":["object","null"],"properties":{"amount_due":{"type":"integer","example":1581,"description":"Minor units (cents), tax included"},"currency":{"type":"string","example":"usd"},"failed_at":{"type":"string","format":"date-time"},"next_payment_attempt":{"type":["string","null"],"format":"date-time","description":"Next automatic retry; null when no retries are left"},"hosted_invoice_url":{"type":["string","null"],"description":"Where a human can pay the open invoice"},"attempt_count":{"type":"integer"}},"required":["amount_due","currency","failed_at","next_payment_attempt","hosted_invoice_url","attempt_count"],"description":"While status is past_due: the failed payment. Null otherwise."},"credit":{"type":["object","null"],"properties":{"amount":{"type":"integer","exclusiveMinimum":0,"example":26100,"description":"Minor units (cents)"},"currency":{"type":"string","example":"usd"}},"required":["amount","currency"],"description":"Account credit, for example the unused part of a yearly period after a switch to monthly billing. While the subscription renews, it is applied automatically to the next invoices. Null when there is none."}},"required":["plan","plan_source","plan_expires_at","status","interval","current_period_end","cancel_at","cancel_at_period_end","renews_at","pending_plan","pending_plan_interval","pending_plan_at","price","has_billing_account","self_serve_upgrade","upgrade_options","upgrade_url","manage_url","contact_url","pending_upgrade_request","offer","past_due","credit"]},"CreateUpgradeRequest":{"type":"object","properties":{"interval":{"type":"string","enum":["month","year"],"example":"month","description":"Defaults to month"},"reason":{"type":"string","maxLength":500,"example":"Need scoped keys for the support agents."},"feature":{"type":"string","example":"scoped_keys","description":"The `feature` from a plan_required error"},"metric":{"type":"string","example":"api_calls","description":"The `metric` from a quota error"}}},"Plan":{"type":"object","properties":{"id":{"type":"string","enum":["free","developer","pro","custom"]},"name":{"type":"string","example":"Pro"},"tagline":{"type":"string","example":"For production agent workflows"},"price":{"type":["integer","null"],"description":"Recurring monthly amount in the smallest currency unit (e.g. USD cents). `null` for the custom-priced tier.","example":2900},"currency":{"type":["string","null"],"description":"Lowercase ISO-4217 code. `null` for the custom-priced tier.","example":"usd"},"limits":{"$ref":"#/components/schemas/PlanLimits"},"display_features":{"type":"array","items":{"type":"string"},"description":"Marketing copy for UI rendering. Not machine-readable — use `limits` for capability checks."},"annual_price":{"type":["integer","null"],"description":"Yearly amount in the smallest currency unit when the plan can be billed annually (10× the monthly price). `null` for Free and the custom-priced tier.","example":29000},"recommended":{"type":"boolean","description":"Hint for UIs to highlight one tier (currently `pro`)."},"custom_pricing":{"type":"boolean","description":"Present and `true` for the custom tier."},"contact_url":{"type":"string","description":"Sales contact URL for the custom-priced tier."}},"required":["id","name","tagline","price","currency","limits","display_features","annual_price","recommended"]},"PlanLimits":{"type":["object","null"],"properties":{"agents":{"type":["integer","null"]},"calendars":{"type":["integer","null"]},"events":{"type":["integer","null"]},"api_calls":{"type":["integer","null"]},"webhook_deliveries":{"type":["integer","null"]},"availability_queries":{"type":["integer","null"]},"ical_subscriptions":{"type":["integer","null"]},"proposals":{"type":["integer","null"]},"webhook_endpoints":{"type":["integer","null"],"description":"Max active webhook subscription endpoints per org."},"scoped_keys":{"type":["integer","null"],"description":"Max live agent-scoped API keys (`chr_ak_*`) per org."},"recurring_events":{"type":["integer","null"],"description":"Max active recurring event series per org. Free-plan series must also be bounded (COUNT or UNTIL) and end within 90 days of the series start."},"booking_pages":{"type":["integer","null"],"description":"Max active public booking pages per org."},"calendar_connections":{"type":["integer","null"],"description":"Max connected Google or Microsoft calendar accounts per org. Reconnecting an account already connected never counts as a new one."}},"required":["agents","calendars","events","api_calls","webhook_deliveries","availability_queries","ical_subscriptions","proposals","webhook_endpoints","scoped_keys","recurring_events","booking_pages","calendar_connections"],"description":"Enforced caps. `null` for the custom-priced tier (negotiated separately)."},"ICalSyncQueued":{"type":"object","properties":{"status":{"type":"string","enum":["syncing"],"example":"syncing"}},"required":["status"]}},"parameters":{}},"paths":{"/health":{"get":{"operationId":"healthCheck","summary":"Health check","description":"Returns the current server status. Does not require authentication.","tags":["System"],"security":[],"responses":{"200":{"description":"Server is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"],"example":"ok"},"ts":{"type":"string","format":"date-time","example":"2025-01-15T10:00:00.000Z"}},"required":["status","ts"]}}}}}}},"/health/deep":{"get":{"operationId":"deepHealthCheck","summary":"Deep health check","description":"Checks the database, key-value store and quota counter. Returns per-check `ok` or `fail` only; 503 when any check fails. Cached for 30 seconds. Does not require authentication.","tags":["System"],"security":[],"responses":{"200":{"description":"All checks passed","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"],"example":"ok"},"checks":{"type":"object","properties":{"db":{"type":"string","enum":["ok","fail"]},"kv":{"type":"string","enum":["ok","fail"]},"quota_do":{"type":"string","enum":["ok","fail"]}},"required":["db","kv","quota_do"]}},"required":["status","checks"]}}}},"429":{"description":"Rate limited"},"503":{"description":"At least one check failed","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"],"example":"ok"},"checks":{"type":"object","properties":{"db":{"type":"string","enum":["ok","fail"]},"kv":{"type":"string","enum":["ok","fail"]},"quota_do":{"type":"string","enum":["ok","fail"]}},"required":["db","kv","quota_do"]}},"required":["status","checks"]}}}}}}},"/v1/plans":{"get":{"operationId":"listPlans","summary":"List plans","description":"Returns the catalog of publicly-available plans with pricing, limits, and display metadata. No authentication required; IP-rate-limited. Responses are cacheable (`Cache-Control: public, max-age=300, s-maxage=3600, stale-while-revalidate=86400`) with an `ETag` for 304 conditional requests.","tags":["Plans"],"security":[],"responses":{"200":{"description":"Plan catalog","content":{"application/json":{"schema":{"type":"object","properties":{"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}}},"required":["plans"]}}}},"304":{"description":"ETag matched — no body"}}}},"/v1/auth/terms/current":{"get":{"operationId":"getCurrentTerms","summary":"Get current Terms of Service version","description":"Returns the latest ToS manifest entry. No authentication required — intended for CLIs, SDKs, and agent-signup flows that need to read the current version at runtime rather than rely on a build-time constant.","tags":["Terms"],"security":[],"responses":{"200":{"description":"Current ToS manifest entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermsVersion"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/terms":{"patch":{"operationId":"acceptTerms","summary":"Accept the current Terms of Service","description":"Appends an immutable row to `tos_acceptances` (source=`reaccept`) capturing the accepting org, client IP, user-agent, and the ToS document SHA-256, then updates the denormalized `accepted_terms_version` / `accepted_terms_at` columns on the organization. Authenticated via JWT (console session cookie or Bearer token), not an API key. Allowed while the organization is scheduled for deletion: it only records the acceptance and does not change the deletion date.","tags":["Terms"],"security":[{"SessionAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReacceptRequest"}}}},"responses":{"200":{"description":"Re-acceptance recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReacceptResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ToS version stale — the submitted `tos_version` does not match `CURRENT_TERMS_VERSION`. Response body includes a `current_version` field on the `error` object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/terms/accept":{"post":{"operationId":"acceptTermsWithApiKey","summary":"Accept the current Terms of Service (API key)","description":"Bearer-API-key equivalent of `PATCH /v1/auth/terms`, for SDK / MCP clients that have no console session. Use it to clear a material ToS bump signalled by the `Chronary-Terms-Upgrade-Required` response header. Reaches the same re-acceptance path (appends an immutable `tos_acceptances` row and updates the org). Requires an org-level API key (`chr_sk_*`) — agent-scoped keys are rejected with 403.","tags":["Terms"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReacceptRequest"}}}},"responses":{"200":{"description":"Re-acceptance recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermsAcceptResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ToS version stale — the submitted `tos_version` does not match `CURRENT_TERMS_VERSION`. Response body includes a `current_version` field on the `error` object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/export":{"get":{"operationId":"exportAccountData","summary":"Export all account data (GDPR Art. 15 + 20 portability)","description":"Returns a JSON dump of every row this org owns: agents, calendars, events (with decrypted titles + descriptions), iCal subscriptions, webhook subscriptions, availability rules, scheduling proposals + slots + responses, API key prefixes, ToS acceptance history, usage/quota counters, feedback, upgrade requests, booking pages, the audit log, Human calendar Connections with their external calendars, availability grants, publication bindings and setup links, and webhook deliveries. Webhook secrets, iCal subscription URLs, iCal feed tokens and Human calendar provider identifiers are redacted unless `include_secrets=true` is passed from a session that signed in within the last 5 minutes. Human calendar provider credentials are never exported. Internal infrastructure data (incident_records, scheduling internals, password/OTP/key hashes, claim tokens) is excluded. JWT-authenticated (console session cookie or Bearer token). Rate-limited to 10 exports/hour/org. An export larger than the synchronous download limit returns `413 export_too_large`; contact support for the complete file. Response includes `Cache-Control: no-store` and `Content-Disposition: attachment` so the browser triggers a download.","tags":["Account"],"security":[{"SessionAuth":[]}],"responses":{"200":{"description":"Full account data export","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"attachment; filename=\"chronary-export-YYYY-MM-DD.json\""},"Cache-Control":{"schema":{"type":"string"},"description":"no-store"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataExport"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Export exceeds the synchronous size limit; contact support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/claim/initiate":{"post":{"operationId":"initiateAccountClaim","summary":"Start an account claim","description":"Initiates a claim of an agent-created Chronary account. Requires console JWT auth. Returns the same opaque shape regardless of whether the target email maps to a claimable account — by design, to prevent enumeration. Sends a 6-digit OTP to the target inbox; pair with `POST /v1/auth/claim/verify` within 10 minutes.","tags":["Account claim"],"security":[{"SessionAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimInitiateRequest"}}}},"responses":{"200":{"description":"Opaque success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimInitiateResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/claim/verify":{"post":{"operationId":"verifyAccountClaim","summary":"Verify an account claim OTP","description":"Verifies the OTP for a pending claim. Requires console JWT auth with `iat` within the last 5 minutes — older sessions return 401 `reauth_required`. On success the claim enters a 24h revocation hold; the original account holder can revoke from the notification email during that window. After 24h a cron promotes the claim and transfers all org-scoped resources.","tags":["Account claim"],"security":[{"SessionAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimVerifyRequest"}}}},"responses":{"200":{"description":"Claim entered the 24h hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimVerifyResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/claim/{id}/revoke":{"post":{"operationId":"revokeAccountClaim","summary":"Revoke a verified claim during the hold window","description":"Public endpoint — authenticates by the `revocation_token` mailed to the agent-org email at verify time. Allowed only while the claim is in `verified` state and the 24h window is still open. Returns 410 once the window closes.","tags":["Account claim"],"security":[],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRevokeRequest"}}}},"responses":{"200":{"description":"Claim revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRevokeResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Revocation window has closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRevokeResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/claim/{id}/revoke/preview":{"post":{"operationId":"previewAccountClaimRevocation","summary":"Preview a claim before revoking it","description":"Public, read-only. Takes the same `revocation_token` as the revoke endpoint and returns what a revoke would cancel, with both emails masked. Changes nothing: the console shows this before the account holder confirms. Same 404 / 410 rules as revoke.","tags":["Account claim"],"security":[],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRevokeRequest"}}}},"responses":{"200":{"description":"Claim that the token can revoke","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRevokePreviewResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Revocation window has closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited — too many preview attempts for this IP or claim","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/claims":{"get":{"operationId":"listAccountClaims","summary":"List your account claims","description":"Returns the developer's pending and historical claims, most recent first. Sanitized — never includes OTP hashes, revocation tokens, or full target emails.","tags":["Account claim"],"security":[{"SessionAuth":[]}],"responses":{"200":{"description":"List of claims","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimsListResponse"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/email-change":{"post":{"operationId":"requestEmailChange","summary":"Request a change of the account email","description":"Sends a confirmation link to the new address and a notice, with a cancel link, to the current one. The new address takes effect only after the link is used; until then the current email keeps working. Requires a console session re-authenticated within the last 5 minutes (else 401 `reauth_required`). One pending change per organization: a new request replaces the previous link. Answers 202 whether or not the address already belongs to another account.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeRequest"}}}},"responses":{"202":{"description":"Confirmation link sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangePendingResponse"}}}},"400":{"description":"`same_email` — the address is already the account email, or validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many email change requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"cancelEmailChange","summary":"Cancel the pending email change","description":"Clears the pending change; its confirmation and cancel links stop working.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"responses":{"204":{"description":"Pending change cancelled"},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no email change is pending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/email-change/confirm":{"post":{"operationId":"confirmEmailChange","summary":"Confirm an email change with the emailed link","description":"Public — authenticates by the single-use token in the link sent to the new address (valid 24 hours). Makes the new address the account email, marks it verified and signs out every other session. When the request carries a valid session for the same organization, that session is re-issued (`signed_in: true`); otherwise `signed_in` is false.","tags":["Account"],"security":[],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeTokenRequest"}}}},"responses":{"200":{"description":"Email changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeConfirmResponse"}}}},"400":{"description":"`invalid_token` (unknown or already used) or `expired_token`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`email_taken` — the address belongs to another account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/email-change/cancel":{"post":{"operationId":"cancelEmailChangeByLink","summary":"Cancel an email change from the notice link","description":"Public — authenticates by the token in the notice sent to the current address. Works only while that change is still pending.","tags":["Account"],"security":[],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeTokenRequest"}}}},"responses":{"204":{"description":"Pending change cancelled"},"400":{"description":"`invalid_token` — the change was already confirmed, cancelled or replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/password":{"put":{"operationId":"changePassword","summary":"Change the account password","description":"Changes the password of the signed-in console session. Requires the current password. The new password must be 8 to 128 characters and not appear in a known data breach (the breach check is skipped, never blocking, when it is unavailable). On success every other session is signed out, the calling session is re-issued (new cookie) and an email confirms the change. A wrong current password counts toward the same per-account lockout as sign-in: 10 failures in 15 minutes lock password sign-in and password changes for 15 minutes (429 `account_locked` with `Retry-After`).","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Password changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordResponse"}}}},"400":{"description":"`invalid_current_password`, `weak_password`, `pwned_password`, `same_password` or a validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`password_not_set` — the account has no password; use the set-password link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`account_locked` (with `Retry-After` seconds) or `rate_limit_error`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/password/set-link":{"post":{"operationId":"sendSetPasswordLink","summary":"Email a link to set a password","description":"For a signed-in account that has no password (it signs in with a provider, or was created by an agent). Emails a single-use link, valid 1 hour, to the account address; opening it sets a password on the reset page. The signed-out reset request never does this for a provider account.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"responses":{"202":{"description":"Link sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordLinkResponse"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`password_already_set` — change the password instead","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/oauth/{provider}/link":{"post":{"operationId":"startOAuthLink","summary":"Start linking a provider sign-in","description":"Returns the provider URL to send the browser to. Requires a console session re-authenticated within the last 5 minutes (else 401 `reauth_required`). An account links at most one provider; 409 `already_linked` when one is already linked. After the provider step the browser returns to the console Security page with `?link_token=…` (or `?link_error=…`); confirm the token with `POST /v1/auth/oauth/link/confirm`. Nothing is linked until then.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["google","github","microsoft"],"description":"The sign-in provider."},"required":true,"description":"The sign-in provider.","name":"provider","in":"path"},{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"responses":{"200":{"description":"Provider authorization URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthLinkStartResponse"}}}},"400":{"description":"`invalid_request` — unknown provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error` or `reauth_required` (re-authenticate, then retry)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`already_linked` — unlink the current sign-in method first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`oauth_not_configured` — this provider is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/oauth/link/confirm":{"post":{"operationId":"confirmOAuthLink","summary":"Confirm a provider link","description":"Links the provider account the callback verified to the signed-in organization, by the provider’s own user id (never by email). The token is single use and valid 10 minutes. It must be confirmed by the same organization that started the link (403 `link_session_mismatch` otherwise). Emails the owner.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthLinkConfirmRequest"}}}},"responses":{"200":{"description":"Provider linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthLinkConfirmResponse"}}}},"400":{"description":"`link_expired` — unknown, used or expired token, or a validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` or `link_session_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`provider_account_in_use` (it signs in to another organization) or `already_linked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/oauth/{provider}":{"delete":{"operationId":"unlinkOAuth","summary":"Unlink a provider sign-in","description":"Removes the linked provider. Requires a console session re-authenticated within the last 5 minutes. Refused with 409 `last_sign_in_method` while the account has no password. Emails the owner.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["google","github","microsoft"],"description":"The sign-in provider."},"required":true,"description":"The sign-in provider.","name":"provider","in":"path"},{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"responses":{"200":{"description":"Provider unlinked","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"`invalid_request` — unknown provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error` or `reauth_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_linked` — that provider is not linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`last_sign_in_method` — set a password first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/account":{"delete":{"operationId":"deleteAccount","summary":"Delete the account","description":"Deletes the organization. Requires a console session re-authenticated within the last 5 minutes (else 401 `reauth_required`). Where scheduled deletion is enabled the request schedules the deletion and answers 202: API keys stop working and webhooks pause at once, no further charge is made (a paid plan ends at deletion, or at the end of the current billing period if that comes first; fees already paid are not refunded, including for the unused part of the current billing period, except where the Terms of Service say otherwise, and leftover account credit is refunded to the original payment method within 30 days), every session is signed out, and the data is permanently deleted 7 days later unless the deletion is cancelled with `POST /v1/auth/account/cancel-deletion`. To have the data deleted sooner, email privacy@chronary.ai. While a deletion is scheduled the console session is read-only (other writes answer 403 `account_pending_deletion`). Otherwise the organization is deleted at once and the request answers 204.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"responses":{"202":{"description":"Deletion scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionScheduled"}}}},"204":{"description":"Account deleted"},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`already_scheduled` — a deletion is already scheduled; `conflict` — the account cannot be deleted at once right now (contact privacy@chronary.ai); nothing was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`billing_cancel_failed` — the subscription could not be changed; nothing was deleted or scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/account/cancel-deletion":{"post":{"operationId":"cancelAccountDeletion","summary":"Cancel a scheduled account deletion","description":"Keeps the organization: API keys work again, the webhooks the deletion paused resume, and a plan the deletion set to end renews again. Works until the scheduled deletion time; no re-authentication needed.","tags":["Account"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["1"],"description":"Required on every console mutation."},"required":true,"description":"Required on every console mutation.","name":"X-Chronary-CSRF","in":"header"}],"responses":{"200":{"description":"Deletion cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionCancelled"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`csrf_required` — missing CSRF header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_scheduled` — no deletion is scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`deletion_in_progress` — the deletion time has passed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`billing_resume_failed` — the plan could not be restored; nothing was changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ical/{ical_token}":{"get":{"operationId":"getIcalFeed","summary":"Get iCal feed","description":"Returns a calendar's events in iCalendar (RFC 5545) format. No authentication required — the token in the URL acts as a capability. Responses are cached for 5 minutes and include an ETag for conditional requests.","tags":["iCal Feeds"],"security":[],"parameters":[{"schema":{"type":"string","description":"iCal feed token from the calendar `ical_token` field"},"required":true,"description":"iCal feed token from the calendar `ical_token` field","name":"ical_token","in":"path"}],"responses":{"200":{"description":"iCalendar feed","content":{"text/calendar":{"schema":{"type":"string"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents":{"get":{"operationId":"listAgents","summary":"List agents","description":"Lists the agents in the organization, newest first by default. Decommissioned (deleted) agents are left out unless `include_decommissioned=true` or `status=decommissioned`. Page with `limit`/`offset`, or with `cursor` and the `next_cursor` of the previous page; `total` always counts every match. An agent-scoped key lists only its own agent.","tags":["Agents"],"parameters":[{"schema":{"type":"string","enum":["ai","human","resource"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","enum":["active","paused","decommissioned"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Search: a case-insensitive substring of the agent name, or an exact agent id"},"required":false,"description":"Search: a case-insensitive substring of the agent name, or an exact agent id","name":"q","in":"query"},{"schema":{"type":"string","enum":["created_at","name"],"description":"Sort order: `created_at` (default) is newest first; `name` is A to Z. Ties break on id"},"required":false,"description":"Sort order: `created_at` (default) is newest first; `name` is A to Z. Ties break on id","name":"sort","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Include decommissioned (deleted) agents. Default false; ignored when `status` is set"},"required":false,"description":"Include decommissioned (deleted) agents. Default false; ignored when `status` is set","name":"include_decommissioned","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Add `calendar_count` and `scoped_key_count` to each agent"},"required":false,"description":"Add `calendar_count` and `scoped_key_count` to each agent","name":"include_counts","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"},"required":false,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`","name":"cursor","in":"query"}],"responses":{"200":{"description":"List of agents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAgent","summary":"Register an agent","description":"Registers your AI agent with Chronary, creating a Chronary identity it can use to own calendars, events, and webhooks. The agent itself already exists in your system — this gives it a Chronary record.","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgent"}}}},"responses":{"201":{"description":"Agent registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}":{"get":{"operationId":"getAgent","summary":"Get an agent","tags":["Agents"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"id","in":"path"}],"responses":{"200":{"description":"Agent details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAgent","summary":"Update an agent","description":"Setting `status` on a decommissioned agent restores it and makes its calendars writable again. A restored agent, its calendars and their recurring series count toward the plan again, so a restore that would go over the agent, calendar or recurring series limit of the plan is refused with 429 `quota_exceeded` (the same error as creating one over the limit).","tags":["Agents"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgent"}}}},"responses":{"200":{"description":"Updated agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or (`quota_exceeded`, `metric: agents`, `metric: calendars` or `metric: recurring_events`, with `limit` and the upgrade or contact link) restoring this decommissioned agent would go over the agent limit of the plan, its calendars over the calendar limit, or their recurring series over the recurring series limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteAgent","summary":"Delete an agent","description":"Decommissions the agent and revokes its Agent keys. Its calendars and events are kept, and the calendars and their recurring series stop counting toward the calendar and recurring series limits of the plan. While the agent stays decommissioned its calendars are read-only: reads and the iCal feed keep working. Writes return 409 `agent_inactive`: events and holds, availability rules, calendar changes, creating a booking page, creating, responding to or resolving a proposal, creating, updating, syncing or resuming an iCal subscription, and creating a connection link. Deleting a calendar, updating, rotating or deleting an existing booking page, and pausing or deleting an iCal subscription stay allowed. The hosted booking pages are unavailable (404) while the agent is decommissioned, even after an update. Restore the agent with PATCH (status active or paused) to make the calendars writable again.","tags":["Agents"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"id","in":"path"}],"responses":{"204":{"description":"Agent deleted"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{agent_id}/calendars":{"get":{"operationId":"listAgentCalendars","summary":"List calendars for an agent","description":"Ordered newest first. `q` matches a name substring (case-insensitive) or an exact calendar id. Page with `offset`, or pass the `next_cursor` of the previous page as `cursor`; `total` always counts every match. An agent-scoped key gets 403 for another agent. An unknown agent, or one in another organization, gets 404.","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"agent_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Search: a case-insensitive substring of the calendar name, or an exact calendar id"},"required":false,"description":"Search: a case-insensitive substring of the calendar name, or an exact calendar id","name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"},"required":false,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`","name":"cursor","in":"query"}],"responses":{"200":{"description":"List of calendars","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarPage"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found: it does not exist or belongs to another organization (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAgentCalendar","summary":"Create a calendar for an agent","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"agent_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCalendar"}}}},"responses":{"201":{"description":"Calendar created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the agent is decommissioned. Restore it (PATCH, status active) before adding calendars","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or (`quota_exceeded`, `metric: calendars`) the calendar limit of the plan is reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"operationId":"listOrgEvents","summary":"List events across calendars","description":"Returns events across all of the organization's calendars, ordered by start time then id. Narrow with repeated `calendar_id` parameters (at most 50), `agent_id`, a `start_after`/`start_before` window, `status` and `source`. An agent-scoped key sees only its own agent's calendars and gets 403 for another agent or calendar. Unknown or deleted calendar ids match nothing. `q` searches event titles (case-insensitive) and requires `start_after` and `start_before` at most 31 days apart; a window with more than 2,000 events returns 400 (narrow the range). `expand=true` expands recurring series within the window, as on the per-calendar list. Page with `offset`, or pass the `next_cursor` of the previous page as `cursor`; `total` always counts every match. `limit` is at most 100.","tags":["Events"],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start_before","in":"query"},{"schema":{"type":"string","enum":["confirmed","tentative","cancelled","hold"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["internal","external_ical"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"expand","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Only these calendars. Repeat the parameter for several (at most 50)"},"required":false,"description":"Only these calendars. Repeat the parameter for several (at most 50)","name":"calendar_id","in":"query"},{"schema":{"type":"string","description":"Only this agent's calendars"},"required":false,"description":"Only this agent's calendars","name":"agent_id","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Case-insensitive title search. Requires start_after and start_before at most 31 days apart"},"required":false,"description":"Case-insensitive title search. Requires start_after and start_before at most 31 days apart","name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"},"required":false,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`","name":"cursor","in":"query"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgEventList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{agent_id}/events":{"get":{"operationId":"listAgentEvents","summary":"List events for an agent","description":"Returns events across all calendars owned by the agent. An agent-scoped key gets 403 for another agent. An unknown agent, or one in another organization, gets 404.","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"agent_id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start_before","in":"query"},{"schema":{"type":"string","enum":["confirmed","tentative","cancelled","hold"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["internal","external_ical"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"expand","in":"query"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found: it does not exist or belongs to another organization (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/availability":{"get":{"operationId":"getAgentAvailability","summary":"Get agent availability","description":"Returns free/busy slots for all calendars owned by the agent. The `start`..`end` range is at most the plan's availability range (30 days on Free and Developer, 90 on Pro); a longer range returns `400 validation_error`.","tags":["Availability"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"start","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"end","in":"query"},{"schema":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"required":false,"name":"duration","in":"query"},{"schema":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"required":false,"name":"slot_duration","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"include_busy","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"allow_stale","in":"query"}],"responses":{"200":{"description":"Availability slots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAvailabilityResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{agent_id}/ical-subscriptions":{"get":{"operationId":"listAgentIcalSubscriptions","summary":"List iCal subscriptions for an agent","description":"An agent-scoped key gets 403 for another agent. An unknown agent, or one in another organization, gets 404.","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"agent_id","in":"path"},{"schema":{"type":"string","enum":["active","error","paused"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"}],"responses":{"200":{"description":"List of iCal subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSubscriptionList"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found: it does not exist or belongs to another organization (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAgentIcalSubscription","summary":"Create an iCal subscription for an agent","description":"Subscribes an agent's calendar to an external iCal feed. The feed is polled approximately every 15 minutes and events are synced into the target calendar.","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"agt_01H9X4M2P5R8T6V0","description":"Agent ID"},"required":true,"description":"Agent ID","name":"agent_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateICalSubscription"}}}},"responses":{"201":{"description":"Subscription created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSubscription"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars":{"get":{"operationId":"listCalendars","summary":"List calendars","description":"By default, returns only shared (org-level) calendars. Pass `include=all` to include agent-owned calendars too. An agent-scoped key lists only its own agent's calendars. Ordered newest first. `q` matches a name substring (case-insensitive) or an exact calendar id. Page with `offset`, or pass the `next_cursor` of the previous page as `cursor`; `total` always counts every match.","tags":["Calendars"],"parameters":[{"schema":{"type":"string","enum":["all"]},"required":false,"name":"include","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Search: a case-insensitive substring of the calendar name, or an exact calendar id"},"required":false,"description":"Search: a case-insensitive substring of the calendar name, or an exact calendar id","name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"},"required":false,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`","name":"cursor","in":"query"}],"responses":{"200":{"description":"List of calendars","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarPage"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCalendar","summary":"Create a calendar","description":"Creates a shared (org-level) calendar not associated with any specific agent.","tags":["Calendars"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCalendar"}}}},"responses":{"201":{"description":"Calendar created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{id}":{"get":{"operationId":"getCalendar","summary":"Get a calendar","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"responses":{"200":{"description":"Calendar details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCalendar","summary":"Update a calendar","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendar"}}}},"responses":{"200":{"description":"Updated calendar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteCalendar","summary":"Delete a calendar","description":"Deletes a calendar and all its events.","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"responses":{"204":{"description":"Calendar deleted"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{id}/ical-token/rotate":{"post":{"operationId":"rotateCalendarIcalToken","summary":"Regenerate a calendar's subscribe URL","description":"Replaces the secret token in the calendar's iCal subscribe URL and returns the calendar with the new `ical_url`. The old URL stops working at once; copies of the feed cached in other locations can still be served from the old URL for up to 5 minutes. Calendar apps subscribed to the old URL must be re-subscribed with the new one. Organization keys and console sessions only; a console session must have re-authenticated within the last 5 minutes (else 401 `reauth_required`). No webhook event is sent.","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"responses":{"200":{"description":"Calendar with its new subscribe URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"401":{"description":"`authentication_error`, or `reauth_required` for a console session (re-authenticate, then retry)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped keys (`chr_ak_*`) cannot call this endpoint — use an org-level key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{id}/context":{"get":{"operationId":"getCalendarContext","summary":"Get calendar temporal context","description":"Returns a snapshot of the calendar's temporal state: current event, next event, recent events, and upcoming events within 24 hours. Designed for agents that need situational awareness of a calendar.","tags":["Calendars"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"responses":{"200":{"description":"Calendar temporal context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarContext"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/booking-pages":{"post":{"operationId":"createBookingPage","summary":"Create a booking page","description":"Create a public scheduling link for a calendar. An agent creates the page, then shares the returned `booking_url` with a human; when the human picks a slot, a confirmed event is created on the calendar and an `event.created` webhook fires with a `booking_page_id` correlation field.","tags":["Booking Pages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookingPage"}}}},"responses":{"201":{"description":"Booking page created","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingPage"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listBookingPages","summary":"List booking pages","description":"Newest first. Pass `calendar_id` to list only the pages bound to that calendar. An agent-scoped key lists only its own agent's pages.","tags":["Booking Pages"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","maxLength":64,"description":"Only pages bound to this calendar"},"required":false,"description":"Only pages bound to this calendar","name":"calendar_id","in":"query"}],"responses":{"200":{"description":"List of booking pages","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingPageList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/booking-pages/{id}":{"get":{"operationId":"getBookingPage","summary":"Get a booking page","tags":["Booking Pages"],"parameters":[{"schema":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0","description":"Booking page ID"},"required":true,"description":"Booking page ID","name":"id","in":"path"}],"responses":{"200":{"description":"Booking page details","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingPage"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateBookingPage","summary":"Update a booking page","tags":["Booking Pages"],"parameters":[{"schema":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0","description":"Booking page ID"},"required":true,"description":"Booking page ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBookingPage"}}}},"responses":{"200":{"description":"Updated booking page","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingPage"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteBookingPage","summary":"Delete a booking page","description":"Soft-deletes the booking page. Its hosted URL stops resolving; existing booked events are unaffected.","tags":["Booking Pages"],"parameters":[{"schema":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0","description":"Booking page ID"},"required":true,"description":"Booking page ID","name":"id","in":"path"}],"responses":{"204":{"description":"Booking page deleted"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/booking-pages/{id}/bookings":{"get":{"operationId":"listBookingPageBookings","summary":"List the bookings made through a booking page","description":"Returns the events booked through this page, newest start first, with the invitee's name, email and notes. Cancelled bookings are included with their `status`; deleted events are not. Page by passing the `next_cursor` of the previous page as `cursor`. Lists bookings made after this endpoint was released; earlier bookings are not linked to their page.","tags":["Booking Pages"],"parameters":[{"schema":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0","description":"Booking page ID"},"required":true,"description":"Booking page ID","name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page"},"required":false,"description":"The `next_cursor` from the previous page","name":"cursor","in":"query"}],"responses":{"200":{"description":"Bookings made through the page","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/booking-pages/{id}/rotate-slug":{"post":{"operationId":"rotateBookingPageSlug","summary":"Rotate a booking page's public link","description":"Replaces the page's `slug` and returns the page with its new `booking_url`. The old `/book/{slug}` link stops working at once; share the new `booking_url` instead. Existing bookings are unaffected. No webhook event is sent.","tags":["Booking Pages"],"parameters":[{"schema":{"type":"string","example":"bkp_01H9X4M2P5R8T6V0","description":"Booking page ID"},"required":true,"description":"Booking page ID","name":"id","in":"path"}],"responses":{"200":{"description":"Booking page with its new link","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingPage"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/book/{slug}":{"get":{"operationId":"getBookingPageHosted","summary":"Hosted booking page (HTML)","description":"Public, server-rendered HTML scheduling page. No authentication — the unguessable slug is the credential. Pass `?slot=<ISO>` to render the confirmation form for a chosen slot.","tags":["Booking Pages"],"security":[],"parameters":[{"schema":{"type":"string","example":"a1b2c3d4e5f6g7h8i9j0k1","description":"Public booking page slug"},"required":true,"description":"Public booking page slug","name":"slug","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"slot","in":"query"}],"responses":{"200":{"description":"Hosted booking page","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Unknown or inactive slug","content":{"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Rate limited","content":{"text/plain":{"schema":{"type":"string"}}}}}},"post":{"operationId":"submitBooking","summary":"Submit a booking","description":"Public booking submission. No authentication — the slug is the credential. Accepts JSON (returns JSON) or an HTML form (returns an HTML confirmation). Re-validates the chosen slot against live availability, creates a confirmed event, and fires an `event.created` webhook with `booking_page_id`. Submissions are limited per booker email on a page (3 per UTC day), per client network (30 per UTC hour, 200 per day, across all pages) and per page (30 per UTC hour, 100 per day); over a limit returns 429 with `Retry-After`.","tags":["Booking Pages"],"security":[],"parameters":[{"schema":{"type":"string","example":"a1b2c3d4e5f6g7h8i9j0k1","description":"Public booking page slug"},"required":true,"description":"Public booking page slug","name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBooking"}}}},"responses":{"201":{"description":"Booking confirmed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingSubmissionResult"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No active booking page with this slug (unknown, inactive, deleted, held, or its calendar belongs to a decommissioned agent)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The slot is no longer available or was just taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many submissions (per booker, client network or page). See `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The page is temporarily not accepting bookings. Error type `unavailable`: on a plan whose monthly events limit is a hard stop, public bookings stop once the owner has used 80% of that limit; the owner is emailed once per month. Error type `temporarily_disabled` (with `Retry-After`): bookings are paused for everyone for a short time.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/book/{slug}/slots":{"get":{"operationId":"listBookingSlots","summary":"List available booking slots (JSON)","description":"Public JSON list of available slots for a booking page, for building a custom booking UI. No authentication. Slots are clamped to the page's min-notice and window.","tags":["Booking Pages"],"security":[],"parameters":[{"schema":{"type":"string","example":"a1b2c3d4e5f6g7h8i9j0k1","description":"Public booking page slug"},"required":true,"description":"Public booking page slug","name":"slug","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Available slots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingSlotsResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{cal_id}/events":{"get":{"operationId":"listCalendarEvents","summary":"List events in a calendar","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"cal_id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start_before","in":"query"},{"schema":{"type":"string","enum":["confirmed","tentative","cancelled","hold"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["internal","external_ical"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"expand","in":"query"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCalendarEvent","summary":"Create an event in a calendar","description":"Create a confirmed event, a tentative event, or a temporal hold. When creating a hold (`status: \"hold\"`), `hold_expires_at` is required and must be between 30 seconds and 15 minutes in the future. Holds auto-release at `hold_expires_at`; promote a hold to a confirmed event with `PUT /v1/events/{id}/confirm` before expiry.","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"cal_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEvent"}}}},"responses":{"201":{"description":"Event created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{cal_id}/events/{id}":{"get":{"operationId":"getCalendarEvent","summary":"Get a cal-scoped event","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"cal_id","in":"path"},{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCalendarEvent","summary":"Update a cal-scoped event","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"cal_id","in":"path"},{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEvent"}}}},"responses":{"200":{"description":"Updated event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteCalendarEvent","summary":"Delete a cal-scoped event","description":"Soft-deletes the event (or, for a recurring series, the whole series). Pass `occurrence_start` to cancel just one occurrence of a recurring series instead — the series lives on and the updated master is returned with 200.","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"cal_id","in":"path"},{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"occurrence_start","in":"query"}],"responses":{"200":{"description":"Single occurrence cancelled — returns the updated series master (only when occurrence_start was provided)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"204":{"description":"Event deleted"},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Event is not a recurring series (occurrence_start on a one-off event); or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{id}/availability":{"get":{"operationId":"getCalendarAvailability","summary":"Get calendar availability","description":"Returns free/busy slots for a single calendar. The `start`..`end` range is at most the plan's availability range (30 days on Free and Developer, 90 on Pro); a longer range returns `400 validation_error`.","tags":["Availability"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"start","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"end","in":"query"},{"schema":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"required":false,"name":"duration","in":"query"},{"schema":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"required":false,"name":"slot_duration","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"include_busy","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"allow_stale","in":"query"}],"responses":{"200":{"description":"Availability slots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarAvailabilityResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendars/{id}/availability-rules":{"put":{"operationId":"setAvailabilityRules","summary":"Set availability rules","description":"Upsert buffer times and working hours for a calendar.","tags":["Availability"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAvailabilityRules"}}}},"responses":{"200":{"description":"Availability rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityRules"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"getAvailabilityRules","summary":"Get availability rules","description":"Returns the buffer and working hours rules for a calendar.","tags":["Availability"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"responses":{"200":{"description":"Availability rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityRules"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteAvailabilityRules","summary":"Delete availability rules","description":"Removes buffer times and working hours for a calendar.","tags":["Availability"],"parameters":[{"schema":{"type":"string","example":"cal_01H9X4M2P5R8T6V0","description":"Calendar ID"},"required":true,"description":"Calendar ID","name":"id","in":"path"}],"responses":{"204":{"description":"Rules deleted"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}":{"get":{"operationId":"getEvent","summary":"Get an event","description":"Fetch an event by ID. The calendar is resolved internally from the event.","tags":["Events"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateEvent","summary":"Update an event","description":"Update an event by ID. The calendar is resolved internally from the event.","tags":["Events"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEvent"}}}},"responses":{"200":{"description":"Updated event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteEvent","summary":"Delete an event","description":"Delete an event by ID. The calendar is resolved internally from the event. Pass `occurrence_start` to cancel just one occurrence of a recurring series — the series lives on and the updated master is returned with 200.","tags":["Events"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"occurrence_start","in":"query"}],"responses":{"200":{"description":"Single occurrence cancelled — returns the updated series master (only when occurrence_start was provided)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"204":{"description":"Event deleted"},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Event is not a recurring series (occurrence_start on a one-off event); or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}/confirm":{"put":{"operationId":"confirmEvent","summary":"Confirm a held event","description":"Promotes an event from `status=\"hold\"` to `status=\"confirmed\"`. The hold must still be active (not past `hold_expires_at`). After confirmation, `event.started` and `event.ended` lifecycle webhooks fire at the scheduled times, and the `event.hold_confirmed` webhook fires immediately.","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"responses":{"200":{"description":"Confirmed event","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"External iCal events cannot be confirmed, or a Developer or Pro plan required","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Event is not a hold, or the hold has already expired; or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}/release":{"put":{"operationId":"releaseEvent","summary":"Release a held event","description":"Manually releases an event with `status=\"hold\"` before its `hold_expires_at`. Frees the slot for other agents. Fires the `event.hold_released` webhook. Available on every plan (creating and confirming holds requires a Developer or Pro plan).","tags":["Events"],"parameters":[{"schema":{"type":"string","example":"evt_01H9X4M2P5R8T6V0","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"responses":{"200":{"description":"Released event (now cancelled)","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"External iCal events cannot be released","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Event is not a hold; or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/availability":{"get":{"operationId":"getCrossAgentAvailability","summary":"Get cross-agent availability","description":"Returns intersected free/busy slots across multiple agents. Pass a comma-separated list of agent IDs in the `agents` query parameter. Optionally filter to specific calendar IDs with `calendars` (at most 50). The plan caps the number of agents and the `start`..`end` range; over a cap returns `400 validation_error`. **Requires a Developer or Pro plan.**","tags":["Availability"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"agents","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"start","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"end","in":"query"},{"schema":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"required":false,"name":"duration","in":"query"},{"schema":{"type":"string","enum":["15m","30m","45m","1h","2h"]},"required":false,"name":"slot_duration","in":"query"},{"schema":{"type":"string","description":"Comma-separated calendar ids whose busy time also blocks slots, at most 50"},"required":false,"description":"Comma-separated calendar ids whose busy time also blocks slots, at most 50","name":"calendars","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"include_busy","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"allow_stale","in":"query"}],"responses":{"200":{"description":"Intersected availability slots","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAvailabilityResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan upgrade required — feature is not available on the current plan","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List webhooks","description":"Lists webhook endpoints, oldest first. `expand=last_delivery,failures_24h` adds each endpoint's newest delivery and its count of failed deliveries in the last 24 hours. Without `expand` those fields are absent.","tags":["Webhooks"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","maxLength":100,"description":"Comma-separated extras for each endpoint: `last_delivery`, `failures_24h`"},"required":false,"description":"Comma-separated extras for each endpoint: `last_delivery`, `failures_24h`","name":"expand","in":"query"}],"responses":{"200":{"description":"List of webhooks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWebhook","summary":"Create a webhook","description":"Registers a new webhook endpoint. Chronary will deliver signed POST requests to your URL when subscribed events occur. The signing secret is returned only at creation time — store it securely.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhook"}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"get":{"operationId":"getWebhook","summary":"Get a webhook","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"}],"responses":{"200":{"description":"Webhook details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateWebhook","summary":"Update a webhook","description":"`active: false` pauses the endpoint: `deactivatedAt` and `deactivatedReason: manual` are set and its pending retries end as `failed` with `last_error_code: endpoint_disabled`. `active: true` on an inactive endpoint re-enables it: the URL is checked again, and the failure count, `firstFailureAt` and the deactivation fields are cleared. Cancelled deliveries are not resent. Re-enabling is refused with 400 while an account deletion is scheduled.","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhook"}}}},"responses":{"200":{"description":"Updated webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteWebhook","summary":"Delete a webhook","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"}],"responses":{"204":{"description":"Webhook deleted"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"List webhook deliveries","description":"Returns delivery history for a webhook subscription, newest first. Useful for diagnosing failed deliveries. Payload bodies are omitted by default — pass `include_payload=true` to include them. Filter by `status`, `event_type` (exact, or a prefix ending in a dot such as `event.`), `created_after` / `created_before`, `delivery_id` and `is_test`. Page with `cursor` (the previous page's `next_cursor`), which stays stable while new deliveries arrive; `offset` still works but cannot be combined with `cursor`. On Free, deliveries stopped by the monthly limit appear with status `dropped`. Requires an org-level API key; agent-scoped keys receive 403.","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters"},"required":false,"description":"Rows to skip, at most 10000. To page deeper, use `cursor` where the list has it, or narrow the query with filters","name":"offset","in":"query"},{"schema":{"type":"string","enum":["pending","delivered","failed","dropped"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_payload","in":"query"},{"schema":{"type":"string","maxLength":100,"pattern":"^[a-z_]+\\.(?:[a-z_]+)?$","description":"An exact event type (`event.created`), or a prefix ending in a dot (`event.`) for every type in that group"},"required":false,"description":"An exact event type (`event.created`), or a prefix ending in a dot (`event.`) for every type in that group","name":"event_type","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only deliveries created at or after this time (ISO 8601; `Z` or a numeric offset)"},"required":false,"description":"Only deliveries created at or after this time (ISO 8601; `Z` or a numeric offset)","name":"created_after","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only deliveries created before this time (ISO 8601; `Z` or a numeric offset)"},"required":false,"description":"Only deliveries created before this time (ISO 8601; `Z` or a numeric offset)","name":"created_before","in":"query"},{"schema":{"type":"string","maxLength":100,"pattern":"^whd_[A-Za-z0-9_-]+$","description":"Only the delivery with this id"},"required":false,"description":"Only the delivery with this id","name":"delivery_id","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` for test events only, `false` to leave them out"},"required":false,"description":"`true` for test events only, `false` to leave them out","name":"is_test","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`"},"required":false,"description":"The `next_cursor` from the previous page. Cannot be combined with a non-zero `offset`","name":"cursor","in":"query"}],"responses":{"200":{"description":"Delivery history with pagination and all-time status counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/deliveries/{delivery_id}":{"get":{"operationId":"getWebhookDelivery","summary":"Get a webhook delivery","description":"Returns one delivery with its payload and every attempt, oldest first: HTTP status, duration, the first 2048 bytes of the response body and an error class. Requires an org-level API key; agent-scoped keys receive 403.","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"},{"schema":{"type":"string","example":"whd_01H9X4M2P5R8T6V0","description":"Delivery ID"},"required":true,"description":"Delivery ID","name":"delivery_id","in":"path"}],"responses":{"200":{"description":"The delivery with its attempt timeline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDetail"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"operationId":"sendTestWebhook","summary":"Send a test event","description":"Sends a signed sample payload of one event type to the endpoint. The delivery is marked `is_test`, carries the `X-Chronary-Test: 1` header, makes one attempt and is sent even when the endpoint is paused or disabled. It does not count toward the monthly delivery quota and never affects the circuit breaker. Poll `GET /v1/webhooks/{id}/deliveries/{delivery_id}` for the result. The endpoint must subscribe to the event type. Limited to 10 per minute per organization. Requires an org-level API key; agent-scoped keys receive 403.","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTestWebhook"}}}},"responses":{"202":{"description":"The test event was queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestSent"}}}},"400":{"description":"Validation error: unknown `event_type`, or the endpoint is not subscribed to it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limit_error`: more than 10 test events in a minute. `Retry-After: 60`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/deliveries/{delivery_id}/replay":{"post":{"operationId":"replayWebhookDelivery","summary":"Replay a webhook delivery","description":"Sends a `failed` or `dropped` delivery again as a **new** delivery with its own `delivery_id`; the original delivery and its attempts are not changed. The stored payload goes out unchanged (same event id), signed per attempt with the endpoint's current secret and sent to its current URL, with an `X-Chronary-Replay-Of` header naming the first delivery of the chain (the original, even when a replay is replayed). The replay follows the plan's normal retry schedule, counts toward the circuit breaker and counts toward the monthly `webhook_deliveries` quota (paid plans past the limit are still served, with `RateLimit-Soft-Exceeded: true`). Pending, delivered and test deliveries cannot be replayed, the endpoint must be active, and the payload must still be stored (30 days). Poll `GET /v1/webhooks/{id}/deliveries/{delivery_id}` with the new id for the result. Honors `Idempotency-Key`. Limited to 30 per minute per organization. Requires a Developer or Pro plan and an org-level API key; agent-scoped keys receive 403.","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"},{"schema":{"type":"string","example":"whd_01H9X4M2P5R8T6V0","description":"Delivery to replay"},"required":true,"description":"Delivery to replay","name":"delivery_id","in":"path"}],"responses":{"202":{"description":"The replay was queued as a new delivery","headers":{"RateLimit-Soft-Exceeded":{"description":"Present (`true`) when a paid plan is past its monthly delivery limit","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReplaySent"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`plan_required` (feature `webhook_replay`) on Free, with `X-Chronary-Plan`; `forbidden` for an agent-scoped key.","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`webhook_inactive`: the endpoint is paused or disabled (re-enable it first). `delivery_not_replayable`: the delivery is pending, delivered or a test event. `payload_redacted`: the payload was removed after the 30-day retention window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limit_error`: more than 30 replays in a minute (`Retry-After: 60`), or `quota_exceeded` for a hard-enforced plan at its monthly delivery limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/secret/rotate":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate the signing secret","description":"Generates a new signing secret and returns it once. The new secret signs `X-Signature` from the next delivery attempt, including retries and test events already queued. The replaced secret keeps signing `X-Signature-Previous` (same format, same `X-Timestamp`) until `expire_old_in` has passed, so a receiver can switch secrets without rejecting deliveries; `now` drops it at once. `expire_old_in` is `now`, `1h`, `24h` (default) or `7d`. Rotating again inside a grace window replaces the previous secret, so at most two secrets are valid at a time. Works on paused and disabled endpoints and never changes `active`. An `Idempotency-Key` replay within 24 hours returns the same new secret. **Requires a Developer or Pro plan** and an org-level API key (agent-scoped keys receive 403); a console session must have signed in within the last 5 minutes.","tags":["Webhooks"],"parameters":[{"schema":{"type":"string","example":"whk_01H9X4M2P5R8T6V0","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateWebhookSecret"}}}},"responses":{"200":{"description":"The new secret, shown once","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotatedWebhookSecret"}}}},"400":{"description":"Validation error: unknown `expire_old_in`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error`, or `reauth_required` for a console session (re-authenticate, then retry)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan upgrade required (`plan_required`, feature `webhook_secret_rotation`); `forbidden` for agent-scoped keys","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: another request rotated the secret at the same time. Try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ical-subscriptions/{id}":{"get":{"operationId":"getIcalSubscription","summary":"Get an iCal subscription","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"ics_01H9X4M2P5R8T6V0","description":"iCal subscription ID"},"required":true,"description":"iCal subscription ID","name":"id","in":"path"}],"responses":{"200":{"description":"iCal subscription details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSubscription"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateIcalSubscription","summary":"Update an iCal subscription","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"ics_01H9X4M2P5R8T6V0","description":"iCal subscription ID"},"required":true,"description":"iCal subscription ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateICalSubscription"}}}},"responses":{"200":{"description":"Updated iCal subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSubscription"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteIcalSubscription","summary":"Delete an iCal subscription","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"ics_01H9X4M2P5R8T6V0","description":"iCal subscription ID"},"required":true,"description":"iCal subscription ID","name":"id","in":"path"}],"responses":{"204":{"description":"iCal subscription deleted"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ical-subscriptions/{id}/sync":{"post":{"operationId":"syncIcalSubscription","summary":"Trigger an iCal subscription sync","description":"Starts an immediate fetch-and-merge of the feed in the background and returns 202. Read the subscription (or list the agent subscriptions) a few seconds later: last_synced_at and last_error show the outcome. Paused feeds return 409; one manual sync per feed per minute on paid plans and per 15 minutes on Free (429 with `Retry-After`, the seconds left).","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"ics_01H9X4M2P5R8T6V0","description":"iCal subscription ID"},"required":true,"description":"iCal subscription ID","name":"id","in":"path"}],"responses":{"202":{"description":"Sync started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSyncQueued"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: the feed is paused; or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ical-subscriptions/{id}/pause":{"post":{"operationId":"pauseIcalSubscription","summary":"Pause an iCal subscription","description":"Stops polling the feed: scheduled polls skip it and manual syncs return 409 until it is resumed. Busy blocks already imported stay. Pausing a paused feed changes nothing.","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"ics_01H9X4M2P5R8T6V0","description":"iCal subscription ID"},"required":true,"description":"iCal subscription ID","name":"id","in":"path"}],"responses":{"200":{"description":"The paused iCal subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSubscription"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ical-subscriptions/{id}/resume":{"post":{"operationId":"resumeIcalSubscription","summary":"Resume an iCal subscription","description":"Returns a paused or failing feed to scheduled polling and clears last_error. Resuming an active feed changes nothing.","tags":["iCal Subscriptions"],"parameters":[{"schema":{"type":"string","example":"ics_01H9X4M2P5R8T6V0","description":"iCal subscription ID"},"required":true,"description":"iCal subscription ID","name":"id","in":"path"}],"responses":{"200":{"description":"The resumed iCal subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICalSubscription"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Get usage and quota stats","description":"Returns current-month usage counters and plan limits for the authenticated organization.","tags":["Usage"],"responses":{"200":{"description":"Usage data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage/history":{"get":{"operationId":"getUsageHistory","summary":"Get monthly usage history","description":"Returns monthly totals for every monthly counter over the last 1-12 UTC calendar months (default 6), oldest first, ending with the current partial month. Not counted toward API calls. Only org-level API keys and console sessions may call this endpoint; agent-scoped keys receive 403.","tags":["Usage"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":12,"default":6},"required":false,"name":"months","in":"query"}],"responses":{"200":{"description":"Monthly usage history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageHistory"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audit-log":{"get":{"operationId":"listAuditLog","summary":"List audit-log entries","description":"Returns mutating API operations and auth lifecycle events for the calling organization, clamped to the per-tier retention window (Free: 3 days, Developer: 30 days, Pro: 90 days, Custom: per contract). Only org-level API keys may call this endpoint — agent-scoped keys receive 403.","tags":["Audit Log"],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Lower bound (inclusive). Clamped to retention window if older.","example":"2026-05-01T00:00:00.000Z"},"required":false,"description":"Lower bound (inclusive). Clamped to retention window if older.","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Upper bound (inclusive). Defaults to now.","example":"2026-05-11T00:00:00.000Z"},"required":false,"description":"Upper bound (inclusive). Defaults to now.","name":"to","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Filter by exact action name, e.g. agent.create. Legacy names (key.create, key.delete, key.regenerate) are matched by their current names.","example":"agent.create"},"required":false,"description":"Filter by exact action name, e.g. agent.create. Legacy names (key.create, key.delete, key.regenerate) are matched by their current names.","name":"action","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":32,"description":"Filter by the first 20 chars of the actor API key.","example":"chr_sk_abcdef12345"},"required":false,"description":"Filter by the first 20 chars of the actor API key.","name":"actor_key_prefix","in":"query"},{"schema":{"type":"string","enum":["session","org_key","agent_key","system"],"description":"Filter by who acted: `session`, `org_key`, `agent_key` or `system`.","example":"session"},"required":false,"description":"Filter by who acted: `session`, `org_key`, `agent_key` or `system`.","name":"actor_type","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Filter by actor id (an API key id, or the organization id for console sessions).","example":"0b6f8c1e-3d2a-4c55-9f7e-1a2b3c4d5e6f"},"required":false,"description":"Filter by actor id (an API key id, or the organization id for console sessions).","name":"actor_id","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Filter by the request id of the original call (its `X-Request-Id`).","example":"req_8e9f0a1b2c3d"},"required":false,"description":"Filter by the request id of the original call (its `X-Request-Id`).","name":"request_id","in":"query"},{"schema":{"type":"string","maxLength":64,"pattern":"^[a-z]{2,5}_[A-Za-z0-9_-]*$","description":"Filter by an entity id the request touched, or a bare id prefix such as `cal_` for every calendar entry.","example":"cal_"},"required":false,"description":"Filter by an entity id the request touched, or a bare id prefix such as `cal_` for every calendar entry.","name":"resource","in":"query"},{"schema":{"type":"string","enum":["2xx","3xx","4xx","5xx"],"description":"Filter by response status class.","example":"4xx"},"required":false,"description":"Filter by response status class.","name":"status_class","in":"query"},{"schema":{"type":"string","enum":["account","keys","agents","calendars","events","scheduling","webhooks","human_calendars","billing","security"],"description":"Filter by action category; matches every action in it, legacy names included.","example":"keys"},"required":false,"description":"Filter by action category; matches every action in it, legacy names included.","name":"category","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response."},"required":false,"description":"Opaque pagination cursor from a previous response.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (1–200). Defaults to 50.","example":50},"required":false,"description":"Page size (1–200). Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"Audit-log page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogResponse"}}}},"400":{"description":"Invalid query parameters"},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped key cannot access this resource"},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys":{"post":{"operationId":"createApiKey","summary":"Create an agent-scoped API key","description":"Creates a new `chr_ak_*` key scoped to a single agent. Only org-level API keys may call this endpoint. **Requires a Developer or Pro plan.**","tags":["API Keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScopedApiKey"}}}},"responses":{"201":{"description":"Scoped API key created","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedScopedApiKey"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan upgrade required (`plan_required`); `forbidden` for agent-scoped keys; `use_console_route` for console sessions — console sessions manage keys in the Chronary console; use an organization API key for this endpoint","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: scoped_keys_cap (body carries metric, limit, upgrade_url or contact_url, docs_url) or agent_inactive (the agent is decommissioned).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listApiKeys","summary":"List agent-scoped API keys","description":"Lists scoped keys for the authenticated organization. Only org-level API keys may call this endpoint. Available on every plan, so an org that moved to Free can still see the keys it minted on Pro.","tags":["API Keys"],"responses":{"200":{"description":"Scoped API keys","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedApiKeyList"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped keys (`chr_ak_*`) cannot call this endpoint — use an org-level key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys/{id}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an agent-scoped API key","description":"Revokes a scoped key by id. Only org-level API keys may call this endpoint. Available on every plan, so an org that moved to Free can still revoke keys it minted on Pro.","tags":["API Keys"],"parameters":[{"schema":{"type":"string","example":"db59cb2d-5bd6-4631-84e7-c65db55ff9f9"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Scoped API key revoked","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` for agent-scoped keys (`chr_ak_*`) — use an org-level key; `use_console_route` for console sessions — console sessions manage keys in the Chronary console; use an organization API key for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scheduling/proposals":{"post":{"operationId":"createProposal","summary":"Create a scheduling proposal","description":"Creates a new scheduling proposal with time slots. The organizer and all participants must be agents in your organization. **Requires a Developer or Pro plan.**","tags":["Scheduling"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"Q2 planning sync"},"description":{"type":"string","example":"Quarterly planning discussion"},"organizer_agent_id":{"type":"string","example":"agt_abc123def456"},"participant_agent_ids":{"type":"array","items":{"type":"string"},"example":["agt_abc123def456","agt_xyz789"]},"calendar_id":{"type":"string","example":"cal_abc123def456"},"slots":{"type":"array","items":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","example":"2026-05-01T10:00:00.000Z"},"end_time":{"type":"string","format":"date-time","example":"2026-05-01T11:00:00.000Z"},"weight":{"type":"number","example":1.5},"calendar_id":{"type":"string","example":"cal_abc123def456"}},"required":["start_time","end_time"]},"description":"1–20 candidate time slots"},"expires_at":{"type":"string","format":"date-time","example":"2026-05-01T00:00:00.000Z"},"metadata":{"type":"object","additionalProperties":{},"example":{}}},"required":["title","organizer_agent_id","participant_agent_ids","calendar_id","slots"]}}}},"responses":{"201":{"description":"Proposal created","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalSummary"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan upgrade required — feature is not available on the current plan","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Organizer or participant agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listProposals","summary":"List scheduling proposals","tags":["Scheduling"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"example":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","enum":["pending","resolving","confirmed","expired","cancelled"],"example":"pending"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","example":"agt_abc123def456"},"required":false,"name":"organizer_agent_id","in":"query"}],"responses":{"200":{"description":"Proposals list","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalList"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped keys (`chr_ak_*`) cannot call this endpoint — use an org-level key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scheduling/proposals/{id}":{"get":{"operationId":"getProposal","summary":"Get a scheduling proposal","description":"Returns the proposal with its slots and all responses. Available on every plan (creating proposals requires a Developer or Pro plan).","tags":["Scheduling"],"parameters":[{"schema":{"type":"string","example":"spr_abc123def456"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Proposal with slots and responses","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped keys (`chr_ak_*`) cannot call this endpoint — use an org-level key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scheduling/proposals/{id}/respond":{"post":{"operationId":"respondToProposal","summary":"Respond to a scheduling proposal","description":"Submit an accept, decline, or counter response. Only agents listed in participant_agent_ids may respond. Each agent may respond exactly once. If all participants have now responded, auto-resolution runs automatically. **Requires a Developer or Pro plan.**","tags":["Scheduling"],"parameters":[{"schema":{"type":"string","example":"spr_abc123def456"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RespondToProposalBody"}}}},"responses":{"200":{"description":"Response recorded","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent is not a participant, or a Developer or Pro plan required","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Proposal is not pending, agent already responded, or (on auto-resolve) the chosen slot conflicts with an existing hold; or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused) (the proposal calendar or a slot calendar; checked before the response is recorded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or (`quota_exceeded`, `metric: events`) the monthly event quota is used up so the resolved event cannot be created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scheduling/proposals/{id}/resolve":{"post":{"operationId":"resolveProposal","summary":"Manually resolve a scheduling proposal","description":"Runs the scoring algorithm immediately (without waiting for all participants to respond) and picks the best slot. If all existing responses are declines, the proposal is cancelled instead. **Requires a Developer or Pro plan.**","tags":["Scheduling"],"parameters":[{"schema":{"type":"string","example":"spr_abc123def456"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Resolution result","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResult"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan upgrade required — feature is not available on the current plan","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Proposal is not in a pending state (including `resolving` while another resolve runs), or the chosen slot conflicts with an existing hold; or `agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or (`quota_exceeded`, `metric: events`) the monthly event quota is used up so the resolved event cannot be created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scheduling/proposals/{id}/cancel":{"post":{"operationId":"cancelProposal","summary":"Cancel a scheduling proposal","description":"Cancels a pending proposal. Fires a proposal.cancelled webhook. Available on every plan, so an org that moved to Free can still cancel proposals it made on a paid plan.","tags":["Scheduling"],"parameters":[{"schema":{"type":"string","example":"spr_abc123def456"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Proposal cancelled","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResult"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped keys (`chr_ak_*`) cannot call this endpoint — use an org-level key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Proposal is not in a pending state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent/sign-up":{"post":{"operationId":"signUpAgent","summary":"Agent self-signup","description":"Create an organization and restricted API key by submitting an email and the current terms-of-service version.\n\nThree server-side dedup branches — all return HTTP 200 (or 409 only for stale ToS) to block email enumeration:\n\n- **New email** → returns `org_id` + `api_key`. OTP sent to email.\n- **Duplicate unverified-agent signup with current ToS** → opaque response (no `org_id`/`api_key`). OTP rotated and re-sent.\n- **Duplicate verified / console-origin org** → opaque response. No email sent.\n- **Stale `tos_version`** (agent-origin) → 409 with `current_version` hint.\n\nWhile sign-ups are paused (waitlist mode or early access full), every address gets the same 202 `{ waitlisted: true, message }` with no key and no `org_id`, whether it is new, already waitlisted or has an account.\n\nA new verification code for an unverified org is emailed at most once per 60 seconds, and at most 3 sign-up calls per hour and 10 per day are accepted for one address; past that the call returns the same opaque 200 and sends nothing. Wrong codes add up across re-sends: after 30, the code is burned and no new one is sent for 24 hours.\n\nThe returned key is bound to an *unverified* org. It is fully usable for reads and writes within the standard per-resource quotas, but the org cannot graduate from the introductory `free-agent-unverified` plan tier until you call `POST /v1/agent/verify` with the emailed OTP. Verification rotates the org to its normal plan (`free` or — during the soft-launch window — `pro` via the auto-grant capacity gate) when early access has room; otherwise the org keeps Sandbox limits until a spot opens (see `POST /v1/agent/verify`).\n\nRate limits: 5 requests per 60 seconds per client IP, plus a per-network sign-up budget (default 20 per UTC hour and 50 per UTC day per IPv4 address or IPv6 /64), plus 10 sign-ups per UTC hour per email domain (large consumer providers such as gmail.com and outlook.com are exempt). Over any limit returns 429 `rate_limit_error` with a `Retry-After` header.\n\nDisposable (throwaway) email addresses are refused with 400 `disposable_email` (`param: \"email\"`). Use a permanent address.\n\nAn address Chronary does not accept sign-ups from is refused with 400 `signup_blocked` (`param: \"email\"`) before any email is sent. Do not retry; contact support@chronary.ai.","tags":["Agent Auth"],"security":[],"x-agent-bootstrap":true,"x-agent-hint":"Call this first. Returns a restricted API key that works immediately for reads + writes. Follow up with POST /v1/agent/verify once the human reads the OTP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignUpBody"}}}},"responses":{"200":{"description":"Sign-up accepted. New-org payload includes keys; duplicate returns the opaque shape.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AgentSignUpNewOrgResponse"},{"$ref":"#/components/schemas/AgentSignUpOpaqueResponse"}]}}}},"202":{"description":"Sign-ups are paused. No key issued; the same body for every address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignUpWaitlistedResponse"}}}},"400":{"description":"Validation error, `disposable_email` when the address is a disposable (throwaway) email, or `signup_blocked` when sign-up is not available for the address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submitted tos_version is out of date. Includes current_version hint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: per-IP burst limit, per-network sign-up budget, or per-email-domain hourly budget. See `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/waitlist":{"post":{"operationId":"joinWaitlist","summary":"Join the waitlist","description":"Join the Chronary soft-launch waitlist. Creates a row in the `waitlist` intake table — no\norganization is created until the prospect is approved by a founder and clicks the signed\ninvite link sent to their email.\n\nEvery accepted request returns the same 202 body: a new email, one already on the list and one\nwith an active account are not told apart, and no entry fields are returned. Only a new email is\nsent the confirmation email.\n\nRate limit: per-IP and per-email via the public rate limiter.\n\nHuman check: while it is switched on, the request needs the `turnstile_token` from the console form,\nand a missing or rejected token returns 400 `challenge_failed`.","tags":["Waitlist"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinRequest"}}}},"responses":{"202":{"description":"Accepted. The same body whatever the email's state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`tos_version` is stale. Includes current_version hint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/capacity":{"get":{"operationId":"getCapacity","summary":"Public soft-launch capacity gauge","description":"Returns the percentage of soft-launch slots currently occupied. Public, unauthenticated,\nIP rate-limited.\n\nAbsolute slot counts are intentionally not exposed.\n\nAfter general availability the gauge always returns `{percent_full: 0, status: \"open\"}`.","tags":["Waitlist"],"security":[],"responses":{"200":{"description":"Current capacity gauge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapacityResponse"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invite/verify":{"get":{"operationId":"verifyInvite","summary":"Verify a soft-launch invite token","description":"Validates a signed invite token (purpose=`invite_claim`) and returns the email + expiry\nso the console can pre-fill the claim form. Read-only — does not consume the token.\nPublic, IP+token rate-limited.","tags":["Waitlist"],"security":[],"parameters":[{"schema":{"type":"string","minLength":20,"example":"eyJhbGciOiJIUzI1NiIs…"},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"Token is valid and entry is in `approved` state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteVerifyResponse"}}}},"400":{"description":"Token is missing or malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Entry has already been claimed or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Token has expired (`invalid_token`), or invites have closed because Chronary is generally available (`invite_closed`, with a `sign_up_url` for the normal sign-up).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invite/claim":{"post":{"operationId":"claimInvite","summary":"Claim a soft-launch invite","description":"Consumes a signed invite token and provisions an active org with `plan=pro`,\n`plan_source=soft_launch_invite`, `plan_expires_at=ga_date`. Mints a live + test API key\nand transitions the waitlist entry to `claimed`.\n\nOTP is intentionally skipped — token possession (delivered to the email captured at\nintake) is the email-ownership proof. Public, IP+token rate-limited.\n\nOnce `ga_date` has passed, every token gets 410 `invite_closed` (sign up normally instead).","tags":["Waitlist"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteClaimRequest"}}}},"responses":{"201":{"description":"Org created. Live + test API keys returned (only chance to see them).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteClaimResponse"}}}},"400":{"description":"Token is missing or malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Email already has an active account, or invite already claimed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Token has expired (`invalid_token`), or invites have closed because Chronary is generally available (`invite_closed`, with a `sign_up_url` for the normal sign-up).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent/verify":{"post":{"operationId":"verifyAgentOtp","summary":"Verify agent email OTP","description":"Promote a restricted agent key to full access by submitting the 6-digit OTP received via email.\n\nOn success the org transitions `status: unverified → verified`. The plan leaves the `free-agent-unverified` (Sandbox) tier: it moves to `free` (or, during the soft-launch window, `pro` via the auto-grant capacity gate) and `sandbox_promotion` is `promoted`. Only before general availability, when early access is full, the email is still verified, the org keeps Sandbox limits, `sandbox_promotion` is `capacity_full`, and the org leaves Sandbox automatically once a spot opens, to the plan it would have got with room (`free`, or `pro` while the soft-launch auto-grant is open); an `org.plan_changed` webhook announces it. `sandbox_promotion` is `null` when the org was no longer on Sandbox.\n\nOn any failure (wrong OTP / expired / already burned after 10 attempts / unknown org) the response is a generic 400 validation_error — no information is leaked about which precondition failed.","tags":["Agent Auth"],"x-agent-bootstrap":true,"x-agent-hint":"Submit the 6-digit OTP the human received via email. Upgrades the restricted key to the full plan tier. Returns generic 400 on any failure to prevent enumeration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVerifyBody"}}}},"responses":{"200":{"description":"OTP verified. `sandbox_promotion` says whether the org left Sandbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVerifyResponse"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: the per-API-key rate limit (10 requests/second per API key on Free, 25 on Developer, 50 on Pro) or the organization's combined limit across all its API keys (3x the per-key rate) was exceeded. An organization-limit 429 carries `Retry-After: 10` and `RateLimit-Policy: \"org\";q=<limit>;w=10`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feedback":{"post":{"operationId":"submitFeedback","summary":"Submit agent feedback","description":"Structured feedback for bugs, features, or friction. Logged to Chronary for triage — no DB record is created. Rate limited to **25 per day per organization** (UTC day). Available on all plans, including free.","tags":["Feedback"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFeedback"}}}},"responses":{"202":{"description":"Feedback accepted","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackAccepted"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Daily feedback limit reached","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}},"Retry-After":{"description":"Seconds until the daily feedback quota resets (next UTC midnight)","schema":{"type":"string","example":"43200"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar-connections/oauth/{provider}/start":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["google","microsoft"]},"required":true,"name":"provider","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."},"setup_link_id":{"type":"string"},"setup_intent":{"type":"string","minLength":16,"maxLength":256}}}}}},"responses":{"200":{"description":"Provider authorization URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionOAuthStart"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"startCalendarConnectionOAuth"}},"/v1/calendar-connections/oauth/complete":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"description":"Completes a calendar connection from the one-time exchange id the console receives after the provider consent screen. Single-use; requires the X-Chronary-CSRF header.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exchange":{"type":"string","maxLength":80}},"required":["exchange"]}}}},"responses":{"200":{"description":"Connection created or updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionOAuthComplete"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The plan calendar connection limit is reached (`quota_exceeded`, `metric: calendar_connections`). Reconnecting an account already connected is never refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The calendar provider rejected the authorization code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"completeCalendarConnectionOAuthExchange"}},"/v1/calendar-connections":{"get":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"responses":{"200":{"description":"Calendar connections","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionList"}}}}},"operationId":"listCalendarConnections"}},"/v1/calendar-connections/{id}":{"get":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calendar connection detail and safe sync health","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionDetail"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getCalendarConnection"},"patch":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."},"selected_external_calendar_ids":{"type":"array","items":{"type":"string"},"maxItems":50}}}}}},"responses":{"200":{"description":"Connection updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionMutation"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"updateCalendarConnection"},"delete":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"description":"Disconnect a calendar account. Removes its availability mappings and publishing destinations, and deletes what Chronary stored for it: access and refresh tokens, the account email, provider identifiers, calendar names, busy times and sync state. Google access is revoked at Google, unless another live connection uses the same Google account. Microsoft has no revoke Chronary can call, so the person removes access in their Microsoft account settings. Events already published to that calendar stay there. Requires the X-Chronary-CSRF header.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteCalendarConnection"}},"/v1/calendar-connections/{id}/external-calendars":{"get":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"External calendars and safe sync health","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCalendarList"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"listExternalCalendars"}},"/v1/calendar-connections/{id}/refresh":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"description":"Refreshes busy times from the provider now. At most one provider refresh per connection per 60 seconds: a call inside that window answers 202 with `refreshed: false` and makes no provider call. Requires the X-Chronary-CSRF header.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Refresh completed, or skipped (`refreshed: false`) because the connection was refreshed less than 60 seconds ago","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionRefresh"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Provider refresh failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`temporarily_disabled` (with `Retry-After`): sync with this provider is paused for a short time","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"refreshCalendarConnection"}},"/v1/calendar-connections/{id}/reauthorize":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."}}}}}},"responses":{"200":{"description":"Provider authorization URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionOAuthStart"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"reauthorizeCalendarConnection"}},"/v1/calendar-connections/{id}/publishing-failures":{"get":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"description":"Event publications to this Connection that failed (sync_status failed), newest first.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Publishing failures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishingFailureList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"listCalendarConnectionPublishingFailures"}},"/v1/calendar-connections/{id}/publishing-failures/{link_id}/retry":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"description":"Retry one failed publication. The retry runs in the background; poll the publishing failures to see the result. Requires the X-Chronary-CSRF header.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"link_id","in":"path"}],"responses":{"202":{"description":"Retry started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishingFailureRetry"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The publication is not failed, or the Connection is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"retryCalendarConnectionPublishingFailure"}},"/v1/calendar-connections/{id}/publishing":{"get":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"description":"Publishing destinations on this Connection, with the last outcome, failures in the last 7 days and the newest 5 failures.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publishing destinations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishingDestinationList"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"listCalendarConnectionPublishingDestinations"}},"/v1/calendar-connections/{id}/pause":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Connection paused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionMutation"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"pauseCalendarConnection"}},"/v1/calendar-connections/{id}/resume":{"post":{"tags":["Human Calendar Connections"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Connection resumed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectionMutation"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"resumeCalendarConnection"}},"/v1/availability-grants":{"post":{"tags":["Human Calendar Grants"],"security":[{"SessionAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_calendar_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"audience":{"type":"string","enum":["selected_agents","all_current_agents","all_org_agents"]},"agent_ids":{"type":"array","items":{"type":"string"},"maxItems":200,"default":[]}},"required":["external_calendar_ids","audience"]}}}},"responses":{"201":{"description":"Availability grant created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityGrant"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"createAvailabilityGrant"},"get":{"tags":["Human Calendar Grants"],"security":[{"SessionAuth":[]}],"responses":{"200":{"description":"Availability grants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityGrantList"}}}}},"operationId":"listAvailabilityGrants"}},"/v1/availability-grants/{id}":{"get":{"tags":["Human Calendar Grants"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Availability grant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityGrant"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getAvailabilityGrant"},"patch":{"tags":["Human Calendar Grants"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_calendar_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"audience":{"type":"string","enum":["selected_agents","all_current_agents","all_org_agents"]},"agent_ids":{"type":"array","items":{"type":"string"},"maxItems":200},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Availability grant updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityGrant"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"updateAvailabilityGrant"},"delete":{"tags":["Human Calendar Grants"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}},"operationId":"deleteAvailabilityGrant"}},"/v1/calendars/{id}/connection-links":{"post":{"tags":["Connection Setup Links"],"description":"Create a short-lived URL for a human to connect Google Calendar or Microsoft Outlook. The setup URL secret is returned only once; a reused pending link returns setup_url=null.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["availability","publishing"]},"minItems":1,"maxItems":2,"default":["availability"],"description":"Connection capabilities. \"availability\" reads free/busy to compute agent availability. \"publishing\" (writing confirmed Chronary events to the external calendar) is supported for Microsoft Outlook only — Google connections are availability-only and reject the \"publishing\" capability."},"publication_policy":{"type":"string","enum":["none","confirmed","confirmed_tentative"],"default":"none"}}}}}},"responses":{"201":{"description":"Connection setup link created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedConnectionLink"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"createConnectionSetupLink"}},"/v1/connection-links":{"get":{"tags":["Connection Setup Links"],"description":"List connection setup links, newest first. Open to console sessions and the Organization key; an Agent key sees only links for its own calendars. Never returns the setup secret.","parameters":[{"schema":{"type":"string","enum":["awaiting_human","in_progress","completed","declined","expired","cancelled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"calendar_id","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Connection setup links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionLinkList"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"listConnectionSetupLinks"}},"/v1/connection-links/{id}/decline":{"post":{"tags":["Connection Setup Links"],"security":[{"SessionAuth":[]}],"description":"A human declines a pending setup request. Only awaiting_human (not expired) or in_progress links can be declined; anything else returns 409. Requires the X-Chronary-CSRF header.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Connection link declined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclinedConnectionLink"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The link can no longer be declined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"declineConnectionSetupLink"}},"/v1/connection-links/{id}":{"get":{"tags":["Connection Setup Links"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Connection setup status; never replays the setup secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionLink"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getConnectionSetupLink"},"delete":{"tags":["Connection Setup Links"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}},"operationId":"deleteConnectionSetupLink"}},"/v1/calendars/{id}/external-destination":{"get":{"tags":["Human Calendar Publishing"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Current opt-in publishing destination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalDestinationResult"}}}}},"operationId":"getExternalCalendarDestination"},"put":{"tags":["Human Calendar Publishing"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_calendar_id":{"type":"string"},"policy":{"type":"string","enum":["confirmed","confirmed_tentative"],"default":"confirmed"}},"required":["external_calendar_id"]}}}},"responses":{"200":{"description":"Publishing destination set or replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalDestination"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_inactive`: the calendar belongs to a decommissioned agent and is read-only until the agent is restored (PATCH /v1/agents/{id}, status active or paused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"setExternalCalendarDestination"},"delete":{"tags":["Human Calendar Publishing"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}},"operationId":"deleteExternalCalendarDestination"}},"/v1/billing":{"get":{"operationId":"getBilling","summary":"Get billing status","description":"Plan, subscription status, renewal or cancellation date, Pro pricing and any pending upgrade request. Never contains payment-provider ids. Works even when the org has hit its usage limit. Org-level API keys or a console session; agent-scoped keys receive 403.","tags":["Billing"],"responses":{"200":{"description":"Billing summary","headers":{"X-Chronary-Plan":{"description":"The current plan of the authenticated organization (free | developer | pro | scale)","schema":{"type":"string","enum":["free","developer","pro","scale"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/upgrade-requests":{"post":{"operationId":"createUpgradeRequest","summary":"Ask a human to upgrade the plan","description":"Creates an upgrade request and emails the account owner. Give `approval_url` to your human — only a human can pay. At most one request is pending per org: a repeat call returns it with `reused: true` (200). Poll `GET /v1/billing/upgrade-requests/{id}` at most once a minute. Org-level API keys only; signed-in humans use the console Billing page instead. Honors `Idempotency-Key`.","tags":["Billing"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUpgradeRequest"}}}},"responses":{"200":{"description":"A pending request already existed (`reused: true`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}}},"201":{"description":"Upgrade request created; the owner is notified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}}},"400":{"description":"Validation error — invalid request body or query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agent-scoped key, console session (`use_billing_page`), or unverified email (`email_verification_required`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`already_subscribed` (a live subscription with no self-serve plan above it; a Developer subscriber may still ask for Pro), `payment_processing` (a first payment is still clearing), `unsupported_plan` (with `contact_url`), `founding_offer_pending` (early-access account — the founding offer opens at launch), or `upgrade_request_recently_declined` (with `retry_after`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`upgrade_request_limit` — at most 3 new requests per 24 hours (with `retry_after`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing is not configured on this environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/upgrade-requests/{id}":{"get":{"operationId":"getUpgradeRequest","summary":"Get an upgrade request","description":"Poll at most once a minute. After `completed`, wait about 15 seconds before retrying the call that hit the plan limit.","tags":["Billing"],"parameters":[{"schema":{"type":"string","example":"upr_V1StGXR8Z5jd","description":"Upgrade request ID"},"required":true,"description":"Upgrade request ID","name":"id","in":"path"}],"responses":{"200":{"description":"Upgrade request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/upgrade-requests/{id}/cancel":{"post":{"operationId":"cancelUpgradeRequest","summary":"Cancel an upgrade request","description":"Withdraw a pending upgrade request.","tags":["Billing"],"parameters":[{"schema":{"type":"string","example":"upr_V1StGXR8Z5jd","description":"Upgrade request ID"},"required":true,"description":"Upgrade request ID","name":"id","in":"path"}],"responses":{"200":{"description":"Upgrade request canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}}},"401":{"description":"Unauthorized — missing or invalid API key (`authentication_error`), or a key past its `expires_at` (`key_expired`: roll it or create a new one)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request is no longer pending — `error.status` carries its current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/upgrade-requests/{id}/decline":{"post":{"operationId":"declineUpgradeRequest","summary":"Decline an upgrade request (console only)","description":"Human-only: requires a console session and the `X-Chronary-CSRF: 1` header. API keys receive 403 `human_only`. A decline blocks new requests from the org for 72 hours.","tags":["Billing"],"security":[{"SessionAuth":[]}],"parameters":[{"schema":{"type":"string","example":"upr_V1StGXR8Z5jd","description":"Upgrade request ID"},"required":true,"description":"Upgrade request ID","name":"id","in":"path"}],"responses":{"200":{"description":"Upgrade request declined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}}},"401":{"description":"Missing or invalid console session — these endpoints require a console JWT, not an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — quota exceeded or operation not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request is no longer pending — `error.status` carries its current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{},"x-agent-self-signup":{"url":"https://api.chronary.ai/v1/agent/sign-up","verify_url":"https://api.chronary.ai/v1/agent/verify","restricted_key_returned":true,"human_in_the_loop":"otp_email","rate_limit":"5 requests per 60s per client IP"},"x-agent-bootstrap-script":{"npx":"npx @chronary/agent-init@latest","shell":"https://chronary.ai/agent-init.sh","description":"One-liner that performs sign-up, prompts for OTP, verifies, and creates a smoke calendar. Accepts CHRONARY_EMAIL and CHRONARY_OTP env vars for non-interactive flows."},"x-llms-txt":"https://docs.chronary.ai/llms.txt","x-llms-full-txt":"https://docs.chronary.ai/llms-full.txt","x-mcp-server-card":"https://chronary.ai/.well-known/mcp/server-card.json","x-api-catalog":"https://chronary.ai/.well-known/api-catalog"}