大日历 API
在大日历打开「API 与语音」,勾选需要的用途并创建密钥,把它设为调用端环境变量 CALENDAR_KEY。新密钥绑定一个账号,默认勾选五项普通用途,可保留其中任意一项或多项。私人联系人权限默认不勾选,需独立授权。「日程读写与开始事项」已含待办读写权限,单勾「待办读写」可将访问范围限制在待办接口。另有切换活动状态、上报睡眠专注及预约管理权限。创建时可选「90 天」(默认)或「永久」。已有密钥可以点「修改权限」重新勾选,或点「改为永久」并确认,调用端继续使用原密钥。每把密钥都能单独撤销。
预约管理(appointments)允许读取及维护本账号本人和其他密钥创建的计划预约、周期安排、休息与请假、工作预约和可约时间段。已有密钥需显式勾选此权限;不需要重新生成密钥。仅授予预约管理不会允许切换、开始或完成实际活动。已经开始或完成的记录及健身、饮食、课程、账单等来源数据仍受原服务保护;私人预约仍须单独授权 privatePeople。
读取日程和备注
base=https://data.rcyj.cc/center/api/calendar-center curl -fsS -H "Authorization: Bearer $CALENDAR_KEY" "$base/agenda?date=2026-11-24"
items 包含事项 ID、名称、备注 detail、来源、完成标记与计划时间。timeline 提供当天排程与活动,current 提供当日实际状态,workReservations 提供预约工作段。timeBlocks 区分睡眠保护、占用、空余和冲突时段。时间戳使用毫秒,日期及 HH:MM 使用 America/Los_Angeles。没有指定日期时读取今天。来源可用性见 sources。
当天有可靠的醒来记录时,timeline 会返回一条 kind=wake 的「已醒来」。source 表示本人确认(manual)、Apple 健康(health)或床区摄像头(camera)。这条记录只标记时间点,timeRange.startAt 和 timeRange.endAt 相同,basis 为 actual。
GET /month?month=2026-11读取月历日期、假日、休息及事项计数。GET /todos?date=2026-11-24只读取当天待办与备注。GET /recurring读取周期规则、最近完成日和修订号。
读取每项的时间范围
/agenda 的 items、timeline、workReservations(含各段 segments)、timeBlocks、holidays 和 current,以及 /todos 的 items 均提供 timeRange。date 为归属日期,timeZone 为日历时区。startAt 和 endAt 返回带时区偏移的 ISO 8601 日期时间,未知的端点为 null。
{"kind":"timed","basis":"planned","date":"2026-11-24","timeZone":"America/Los_Angeles",
"startAt":"2026-11-24T14:10:00-08:00","endAt":"2026-11-24T14:35:00-08:00"}
kind 为 timed(起止已知)、start_only、end_only、unscheduled(待安排)或 all_day(全天)。basis 为 planned(计划)、actual(实际)或 availability(可用时间安排)。进行中的活动可以只有实际开始时间。无固定时段的理发或账单事项,两端都为 null,可另读 minutes 和 remindTime。
创建、编辑和勾选
curl -fsS -X POST -H "Authorization: Bearer $CALENDAR_KEY" \
-H 'Content-Type: application/json' "$base/todos" \
-d '{"action":"save","date":"2026-11-24","title":"买猫粮","detail":"带购物袋","startTime":"14:10","minutes":25,"requestId":"shopping-20261124-1"}'
大日历密钥可向 /agenda 或 /todos 提交相同的待办写操作。时间和时长可留空。需要检测具体重叠时两者都填。保存成功返回 item.id、conflicts 和 conflictCheck。本人在网页上可以故意保留重叠。Bot 保存或调整完整时段时会在写入前校验。来源暂不可查时,unavailable 表示冲突检查不完整。普通日程或待办密钥仍只可修改自己创建的事项;拥有 appointments 权限可编辑其他来源为 personal 或 bot 的尚未执行的弹性计划项。来源事项仍由相应服务管理。勾选用 action:"check",done:true:/agenda 需要原 agenda 权限,/todos 需要原 agenda 或 todos 权限;既有完成规则不变,预约管理权限本身不允许勾选完成。
修改、取消或移动预约
先读取原日期的 /agenda 或 /todos,使用可编辑事项的 id 与 updatedAtMs。下列是带预约管理权限的示例,示例中的 ID、时间、版本按实际读取结果替换。已有事项的修改、移期或删除需提交 expectedUpdatedAtMs 和独立 requestId;网络重试复用原编号,不要换号重复写入。date 是事项当前日期,targetDate 是移期目标日期,移动保留原 ID。修改、删除只作用于计划,不改写实际活动。
POST /agenda
{"action":"save","date":"2026-11-24","id":"ITEM_ID","startTime":"15:00","minutes":35,"expectedUpdatedAtMs":1795550000000,"requestId":"appointment-edit-1"}
{"action":"move","date":"2026-11-24","id":"ITEM_ID","targetDate":"2026-11-25","expectedUpdatedAtMs":1795550000000,"requestId":"appointment-move-1"}
{"action":"delete","date":"2026-11-25","id":"ITEM_ID","expectedUpdatedAtMs":1795640000000,"requestId":"appointment-delete-1"}
读取来源同步状态
/agenda、/todos、/day、/month、/recurring、/leave、/availability 和 /work-slots 的读响应包含 updatedAt、updatedAtMs 和 stale。前两项表示响应时间。每个 sources.<name> 包含 status、lastSyncedAt、lastSyncedAtMs、stale 和 reason。成功同步距今超过 24 小时,或连接失败、来源无法核实,都标记过期。无法核实上次成功时间时返回 null。bills 表示大日历成功读取账单数据的时间。银行流水同步请查财务接口。Preply 中转与 Google 日历分别按各自来源证据显示。
密钥读请求默认使用结构化 sources,sourceStates 保留旧状态文本。本人登录读取 /day 或 /month 时默认兼容随行和手表,sources 为旧文本,结构化字段位于 sourceFreshness。所有上述接口可传 sourceFormat=structured 或 sourceFormat=legacy 显式选择。再次运行 Bot 时重新 GET。如果 stale=true,提示「数据可能过时」及已知的最后同步时间,等来源核实后再催付款或重复提交。
排程预览与应用(appointments)
POST /todos 和 POST /agenda 接受 scheduleKind(fixed、flexible)、priority(1 最高,3 最低)、planningCategory(other、training、study、meal)。新建个人或 Bot 事项默认弹性、优先级 2。课程、工作、睡眠保护、已确认的私人预约和来源记录受保护。/agenda、/todos 和时间轴返回计划字段。旧弹性事项加入自动排程前,先写入 scheduleKind:"flexible",并确认 autoMovable 为 true。
Bot 调整固定事项时返回 HTTP 409 及 event_is_fixed。新时段冲突时返回 calendar_conflict 和规则编号,并创建待拍板事项。必要来源状态不完整时返回 source_unavailable。日期和时间按 America/Los_Angeles 解释。
POST /plan
{"horizon":"day","date":"2026-11-24","dryRun":true,"requestId":"day-preview-1"}
POST /plan
{"horizon":"day","date":"2026-11-24","dryRun":false,
"requestId":"day-apply-1","expectedPreview":"VALUE_OF_previewRevision"}
确认预览的 placed、unchangedFixed、unresolved 和 warnings 后,把预览的 previewRevision 放进 expectedPreview。重试已提交的应用时复用原请求体和 requestId。遇到 planning_changed 时重新预览。week 接受周一或前一日周日,按每个事项原有日期安排时段。
排程保护 8 小时睡眠,保留 15 分钟间隔。每个自然周最多安排 6 次训练,少于 5 次会提示。餐后 60 分钟内不排训练,学习至少连续 45 分钟。应用保存可验证的排程,余下冲突进入待拍板。progressStatus 可显示 not_started、in_progress、pending_confirm 或 done。到点推进计划进度,current 仍显示实际活动,完成以来源信号或授权勾选为准。
休息日与请假(appointments)
读取所选日期所在自然周(周一至周日)的安排及 revision:
GET /leave?date=2026-11-25
POST /leave 每次传入 date、最新 expectedRevision 和唯一 commandId。全天休息用 full,半天用 am、pm 或 half。rule 设置从指定日期生效的固定周休,fixedWeekdays 为 0–2 个不重复的星期编号(周一=1、周日=7)。move 为同周调休,目标必须尚未过去且未安排周休。clear 取消指定日周休;sick 病假、unsick 取消病假、personal 个人假、unleave 取消请假均按日操作。不能修改过去日期或超过周休额度;变更休息日不会自动删除健身或饮食计划。
POST /leave
{"action":"flex","date":"2026-11-25","rest":"full","expectedRevision":7,"commandId":"rest-wed-1"}
{"action":"move","date":"2026-11-25","targetDate":"2026-11-26","expectedRevision":8,"commandId":"rest-move-1"}
{"action":"clear","date":"2026-11-26","expectedRevision":9,"commandId":"rest-clear-1"}
{"action":"rule","date":"2026-11-30","fixedWeekdays":[1,3],"expectedRevision":10,"commandId":"rest-rule-1"}
{"action":"sick","date":"2026-11-25","expectedRevision":11,"commandId":"sick-1"}
{"action":"unsick","date":"2026-11-25","expectedRevision":12,"commandId":"sick-clear-1"}
{"action":"personal","date":"2026-11-25","expectedRevision":13,"commandId":"personal-leave-1"}
{"action":"unleave","date":"2026-11-25","expectedRevision":14,"commandId":"leave-clear-1"}
工作预约和常规班(appointments)
先 GET /work-slots?date=2026-11-24,取得 revision、reservations 和 regularSchedule。仅可取消或改约尚未开始的手动预约;常规班由 setRegular 设置而非逐条改约。预约时间为洛杉矶当地时刻对应的 Unix 毫秒,结束可在当日或次日。修改已有预约使用 reschedule;date 指原预约日期,targetDate 可选填以确认目标日期。每次 POST 使用最新版本和独立 commandId,重试用同一编号。实际在线工作与已经保存的历史保持不变。
POST /work-slots
{"action":"reserve","date":"2026-11-24","startAtMs":1795554000000,"endAtMs":1795561200000,"expectedRevision":5,"commandId":"work-book-1"}
{"action":"reschedule","date":"2026-11-24","id":"RESERVATION_ID","targetDate":"2026-11-25","startAtMs":1795640400000,"endAtMs":1795647600000,"expectedRevision":6,"commandId":"work-move-1"}
{"action":"cancel","date":"2026-11-25","id":"RESERVATION_ID","expectedRevision":7,"commandId":"work-cancel-1"}
{"action":"setRegular","date":"2026-11-30","enabled":true,"startTime":"13:00","endTime":"19:00","endNextDay":false,"expectedRevision":8,"commandId":"work-rule-1"}
{"action":"setRegular","date":"2026-12-07","enabled":false,"expectedRevision":9,"commandId":"work-rule-off-1"}
可约时间段(appointments)
从 GET /availability?date=2026-11-25 或当日 /agenda 读取 availability,将当前完整列表原样放入 expectedWindows;windows 是希望保存的完整列表,不能重叠,时间格式 HH:MM 且必须在同一天内。设为空列表可清空时段。版本冲突返回 409,需重新读取;请勿用此接口修改休息日(休息日使用 /leave)。
POST /availability
{"date":"2026-11-25","expectedWindows":[],"windows":[{"start":"13:00","end":"15:00"}]}
立即开始今天的事项
POST /agenda
{"action":"start","date":"2026-11-24","itemId":"上一步返回的事项 ID","commandId":"start-shopping-20261124"}
此操作需要 agenda 权限,不属于 appointments 权限。开始一次后重试须使用同一 commandId。活动实际开始时间由服务器确定。普通事项在同一时刻交接。工作在线时返回 HTTP 409,需先在工作端下线;学习等受保护事项需要在对应来源结束。可带 expectedActivityId 校验当前事项,传 null 表示预期空闲。仅保存安排不会切换实际状态。此权限涵盖主动切换普通活动,请只交给有权替你开始事项的应用。
周期与提醒
POST /recurring
{"action":"save","title":"理发","detail":"带会员卡","firstDate":"2026-11-24","everyDays":20,"weekdays":[6,7],"remindTime":"10:00","minutes":45,"requestId":"haircut-rule-1"}
everyDays 可设 1 至 3650 天,weekdays 选填,周一至周日为 1 至 7,到期后顺延到允许的星期。remindTime 为当地提醒时间,传 null 关闭提醒。到期未办的同类事项在今天显示最近一期,原应办日在 dueDate,服务恢复后多个错过的提醒合并为一条。事项到期进入今日待办,完成后从实际完成日重新计周期。
更新时带规则 id 与最新 expectedRevision 防止覆盖其他端的改动。complete 标记完成,skip 跳过本次,postpone 延后本次;针对某次操作带 occurrenceDate,推迟另带 targetDate,不符合指定星期的日期向后移至下一允许日;如与本系列已有日期冲突,返回 409 且原周期不变。每个写操作使用独立 requestId,同一操作网络重试可复用。删除规则使用 delete。预约管理权限可以跨本人及其他密钥管理周期计划,但不能单独调用 complete。
私人联系人与预约(独立授权)
只有另行勾选 privatePeople 权限的密钥才可读取本账号的私人联系人列表与照片。目录返回每位联系人的名称、状态编号 stateId 和私人日历头像引用。头像请求必须携带同一账号有效的 Bearer 密钥,不能使用公开链接,也不会进入 WhatsApp 或卡通头像库。新建私人联系人及上传真人照片仅允许本人在登录后的日历界面操作。
curl -fsS -H "Authorization: Bearer $CALENDAR_KEY" "$base/private-people" curl -fsS -H "Authorization: Bearer $CALENDAR_KEY" "$base/private-people/avatar?stateId=STATE_ID"
若密钥同时拥有 privatePeople 与 agenda、todos 或 appointments 权限,外部应用可以在保存个人待办或预约时传入列表中某个联系人的具体 stateId。这只会创建日程安排,不会开启或结束真实活动。
POST /todos
{"action":"save","date":"2026-11-24","title":"私人预约","stateId":"STATE_ID","startTime":"19:00","minutes":60,"requestId":"private-appointment-1"}
私人活动必须由本人在网页或手机端明确确认后开始;外部 API、语音以及快捷指令不能直接开始或结束。不要把联系人姓名、头像或此类授权密钥转交给无关服务。
401 表示密钥失效,403 表示权限不足,409 表示版本、指令或活动状态冲突。请先读取最新日程,再决定是否重试。
Calendar API
Open “API & voice” in the Calendar, select the grants you need, create a key and set it as the CALENDAR_KEY environment variable in your client. Every key belongs to one account. The five regular grants are selected by default and can be used individually or together. Private people is a separate, opt-in grant. “Read/write schedule and start tasks” includes to-do access. Selecting only “Read/write to-dos” limits access to the to-do endpoints. Other grants cover activity switching, Sleep Focus reports and appointment management. Choose “90 days” (default) or “Permanent” when creating a key. You can edit the grants, make a key permanent with confirmation, or revoke it without changing another key.
Appointment management (appointments) covers planned appointments and recurrence rules created by you or other keys in this account, days off and leave, work reservations and bookable windows. Explicitly enable this grant for an existing key; there is no need to create a replacement. Appointment management alone does not permit starting, switching or completing actual activities. Started and completed records and source data from fitness, meals, lessons and billing remain protected. Private appointments still require the separate privatePeople grant.
Read the schedule and notes
base=https://data.rcyj.cc/center/api/calendar-center curl -fsS -H "Authorization: Bearer $CALENDAR_KEY" "$base/agenda?date=2026-11-24"
items includes each item's ID, title, notes (detail), source, completion flag and planned time. timeline contains the day's schedule and activities, current contains the actual current activity, and workReservations contains reserved work periods. timeBlocks distinguishes protected sleep, occupied, available and conflicting periods. Numeric timestamps are milliseconds. Dates and HH:MM use America/Los_Angeles. If no date is supplied, the endpoint returns today. See sources for source availability.
When reliable wake evidence exists, timeline includes a “Woke up” row with kind=wake. Its source is personal confirmation (manual), Apple Health (health) or a bed-area camera observation (camera). This is a point in time: timeRange.startAt and timeRange.endAt are equal and basis is actual.
GET /month?month=2026-11returns calendar dates, holidays, days off and item counts.GET /todos?date=2026-11-24returns the day's to-dos and notes only.GET /recurringreturns recurrence rules, last completion dates and revisions.
Read each item's time range
/agenda provides timeRange on items, timeline, workReservations (including each booking's segments), timeBlocks, holidays and current. /todos provides it on items as well. date is the relevant civil date and timeZone is the calendar's zone. startAt and endAt return ISO 8601 timestamps with timezone offsets; an unknown endpoint is null.
{"kind":"timed","basis":"planned","date":"2026-11-24","timeZone":"America/Los_Angeles",
"startAt":"2026-11-24T14:10:00-08:00","endAt":"2026-11-24T14:35:00-08:00"}
kind is timed (both endpoints known), start_only, end_only, unscheduled or all_day. basis is planned, actual or availability. An active activity may have only an actual start time. For flexible haircuts or bills, both endpoints may be null; read minutes and remindTime separately.
Create, edit and check off items
curl -fsS -X POST -H "Authorization: Bearer $CALENDAR_KEY" \
-H 'Content-Type: application/json' "$base/todos" \
-d '{"action":"save","date":"2026-11-24","title":"Buy cat food","detail":"Bring a shopping bag","startTime":"14:10","minutes":25,"requestId":"shopping-20261124-1"}'
A schedule grant can submit the same to-do write operations to /agenda or /todos. Both the time and duration are optional; provide both to check exact overlaps. A successful save returns item.id, conflicts and conflictCheck (where supported by the agenda write). The owner can deliberately overlap plans in the web UI. A Bot create or edit that sets a complete time range is checked before saving. If a source is unavailable, unavailable means the conflict check is incomplete. A regular schedule or to-do key can edit only the items it created; the appointments grant may edit other unexecuted flexible planned items with personal or bot sources. Source-owned tasks remain managed by their respective services. Checking an item off with action:"check",done:true requires the original agenda grant on /agenda, or agenda or todos on /todos. Existing completion rules still apply; appointment management alone does not allow completion.
Edit, cancel or reschedule appointments
First read /agenda or /todos for the original date and use the editable item's id and updatedAtMs. The following examples require the appointment-management grant; replace example IDs, timestamps and versions with actual values. Editing, moving or deleting an existing item requires expectedUpdatedAtMs and a distinct requestId. Reuse the same request ID for a retry, rather than submitting a new write. date is the item's current date and targetDate is the destination date. Moving retains the original ID. Planned changes do not rewrite actual activity records.
POST /agenda
{"action":"save","date":"2026-11-24","id":"ITEM_ID","startTime":"15:00","minutes":35,"expectedUpdatedAtMs":1795550000000,"requestId":"appointment-edit-1"}
{"action":"move","date":"2026-11-24","id":"ITEM_ID","targetDate":"2026-11-25","expectedUpdatedAtMs":1795550000000,"requestId":"appointment-move-1"}
{"action":"delete","date":"2026-11-25","id":"ITEM_ID","expectedUpdatedAtMs":1795640000000,"requestId":"appointment-delete-1"}
Read source freshness
Reads from /agenda, /todos, /day, /month, /recurring, /leave, /availability, and /work-slots include updatedAt, updatedAtMs, and stale. The first two fields report response time. Each sources.<name> reports status, lastSyncedAt, lastSyncedAtMs, stale, and reason. A last success more than 24 hours ago, a failed connection, or missing source evidence marks the data stale. An unverified last successful sync is null. bills reports the calendar’s successful bill read. Check Finance for bank synchronization status. Preply relay and Google Calendar freshness use evidence from their respective sources.
Key-authenticated reads return structured sources by default, with the previous text statuses in sourceStates. Owner-session /day and /month default to legacy text statuses for Drive on iOS and Watch, with detailed data in sourceFreshness. Select a format explicitly with sourceFormat=structured or sourceFormat=legacy. Bots should GET a fresh response on each run. If stale=true, report that the data may be out of date with the last verified sync when known. Verify the source before prompting for a repeat payment or submission.
Preview and apply a schedule (appointments)
POST /todos and POST /agenda accept scheduleKind (fixed or flexible), priority (1 highest through 3), and planningCategory (other, training, study, or meal). New personal and Bot items default to flexible priority 2. Classes, work, protected sleep, confirmed private appointments, and source-owned records are protected. Read these fields from /agenda, /todos, and the timeline. To opt an older flexible item in, write scheduleKind:"flexible" and verify that autoMovable is true.
A Bot attempt to edit a fixed item returns HTTP 409 with event_is_fixed. A conflict returns calendar_conflict with the relevant rule and creates an item for review. A required source that cannot be verified returns source_unavailable. Dates and local clocks use America/Los_Angeles.
POST /plan
{"horizon":"day","date":"2026-11-24","dryRun":true,"requestId":"day-preview-1"}
POST /plan
{"horizon":"day","date":"2026-11-24","dryRun":false,
"requestId":"day-apply-1","expectedPreview":"VALUE_OF_previewRevision"}
Review placed, unchangedFixed, unresolved, and warnings. Apply with the returned previewRevision as expectedPreview. Retry with the original body and request ID. Preview again on planning_changed. A week starts on Monday and can also be requested on the preceding Sunday. Weekly plans schedule items within their original dates.
The planner protects eight hours of sleep, keeps 15 minutes between items, allows at most six training sessions per week, leaves 60 minutes after meals before training, and schedules at least 45 continuous minutes for study. A weekly plan warns when fewer than five training sessions are known. Apply saves verifiable placements and makes unresolved conflicts available for review. progressStatus reports not_started, in_progress, pending_confirm, or done. Scheduled times advance planned progress. current shows the actual activity, and completion requires source evidence or an authorized check.
Days off and leave (appointments)
Read the selected date's civil week (Monday through Sunday) and revision:
GET /leave?date=2026-11-25
Every POST /leave includes date, the current expectedRevision and a unique commandId. Use full for a full day off, or am, pm or half for half a day. rule sets fixed days off effective from the specified date: fixedWeekdays contains zero to two distinct weekday numbers (Monday=1, Sunday=7). move moves a day off within the same week to a nonpast date that has no day off. clear removes a day's rest. Day-specific leave actions are sick, unsick, personal and unleave. Past dates and weekly quota violations cannot be changed. Changing days off does not automatically remove fitness or meal plans.
POST /leave
{"action":"flex","date":"2026-11-25","rest":"full","expectedRevision":7,"commandId":"rest-wed-1"}
{"action":"move","date":"2026-11-25","targetDate":"2026-11-26","expectedRevision":8,"commandId":"rest-move-1"}
{"action":"clear","date":"2026-11-26","expectedRevision":9,"commandId":"rest-clear-1"}
{"action":"rule","date":"2026-11-30","fixedWeekdays":[1,3],"expectedRevision":10,"commandId":"rest-rule-1"}
{"action":"sick","date":"2026-11-25","expectedRevision":11,"commandId":"sick-1"}
{"action":"unsick","date":"2026-11-25","expectedRevision":12,"commandId":"sick-clear-1"}
{"action":"personal","date":"2026-11-25","expectedRevision":13,"commandId":"personal-leave-1"}
{"action":"unleave","date":"2026-11-25","expectedRevision":14,"commandId":"leave-clear-1"}
Work reservations and regular shifts (appointments)
First GET /work-slots?date=2026-11-24 to obtain revision, reservations and regularSchedule. Only future manual reservations may be canceled or rescheduled. Manage regular shifts using setRegular, rather than editing individual projected occurrences. Reservation times use Unix milliseconds corresponding to Los Angeles local time and may end the same or following day. Use reschedule to change an existing reservation; date identifies its original date and targetDate optionally confirms the derived target date. Every POST uses the latest revision and a distinct commandId (reused on retry). Actual online work and recorded history remain unchanged.
POST /work-slots
{"action":"reserve","date":"2026-11-24","startAtMs":1795554000000,"endAtMs":1795561200000,"expectedRevision":5,"commandId":"work-book-1"}
{"action":"reschedule","date":"2026-11-24","id":"RESERVATION_ID","targetDate":"2026-11-25","startAtMs":1795640400000,"endAtMs":1795647600000,"expectedRevision":6,"commandId":"work-move-1"}
{"action":"cancel","date":"2026-11-25","id":"RESERVATION_ID","expectedRevision":7,"commandId":"work-cancel-1"}
{"action":"setRegular","date":"2026-11-30","enabled":true,"startTime":"13:00","endTime":"19:00","endNextDay":false,"expectedRevision":8,"commandId":"work-rule-1"}
{"action":"setRegular","date":"2026-12-07","enabled":false,"expectedRevision":9,"commandId":"work-rule-off-1"}
Bookable time windows (appointments)
Read availability from GET /availability?date=2026-11-25 or the day's /agenda and put the full current list in expectedWindows. windows is the full desired list, in nonoverlapping HH:MM intervals on the same date; an empty list clears it. A conflicting update returns 409, so reread before retrying. Use /leave rather than this endpoint to change days off.
POST /availability
{"date":"2026-11-25","expectedWindows":[],"windows":[{"start":"13:00","end":"15:00"}]}
Start today's ordinary task now
POST /agenda
{"action":"start","date":"2026-11-24","itemId":"RETURNED_ITEM_ID","commandId":"start-shopping-20261124"}
This action requires the agenda grant, not appointments. Reuse the same commandId when retrying a start request. The server determines the actual start time. Ordinary activities hand over at the same instant. Starting while working returns HTTP 409; first go offline in the work app. Protected activities such as a lesson must end in their own source app. Optionally send expectedActivityId to verify the current activity; use null to expect idle. Saving a schedule does not switch the actual activity. Grant this permission only to applications entitled to start ordinary tasks on your behalf.
Recurrence and reminders
POST /recurring
{"action":"save","title":"Haircut","detail":"Bring membership card","firstDate":"2026-11-24","everyDays":20,"weekdays":[6,7],"remindTime":"10:00","minutes":45,"requestId":"haircut-rule-1"}
everyDays ranges from 1 to 3650 days. Optional weekdays uses 1 for Monday through 7 for Sunday. Once due, a task moves forward to the next allowed weekday. remindTime uses local time; set it to null to disable the reminder. The latest unresolved occurrence appears in today's to-dos with its original due date in dueDate. Missed reminders are combined after the service returns. Completing an occurrence restarts the interval from the actual completion date.
To update a rule, include its id and latest expectedRevision to prevent overwriting a concurrent edit. complete records completion, skip skips this occurrence, and postpone moves this occurrence. Include occurrenceDate for a specific occurrence; postponement also requires targetDate. A date outside the allowed weekdays moves forward to the next eligible day. If that date conflicts with another occurrence of the same rule, the operation returns 409 without changing its cadence. Use a distinct requestId for each write and reuse it only for retries of the same operation. Delete a rule with delete. Appointment management permits planning recurrence rules created by you or other keys, but alone does not permit complete.
Private people and appointments (separate grant)
Only a key explicitly granted privatePeople can read this account's private people and photos. The directory supplies each person's name, concrete activity stateId and private calendar portrait reference. Portrait requests require the same account's authorized Bearer key, are not public, and are never used for WhatsApp or cartoon avatar generation. Adding a private person and uploading their photo are owner-only actions in the signed-in Calendar UI.
curl -fsS -H "Authorization: Bearer $CALENDAR_KEY" "$base/private-people" curl -fsS -H "Authorization: Bearer $CALENDAR_KEY" "$base/private-people/avatar?stateId=STATE_ID"
If the key also has the agenda, todos or appointments grant, an external application can include the concrete stateId obtained from the private directory when creating a to-do or appointment. This creates a schedule only. It does not start or end an actual activity.
POST /todos
{"action":"save","date":"2026-11-24","title":"Private appointment","stateId":"STATE_ID","startTime":"19:00","minutes":60,"requestId":"private-appointment-1"}
Only the owner can start a private activity after explicit confirmation on the web or phone. External APIs, voice commands and shortcuts cannot start or end private activities. Do not share private names, portraits or an API key that has this grant with unrelated services.
401 means the key is invalid, 403 means the permission is insufficient, and 409 means a revision, command or activity-state conflict. Read the latest schedule before deciding whether to retry.