- OpenAPI: add missing endpoints (add-from-url, subscriptions, public availability) - OpenAPI: CalendarSubscription schema, Subscriptions tag - Frontend app - Migrations: count_for_availability, subscriptions_sync, user_preferences, calendar_settings - Config, rate limit, auth, calendar, booking, ICS, availability, user service updates Made-with: Cursor
207 lines
9.1 KiB
JSON
207 lines
9.1 KiB
JSON
{
|
|
"paths": {
|
|
"/calendars/add-from-url": {
|
|
"post": {
|
|
"tags": ["ICS"],
|
|
"summary": "Add calendar from iCal URL",
|
|
"description": "Creates a new calendar, fetches the iCal feed from the given URL, imports all events, and creates a subscription for future syncs. One-step flow for adding external calendars. Requires calendars:write scope.",
|
|
"operationId": "addCalendarFromURL",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["url"],
|
|
"properties": {
|
|
"url": { "type": "string", "format": "uri", "description": "iCal feed URL (http, https, or webcal)", "example": "https://example.com/calendar.ics" },
|
|
"name": { "type": "string", "description": "Optional calendar name", "example": "Work" },
|
|
"color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$", "example": "#3B82F6" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Calendar created and events imported",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["ok", "calendar", "imported", "source"],
|
|
"properties": {
|
|
"ok": { "type": "boolean", "example": true },
|
|
"calendar": { "$ref": "#/components/schemas/Calendar" },
|
|
"imported": { "type": "object", "properties": { "events": { "type": "integer", "example": 12 } } },
|
|
"source": { "type": "string", "format": "uri", "description": "The URL that was imported" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Validation error, unreachable URL, 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" } } } }
|
|
}
|
|
}
|
|
},
|
|
"/calendars/{id}/export.ics": {
|
|
"get": {
|
|
"tags": ["ICS"],
|
|
"summary": "Export calendar as ICS",
|
|
"description": "Exports all events from a calendar in ICS (iCalendar) format with full RFC 5545 support including reminders (VALARM), attendees, all-day events, and recurrence rules. 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. Supports VALARM (reminders), ATTENDEE, TZID, VALUE=DATE (all-day events), and RRULE. 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" } } } }
|
|
}
|
|
}
|
|
},
|
|
"/calendars/import-url": {
|
|
"post": {
|
|
"tags": ["ICS"],
|
|
"summary": "Import from iCal URL",
|
|
"description": "Fetches an iCal feed from the given URL and imports all events into the specified calendar. Supports http, https, and webcal protocols. Requires `calendars:write` scope.",
|
|
"operationId": "importCalendarFromURL",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["calendar_id", "url"],
|
|
"properties": {
|
|
"calendar_id": { "type": "string", "format": "uuid", "description": "Target calendar ID" },
|
|
"url": { "type": "string", "format": "uri", "description": "iCal feed URL (http, https, or webcal)", "example": "https://example.com/calendar.ics" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Import successful",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": ["ok", "imported", "source"],
|
|
"properties": {
|
|
"ok": { "type": "boolean", "example": true },
|
|
"imported": {
|
|
"type": "object",
|
|
"properties": {
|
|
"events": { "type": "integer", "example": 12 }
|
|
}
|
|
},
|
|
"source": { "type": "string", "format": "uri", "description": "The URL that was imported" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Validation error, unreachable URL, 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" } } } }
|
|
}
|
|
}
|
|
},
|
|
"/cal/{token}/feed.ics": {
|
|
"get": {
|
|
"tags": ["ICS"],
|
|
"summary": "iCal feed",
|
|
"description": "Returns an iCal feed for a calendar. Works for both public and private calendars. No authentication required. Public calendars use a shorter base64url token; private calendars use a 64-character SHA256 hex token. The `ical_url` is returned in the Calendar object. Subscribe in Google Calendar, Apple Calendar, Outlook, etc.",
|
|
"operationId": "calendarFeed",
|
|
"parameters": [
|
|
{
|
|
"name": "token",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": { "type": "string" },
|
|
"description": "Calendar token from ical_url (public or private)"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "ICS calendar feed",
|
|
"content": {
|
|
"text/calendar": {
|
|
"schema": { "type": "string" }
|
|
}
|
|
}
|
|
},
|
|
"404": { "description": "Calendar not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
|
|
},
|
|
"security": []
|
|
}
|
|
}
|
|
}
|
|
}
|