ドキュメント本文へスキップ
API

カレンダーの購読

リンクで購読するほかのカレンダー。その予定は読み取り専用でカレンダーに表示される。

POST/calendar/subscriptions

5件の呼び出しをワークスペースに対して実行します。

POST /calendar/subscriptions

リンクで購読するほかのカレンダー。その予定は読み取り専用でカレンダーに表示される。

購読する

calendar:write が必要。url は iCalendar ファイルへの https、http、webcal のいずれかのリンクで、name を省略するとカレンダー自身が付けている名前になる。

curl
curl -X POST "$OE/calendar/subscriptions" -H "$AUTH" -H 'content-type: application/json' -d '{ "url": "webcal://example.com/holidays.ics", "color": "green" }'
レスポンス
{  "object": "calendar_subscription",  "id": "csb_8d3f0a2b9c4e41f7a6b5c2d1",  "name": "Public holidays",  "url": "https://example.com/holidays.ics",  "color": "green",  "status": "active",  "lastError": null,  "eventCount": 24,  "lastSyncedAt": "2026-10-10T12:00:03.000Z",  "lastFetchedAt": "2026-10-10T12:00:03.000Z",  "createdAt": "2026-10-10T12:00:01.000Z"}

カレンダーは購読後すぐに読み込まれ、その後は約 30 分ごとに読み込み直される。GET /calendar/subscriptions は購読を一覧表示し、PATCH /calendar/subscriptions/{id} は購読の名前や color を変更し、POST /calendar/subscriptions/{id}/refresh は今すぐ読み込み直し、DELETE /calendar/subscriptions/{id} は購読をその予定ごと削除する。

カレンダーを返さないリンクは 422 calendar_subscription_unreadable、すでに購読しているリンクは 409 calendar_subscription_exists、前回の読み込みから 1 分以内の再読み込みは 429 calendar_subscription_refresh_too_soon。読み込みが失敗している間は status が failing になり、10 回続けて失敗すると stopped になる。理由は lastError に入る。

購読から来た予定にはその subscriptionId が付き、変更できない。変更しようとすると 403 event_read_only。一部のアドレスやドメインに限定されたキーは 422 capability_unsupported。

リファレンス