{ "paths": { "/calendars/{id}/export.ics": { "get": { "tags": ["ICS"], "summary": "Export calendar as ICS", "description": "Exports all events from a calendar in ICS (iCalendar) format. Requires `calendars:read` scope.", "operationId": "exportCalendarICS", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Calendar ID" } ], "responses": { "200": { "description": "ICS calendar file", "content": { "text/calendar": { "schema": { "type": "string" } } } }, "401": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Insufficient scope or permission", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Calendar not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/calendars/import": { "post": { "tags": ["ICS"], "summary": "Import an ICS file", "description": "Imports events from an ICS file into a specified calendar. The file is sent as multipart form data. Requires `calendars:write` scope.", "operationId": "importCalendarICS", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": ["calendar_id", "file"], "properties": { "calendar_id": { "type": "string", "format": "uuid", "description": "Target calendar ID" }, "file": { "type": "string", "format": "binary", "description": "ICS file to import" } } } } } }, "responses": { "200": { "description": "Import successful", "content": { "application/json": { "schema": { "type": "object", "required": ["ok", "imported"], "properties": { "ok": { "type": "boolean", "example": true }, "imported": { "type": "object", "properties": { "events": { "type": "integer", "example": 12 } } } } } } } }, "400": { "description": "Validation error or invalid ICS", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Insufficient scope or permission", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } } }