@abgov/adsp-sdk-mcp-server 1.31.0 → 1.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,8 +5,10 @@ An MCP (Model Context Protocol) server that gives an AI coding assistant grounde
5
5
  (`@abgov/adsp-service-sdk`), instead of guessing.
6
6
 
7
7
  It bundles the ADSP documentation site content, the OpenAPI specs of ADSP services, and a curated reference of every
8
- `@abgov/adsp-service-sdk` export, and exposes them over stdio via eleven tools:
8
+ `@abgov/adsp-service-sdk` export, and exposes them over stdio via twelve tools:
9
9
 
10
+ - `find_adsp_services` — match a product need, in the user's own words, to the ADSP services that provide it, so an
11
+ agent reuses a platform service instead of building one. See [Matching needs to services](#matching-needs-to-services).
10
12
  - `search_adsp_docs` — keyword search across ADSP platform docs (getting started, architecture, service concepts,
11
13
  tutorials). Common words people use that the docs don't, such as `websocket` or `auth`, also search for the
12
14
  docs' own terms (`src/search/aliases.ts`).
@@ -33,6 +35,39 @@ It bundles the ADSP documentation site content, the OpenAPI specs of ADSP servic
33
35
  body and responses with schema references inlined. `access` quotes the description's sentences about roles,
34
36
  tenancy and anonymous access; structured role metadata is planned (CS-5731).
35
37
 
38
+ ### Matching needs to services
39
+
40
+ `find_adsp_services` takes one `need`, or several requirement lines as `needs`, and returns `structuredContent` that
41
+ matches the tool's `outputSchema`, with the same JSON as text. For each need:
42
+
43
+ | Field | Meaning |
44
+ |---|---|
45
+ | `matches` | Up to five services, best first. Each has `service`, `fit` (`strong`, `partial` or `weak`) and `reason`, the catalog sentence that best explains the match. With `response_format: "detailed"`, each also has `name`, `dependsOn`, `registration`, `doc`, `fitQuestions`, `risks` and `specialist`. |
46
+ | `ask` | `true` when no match is strong, or more than one is. The agent should ask the user instead of choosing. |
47
+ | `fitQuestions` | What to ask when `ask` is `true`: each candidate's fit questions, or what the service is for. |
48
+ | `noMatch` | Present when no service fits the need, or when the need hits a gap a planner pattern records, such as fee payment. A known gap carries the pattern's `reason` and `suggestedApproach`. |
49
+
50
+ `registration` says how a service built with `@abgov/adsp-service-sdk` sets the service up: `fields` lists the
51
+ `ServiceRegistration` fields the SDK writes to it (`fileTypes` for file-service), and `serviceConfigurations` is the
52
+ `serviceId` for a `serviceConfigurations` entry, when the service takes configuration from yours (check with
53
+ `get_service_configuration_schema`).
54
+
55
+ Ranking is deterministic and offline. Each query term found in a service's entry counts, weighted by how rare the term
56
+ is across services and by where it is found: the service index line and the planner specialist's purpose count most,
57
+ then the patterns' reasons for the service, then fit questions and risks. A pattern whose domain language matches the
58
+ need also lifts the services it maps. A match is `strong` when it scores at least 0.75 of the best match and the
59
+ service's entry contains at least 30% of the need's terms; matching on a single shared word is not enough to choose
60
+ without asking.
61
+
62
+ The catalog, `assets/capabilities.json`, is generated by `scripts/capabilities.mjs` from:
63
+
64
+ - `docs/services/services.md`: every service, its guide and its "Use it to" line;
65
+ - `apps/project-planner-service/src/planner/specialists.ts`: purpose, fit questions, dependencies and risks. Services
66
+ with no specialist are in the catalog with `specialist: false`;
67
+ - `apps/project-planner-service/src/planner/patterns.ts`: the business patterns, their service mappings and the gaps
68
+ they record;
69
+ - `libs/adsp-service-sdk/src/registration/registration.ts`: which `ServiceRegistration` field configures which service.
70
+
36
71
  The three API tools read the bundled OpenAPI specs (see [Bundled OpenAPI specs](#bundled-openapi-specs)), the same
37
72
  content each service serves at `/swagger/docs/v1`, so they work offline.
38
73
 
@@ -42,7 +77,8 @@ setup.
42
77
  ### Server instructions and tool annotations
43
78
 
44
79
  The `initialize` result carries an `instructions` string (`src/instructions.ts`, about 10 lines). It covers only what
45
- no single tool description says: which tool answers which kind of question, that only the two live tools need
80
+ no single tool description says: call `find_adsp_services` before designing a capability, and ask the user when a
81
+ result has `ask` set; which tool answers which kind of question; that only the two live tools need
46
82
  `npx @abgov/adsp-cli login`, and that `get_adsp_mcp_server_info` tells how fresh the bundled content is. Clients such
47
83
  as Claude Code use it to decide when to search this server's deferred tools. It must not restate a tool description;
48
84
  `server.spec.ts` fails if it shares six or more consecutive words with one.
@@ -228,20 +264,23 @@ nx lint adsp-sdk-mcp-server
228
264
  `src/eval/service-matching.json` holds needs described in product terms, such as "applicants attach supporting
229
265
  documents to an application", each with the ADSP services that should answer it. The queries come from probes of the
230
266
  hosted server and from the project-planner-service business patterns' `serviceMappings`. To see where
231
- `search_adsp_docs` ranks the expected services over the repo's `docs/`, run:
267
+ `search_adsp_docs` (over the repo's `docs/`) and `find_adsp_services` (over the bundled catalog) rank the expected
268
+ services, run:
232
269
 
233
270
  ```bash
234
271
  npx nx run adsp-sdk-mcp-server:eval-service-matching
235
272
  ```
236
273
 
237
- It prints a table and the number of queries with every expected service in the top 1, 3 and 5. It reports and does
238
- not fail. Use it to compare a ranking change, or a new matching tool, against the baseline. `src/eval/` is not part
274
+ It prints a table per tool and the number of queries with every expected service in the top 1, 3 and 5. It reports and
275
+ does not fail. `src/eval/serviceMatching.spec.ts` does fail when `find_adsp_services` ranks every expected service in
276
+ the top 2 for fewer than 90% of the queries. Use it to compare a ranking change, or a new matching tool, against the baseline. `src/eval/` is not part
239
277
  of the published package.
240
278
 
241
279
  ### Refresh workflow
242
280
 
243
281
  The bundled content is refreshed from source on every release, not fetched live. After changing `docs/`, a service's
244
- OpenAPI fragments or `swagger.config.js`, or `scripts/api-services.json`, run:
282
+ OpenAPI fragments or `swagger.config.js`, `scripts/api-services.json`, project-planner-service's specialists or patterns,
283
+ or the SDK's `registration.ts`, run:
245
284
 
246
285
  ```bash
247
286
  npx nx run adsp-sdk-mcp-server:sync-content
@@ -252,6 +291,9 @@ and commit what it changes in the same PR. In Claude Code, `/adsp-mcp-sync` does
252
291
  - **Docs.** The build copies `docs/**/*.md` into the package. `src/docs/docs-lock.json` fingerprints those pages, and
253
292
  `src/docs/docsLock.spec.ts` fails CI when `docs/` changes without it. `sync-content` updates it. The lock is inside this package, so the
254
293
  change releases it: `.releaserc.json` releases a patch for `docs` commits as well as `feat` and `fix`.
294
+ - **Capability catalog.** `src/capabilities/capabilities.spec.ts` fails CI when the planner's specialists or patterns,
295
+ `docs/services/services.md` or the SDK's registration change without regenerating `assets/capabilities.json`.
296
+ `sync-content` regenerates it. The generator also fails when the planner names a service the index doesn't list.
255
297
  - **SDK reference.** Maintained by hand, and checked against the SDK source (below).
256
298
  - **Provenance.** The `release` target runs `scripts/provenance.mjs` before publishing. It writes
257
299
  `provenance.json` into the package with the source commit, the last commit to `docs/`, the latest
@@ -1 +1 @@
1
- {"openapi":"3.0.0","info":{"title":"Calendar service","version":"0.0.0","description":"\n\nThe _Calendar Service_ is a set of API's that gives developers a means to create and manage\ntime based events for general use in calendars.\n\n### Calendar Events\nA _calendar event_ is defined by:\n- a name,\n- a description,\n- a start time,\n- an end time,\n- an indication of whether or not it's a public event.\n- an indication of whether or not it's an all day event.\n\nEvents can also be associated with a list of attendees, with each attendee defined by\n- a name,\n- an email address\n\n### Special Dates\n\nThe service also includes an API you can use to populate a calendar with special dates, so that you can display them on your calendars.\nAny date returned by the API will indicate whether or not;\n- it's a weekend,\n- it's a holiday,\n- it's a business day,\n- it's an in-lieu day\n\nYou can retrieve the information for a specific date, or all dates between a min and a max.\n"},"paths":{"/calendar/v1/calendars":{"get":{"tags":["Calendar"],"description":"Retrieves the calendar definitions, with tenant and core definitions listed separately (including definitions with the same name). Public: no roles are required and anonymous requests are allowed. Anonymous requests, and core users without tenantId, receive only core definitions; tenant users receive their tenant's definitions and the core definitions.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarTenantId"}],"responses":{"200":{"description":"Calendar definitions successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CalendarDefinition"}}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}},"post":{"tags":["Calendar"],"description":"Creates a tenant calendar definition. Requires the calendar-admin role in the tenant, or as a core user; core users must set tenantId, or the request responds 400. The name must not be used by a tenant or core calendar. Signals calendar-definition-created.\n","parameters":[{"$ref":"#/components/parameters/CalendarTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinitionInput"}}}},"responses":{"201":{"description":"Tenant calendar definition created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinition"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"401":{"$ref":"#/components/responses/CalendarUnauthorized"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"409":{"$ref":"#/components/responses/CalendarConflict"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}}},"/calendar/v1/calendars/{name}":{"get":{"tags":["Calendar"],"description":"Retrieves a calendar of the tenant, including core calendars. Public: no roles are required and anonymous requests are allowed. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. When a tenant and a core calendar have the same name, the core calendar is returned.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"responses":{"200":{"description":"Calendar successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"put":{"tags":["Calendar"],"description":"Replaces an existing tenant calendar definition. Core definitions are read-only and respond 404. Requires the calendar-admin role in the tenant, or as a core user; core users must set tenantId, or the request responds 400. The name in the body must match the path. Signals calendar-definition-updated.\n","parameters":[{"$ref":"#/components/parameters/CalendarDefinitionName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinitionInput"}}}},"responses":{"200":{"description":"Tenant calendar definition updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinition"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"401":{"$ref":"#/components/responses/CalendarUnauthorized"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}},"delete":{"tags":["Calendar"],"description":"Deletes an existing tenant calendar definition, only if the calendar has no events (409 otherwise). Core definitions are read-only and respond 404. Requires the calendar-admin role in the tenant, or as a core user; core users must set tenantId, or the request responds 400. Signals calendar-definition-deleted.\n","parameters":[{"$ref":"#/components/parameters/CalendarDefinitionName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"responses":{"204":{"description":"Tenant calendar definition deleted."},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"401":{"$ref":"#/components/responses/CalendarUnauthorized"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"},"409":{"$ref":"#/components/responses/CalendarConflict"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}}},"/calendar/v1/calendars/{name}/events":{"get":{"tags":["Calendar"],"description":"Retrieves calendar events. Public: anonymous requests are allowed. Callers with private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user) receive private and public events; all other callers, including anonymous users and users of another tenant, receive only public events. Attendees are included only with includeAttendees, which requires private access. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n\nCalendar date/time values use the service timezone, America/Edmonton (Mountain time; MST or MDT depending on the date). When both from and to are specified, returns the complete set of events that overlap the requested range in a single response; top and after are ignored for range retrieval, but criteria can still be used to filter the results. An event overlaps the range when it occurs at least partially within it, including events that start before from or end after to. Range retrieval supports a maximum range of 366 days. Range retrieval returns each occurrence of a recurring event that overlaps the range, excluding cancelled occurrences; without from and to, recurring events are returned once and time criteria apply to their first occurrence.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"},{"$ref":"#/components/parameters/CalendarEventsTop"},{"$ref":"#/components/parameters/CalendarEventsAfter"},{"$ref":"#/components/parameters/CalendarIncludeAttendees"},{"name":"from","description":"ISO 8601 date/time for the start of a calendar display range. Must be specified with to. Events overlapping this range are returned without pagination.","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00-06:00"},{"name":"to","description":"ISO 8601 date/time for the end of a calendar display range. Must be specified with from, must not be before from, and must be within 366 days of from.","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-31T23:59:59-06:00"},{"name":"criteria","description":"JSON criteria for the events to retrieve.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventCriteria"}}}}],"responses":{"200":{"description":"Calendar events successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventsPage"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"post":{"tags":["Calendar"],"description":"Creates a calendar event. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Invalid recurrence rules respond 400. Signals calendar-event-created.\n","parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventInput"},"examples":{"single":{"summary":"Create a single event","value":{"recordId":"inspection-1024","context":{"region":"north"},"name":"Site inspection","description":"Inspection of the Edmonton north facility.","start":"2026-11-17T09:00:00-07:00","end":"2026-11-17T10:30:00-07:00","isPublic":false}},"recurring":{"summary":"Create a weekly recurring event","value":{"name":"Team meeting","description":"Weekly inspection planning meeting.","start":"2026-09-29T10:00:00-06:00","end":"2026-09-29T11:00:00-06:00","isPublic":true,"recurrence":{"frequency":"weekly","daysOfWeek":["TU"],"end":{"until":"2026-12-15"}}}}}}}},"responses":{"200":{"description":"Calendar event successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"get":{"tags":["Calendar"],"description":"Retrieves a calendar event. Public events are public: anonymous requests are allowed. Private events require private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user); other callers receive 403. Attendees are included only with includeAttendees, which also requires private access. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Events of other tenants or calendars respond 404.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarIncludeAttendees"}],"responses":{"200":{"description":"Calendar event successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"patch":{"tags":["Calendar"],"description":"Updates a calendar event with the properties in the request. For a recurring event, the update applies to all occurrences. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Events of other tenants or calendars respond 404. Signals calendar-event-updated.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventUpdate"},"examples":{"reschedule":{"summary":"Reschedule an event","value":{"start":"2026-11-18T09:00:00-07:00","end":"2026-11-18T10:30:00-07:00"}},"make-single":{"summary":"Stop a recurring event from repeating","value":{"recurrence":null}}}}}},"responses":{"200":{"description":"Calendar event successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"delete":{"tags":["Calendar"],"description":"Deletes a calendar event and its attendees. For a recurring event, deletes all occurrences. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Events of other tenants or calendars respond 404. Signals calendar-event-deleted.\n","responses":{"200":{"description":"Calendar event successfully deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDeleteResult"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}/attendees":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"get":{"tags":["Calendar"],"description":"Retrieves the attendees of a calendar event. Attendees are never public, even for public events: requires private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user); other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n","responses":{"200":{"description":"Attendees successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Attendee"}}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"post":{"tags":["Calendar"],"description":"Adds an attendee to a calendar event. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. Adding an attendee to a private event also requires read access, which updateRoles include. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttendeeInput"}}}},"responses":{"200":{"description":"Attendee successfully added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attendee"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}/attendees/{attendeeId}":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"$ref":"#/components/parameters/CalendarAttendeeId"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"get":{"tags":["Calendar"],"description":"Retrieves an attendee of a calendar event. Attendees are never public, even for public events: requires private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user); other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n","responses":{"200":{"description":"Attendee successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attendee"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"put":{"tags":["Calendar"],"description":"Replaces the name and email of an attendee of a calendar event. Use the ID of an existing attendee of the event. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttendeeInput"}}}},"responses":{"200":{"description":"Attendee successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attendee"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"delete":{"tags":["Calendar"],"description":"Removes an attendee from a calendar event. deleted is false if the event has no attendee with the ID. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated.\n","responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDeleteResult"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}/occurrences/{occurrence}":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"name":"occurrence","description":"Mountain time date of the occurrence (e.g. 2026-10-13), or its URL-encoded recurrenceId. Must be an ISO 8601 date or date/time.","in":"path","required":true,"schema":{"type":"string"},"example":"2026-10-13"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"delete":{"tags":["Calendar"],"description":"Cancels one occurrence of a recurring event. The rest of the recurring event is unchanged. Cancelled occurrences cannot be restored. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated when an occurrence is cancelled.\n","responses":{"200":{"description":"Request completed successfully. deleted is false if the occurrence was already cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDeleteResult"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/export":{"get":{"tags":["Calendar"],"description":"Exports a page of the calendar's events as an iCalendar (.ics) file. Public: anonymous requests are allowed. Callers with private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user) export private and public events; all other callers, including anonymous users and users of another tenant, export only public events. Attendees are included only with includeAttendees, which requires private access. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"},{"$ref":"#/components/parameters/CalendarEventsTop"},{"$ref":"#/components/parameters/CalendarEventsAfter"},{"$ref":"#/components/parameters/CalendarIncludeAttendees"},{"name":"filename","description":"Name of the file to download. Defaults to the calendar name with the .ics extension.","in":"query","required":false,"schema":{"type":"string"},"example":"site-inspections.ics"},{"name":"criteria","description":"JSON criteria for the events to export. Must be valid JSON. activeOn is not supported for export.\n","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventCriteria"}}}}],"responses":{"200":{"description":"Calendar successfully exported.","content":{"text/calendar":{"schema":{"type":"string"},"example":"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Government of Alberta//urn:ads:platform:calendar-service//EN\nNAME:Site inspections\nX-WR-CALNAME:Site inspections\nBEGIN:VEVENT\nUID:42\nDTSTART;TZID=America/Edmonton:20261117T090000\nDTEND;TZID=America/Edmonton:20261117T103000\nSUMMARY:Site inspection\nEND:VEVENT\nEND:VCALENDAR\n"}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/dates":{"get":{"tags":["Dates"],"description":"Retrieves calendar dates in ascending order, with information about weekends, holidays, and business days in Alberta. Public: no roles are required and anonymous requests are allowed. Dates are platform data and the same for every tenant, so no tenant context is used.\n","security":[{},{"accessToken":[]}],"parameters":[{"name":"top","description":"Number of dates to return in a page. Must be a positive integer.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":10},"example":50},{"name":"after","description":"Cursor for the page of results to retrieve, from page.next of the previous page.","in":"query","required":false,"schema":{"type":"string"},"example":"Mg=="},{"name":"criteria","description":"JSON criteria for the dates to retrieve. Must be valid JSON. min and max are inclusive date IDs in the format yyyyMMdd.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"max":{"type":"integer","example":20261231},"min":{"type":"integer","example":20260101},"isWeekend":{"type":"boolean"},"isHoliday":{"type":"boolean"},"isBusinessDay":{"type":"boolean"},"isInLieuOfDay":{"type":"boolean"}}},"example":{"min":20260101,"max":20261231,"isHoliday":true}}}}],"responses":{"200":{"description":"Dates successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDatesPage"}}}}}}},"/calendar/v1/dates/{id}":{"parameters":[{"name":"id","description":"ID of the date to retrieve, in the format yyyyMMdd.","in":"path","required":true,"schema":{"type":"integer","minimum":20200000,"maximum":20600000},"example":20261111}],"get":{"tags":["Dates"],"description":"Retrieves information about a calendar date. Public: no roles are required and anonymous requests are allowed. Dates are platform data and the same for every tenant, so no tenant context is used.\n","security":[{},{"accessToken":[]}],"responses":{"200":{"description":"Date successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDate"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"CalendarAttendeeId":{"name":"attendeeId","description":"ID of the attendee.","in":"path","required":true,"schema":{"type":"integer"},"example":7},"CalendarDefinitionName":{"name":"name","description":"Name of the tenant calendar.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"site-inspections"},"CalendarEventId":{"name":"id","description":"ID of the calendar event.","in":"path","required":true,"schema":{"type":"integer"},"example":42},"CalendarEventsAfter":{"name":"after","description":"Cursor for the page of results to retrieve, from page.next of the previous page.","in":"query","required":false,"schema":{"type":"string"},"example":"MjU="},"CalendarEventsTop":{"name":"top","description":"Number of events to return in a page. Must be a positive integer.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":10},"example":25},"CalendarIncludeAttendees":{"name":"includeAttendees","description":"Set to true to include attendees in the events. Requires private access to the calendar (see the operation description), even for public events; other callers receive 403.\n","in":"query","required":false,"schema":{"type":"boolean","default":false}},"CalendarName":{"name":"name","description":"Name of the calendar.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"site-inspections"},"CalendarTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users; tenant users always act on the tenant of their token and this parameter is ignored. Must be a valid tenant URN.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"CalendarTenantName":{"name":"tenant","description":"Name of the tenant whose calendar to use. Any caller can set it, including anonymous users and users of another tenant, and it replaces the tenant of the token or tenantId parameter. Anonymous callers must set it, since they have no tenant context. An unknown tenant name responds 400.\n","in":"query","required":false,"schema":{"type":"string"},"example":"service-delivery"}},"responses":{"CalendarBadGateway":{"description":"Configuration service is unavailable, rejected the service's credentials, or returned invalid calendar definitions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Configuration service is unavailable."}}}},"CalendarBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Validation failed with error(s): id (params) - Invalid value"}}}},"CalendarConflict":{"description":"Request conflicts with the current state of the calendar.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Calendar 'site-inspections' already exists."}}}},"CalendarForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"User Test User (ID: 9f1c2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b) not permitted to create calendar event."}}}},"CalendarNotFound":{"description":"Calendar, event, occurrence, attendee, or date not found in the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Calendar with ID 'site-inspections' could not be found."}}}},"CalendarUnauthorized":{"description":"Request does not include a valid bearer token.","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}}},"schemas":{"Attendee":{"type":"object","properties":{"id":{"type":"integer","readOnly":true},"name":{"type":"string"},"email":{"type":"string","format":"email"}},"example":{"id":7,"name":"Test User","email":"test.user@gov.ab.ca"}},"AttendeeInput":{"type":"object","properties":{"name":{"type":"string","description":"Name of the attendee. Can be an empty string."},"email":{"type":"string","format":"email","description":"Email of the attendee. An event can't have two attendees with the same email."}},"required":["name","email"],"example":{"name":"Test User","email":"test.user@gov.ab.ca"}},"Calendar":{"type":"object","properties":{"urn":{"type":"string","readOnly":true},"name":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string"},"readRoles":{"type":"array","description":"Roles that can read private events and the attendees of events.","items":{"type":"string"}},"updateRoles":{"type":"array","description":"Roles that can read private events, and create, update, and delete events and attendees.","items":{"type":"string"}}},"example":{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections","name":"site-inspections","displayName":"Site inspections","description":"Calendar of scheduled site inspections.","readRoles":["inspection-viewer"],"updateRoles":["inspection-scheduler"]}},"CalendarDate":{"type":"object","properties":{"id":{"type":"integer","description":"ID of the date in the format yyyyMMdd."},"date":{"type":"string","format":"date-time"},"dayOfWeek":{"type":"integer","minimum":1,"maximum":7,"description":"ISO day of the week, from 1 (Monday) to 7 (Sunday)."},"isWeekend":{"type":"boolean"},"isHoliday":{"type":"boolean"},"isBusinessDay":{"type":"boolean"},"holiday":{"type":"string","nullable":true,"description":"Name of the holiday, if the date is a holiday."},"isInLieuOfDay":{"type":"boolean","description":"Indicates the date is a day off in lieu of a holiday that falls on a weekend."}},"example":{"id":20261111,"date":"2026-11-11T00:00:00.000Z","dayOfWeek":3,"isWeekend":false,"isHoliday":true,"isBusinessDay":false,"holiday":"Remembrance Day","isInLieuOfDay":false}},"CalendarDatesPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CalendarDate"}},"page":{"$ref":"#/components/schemas/CalendarPage"}},"example":{"results":[{"id":20261111,"date":"2026-11-11T00:00:00.000Z","dayOfWeek":3,"isWeekend":false,"isHoliday":true,"isBusinessDay":false,"holiday":"Remembrance Day","isInLieuOfDay":false},{"id":20261225,"date":"2026-12-25T00:00:00.000Z","dayOfWeek":5,"isWeekend":false,"isHoliday":true,"isBusinessDay":false,"holiday":"Christmas Day","isInLieuOfDay":false}],"page":{"next":"Mg==","size":2}}},"CalendarDefinition":{"allOf":[{"$ref":"#/components/schemas/Calendar"},{"type":"object","required":["source"],"properties":{"source":{"type":"string","enum":["tenant","core"],"readOnly":true,"description":"tenant for calendars managed by the tenant; core for read-only calendars registered by platform services."}}}],"example":{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections","name":"site-inspections","displayName":"Site inspections","description":"Calendar of scheduled site inspections.","readRoles":["inspection-viewer"],"updateRoles":["inspection-scheduler"],"source":"tenant"}},"CalendarDefinitionInput":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$","description":"Must not be the reserved __proto__ property. On update, must match the name in the path."},"displayName":{"type":"string","minLength":1,"maxLength":32,"pattern":"\\S"},"description":{"type":"string","maxLength":250},"readRoles":{"type":"array","items":{"type":"string"}},"updateRoles":{"type":"array","items":{"type":"string"}}},"required":["name","displayName","readRoles","updateRoles"],"example":{"name":"site-inspections","displayName":"Site inspections","description":"Calendar of scheduled site inspections.","readRoles":["inspection-viewer"],"updateRoles":["inspection-scheduler"]}},"CalendarDeleteResult":{"type":"object","properties":{"deleted":{"type":"boolean"}},"example":{"deleted":true}},"CalendarError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"CalendarEvent":{"type":"object","properties":{"urn":{"type":"string","readOnly":true},"id":{"type":"integer","readOnly":true},"recordId":{"type":"string","nullable":true,"description":"ID of a record in another system that the event relates to."},"context":{"type":"object","nullable":true,"description":"Properties of the event that can be used as criteria to find it."},"name":{"type":"string"},"description":{"type":"string"},"isPublic":{"type":"boolean","description":"Public events can be read by anyone, including anonymous users. Their attendees are not public."},"isAllDay":{"type":"boolean"},"start":{"type":"string","format":"date-time","description":"Start in the service timezone (America/Edmonton)."},"end":{"type":"string","format":"date-time","nullable":true,"description":"End in the service timezone (America/Edmonton)."},"recurrenceId":{"type":"string","format":"date-time","readOnly":true,"description":"Original start of the occurrence (RFC 5545 RECURRENCE-ID). Only included on occurrences of recurring events returned by range retrieval; id is the recurring event."},"recurrence":{"allOf":[{"$ref":"#/components/schemas/EventRecurrence"}],"description":"Only included for recurring events. exclusions is only included when retrieving the recurring event itself."},"attendees":{"type":"array","description":"Only included when includeAttendees is true.","items":{"$ref":"#/components/schemas/Attendee"}}},"example":{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections/events/42","id":42,"recordId":"inspection-1024","context":{"region":"north"},"name":"Site inspection","description":"Inspection of the Edmonton north facility.","isPublic":false,"isAllDay":false,"start":"2026-11-17T09:00:00.000-07:00","end":"2026-11-17T10:30:00.000-07:00"}},"CalendarEventCriteria":{"type":"object","properties":{"recordId":{"type":"string"},"context":{"type":"object","description":"Matches events whose context contains these properties and values."},"isPublic":{"type":"boolean","description":"Only applies to callers with private access; other callers always receive only public events."},"startsAfter":{"type":"string","format":"date-time"},"endsBefore":{"type":"string","format":"date-time"},"activeOn":{"type":"string","format":"date-time"},"attendeeCriteria":{"type":"object","properties":{"nameEquals":{"type":"string","nullable":true},"emailEquals":{"type":"string","nullable":true}}},"orderBy":{"type":"string","enum":["id","start"]}},"example":{"recordId":"inspection-1024","startsAfter":"2026-11-01T00:00:00-06:00"}},"CalendarEventInput":{"type":"object","properties":{"recordId":{"type":"string","nullable":true},"context":{"type":"object","nullable":true},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string"},"start":{"type":"string","format":"date-time","description":"ISO 8601 date/time. Values without an offset are read in the service timezone (America/Edmonton)."},"end":{"type":"string","format":"date-time","description":"ISO 8601 date/time. Must not be before start."},"isPublic":{"type":"boolean","default":false},"isAllDay":{"type":"boolean","default":false},"recurrence":{"allOf":[{"$ref":"#/components/schemas/EventRecurrence"}],"nullable":true}},"required":["name","start","end"]},"CalendarEventUpdate":{"type":"object","description":"Properties to change. Omitted properties are unchanged. end, name, description, and context can't be cleared, and recordId can't be changed.\n","properties":{"context":{"type":"object"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string"},"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time","description":"Must not be before start."},"isPublic":{"type":"boolean"},"isAllDay":{"type":"boolean"},"recurrence":{"allOf":[{"$ref":"#/components/schemas/EventRecurrence"}],"nullable":true,"description":"Replaces the whole recurrence. Set to null to make the event a single event."}}},"CalendarEventsPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CalendarEvent"}},"page":{"allOf":[{"$ref":"#/components/schemas/CalendarPage"}],"description":"Not included for range retrieval with from and to."}},"example":{"results":[{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections/events/42","id":42,"recordId":"inspection-1024","context":{"region":"north"},"name":"Site inspection","description":"Inspection of the Edmonton north facility.","isPublic":false,"isAllDay":false,"start":"2026-11-17T09:00:00.000-07:00","end":"2026-11-17T10:30:00.000-07:00"},{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections/events/43/occurrences/2026-11-17","id":43,"name":"Team meeting","description":"Weekly inspection planning meeting.","isPublic":true,"isAllDay":false,"start":"2026-11-17T13:00:00.000-07:00","end":"2026-11-17T14:00:00.000-07:00","recurrenceId":"2026-11-17T13:00:00.000-07:00","recurrence":{"frequency":"weekly","interval":1,"daysOfWeek":["TU"],"end":{"until":"2026-12-15"}}}],"page":{"next":"Mg==","size":2}}},"CalendarPage":{"type":"object","properties":{"after":{"type":"string","description":"Cursor of the current page, if one was requested."},"next":{"type":"string","nullable":true,"description":"Cursor of the next page; not set when there are no more results."},"size":{"type":"integer"}}},"EventRecurrence":{"type":"object","description":"Recurrence of an event based on a subset of the RFC 5545 RRULE. Occurrences are generated in Mountain time (America/Edmonton) and keep the local start time across daylight saving changes.","properties":{"frequency":{"type":"string","enum":["daily","weekly","monthly","yearly"],"description":"Monthly and yearly recurrence use the day of the event start; months or years without that day are skipped."},"interval":{"type":"integer","minimum":1,"maximum":99,"default":1,"description":"Interval of the frequency; e.g. 2 with weekly is every two weeks."},"daysOfWeek":{"type":"array","description":"Weekly recurrence only. Must include the day of the event start. Defaults to the day of the event start.","items":{"type":"string","enum":["MO","TU","WE","TH","FR","SA","SU"]}},"end":{"type":"object","description":"Optional end of the recurrence. Specify until or count, not both.","properties":{"until":{"type":"string","format":"date","description":"Last date (inclusive) on which an occurrence can start."},"count":{"type":"integer","minimum":1,"maximum":1000,"description":"Number of occurrences, including the first and any cancelled occurrences."}}},"exclusions":{"type":"array","readOnly":true,"description":"Recurrence IDs of cancelled occurrences.","items":{"type":"string","format":"date-time"}}},"required":["frequency"],"example":{"frequency":"weekly","interval":1,"daysOfWeek":["TU"],"end":{"until":"2026-12-15"}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Calendar","description":"API to manage calendars, calendar events, and event attendees."},{"name":"Dates","description":"API to retrieve information about dates, such as holidays and business days."}]}
1
+ {"openapi":"3.0.0","info":{"title":"Calendar service","version":"0.0.0","description":"\n\nThe _Calendar Service_ is a set of API's that gives developers a means to create and manage\ntime based events for general use in calendars.\n\n### Calendar Events\nA _calendar event_ is defined by:\n- a name,\n- a description,\n- a start time,\n- an end time,\n- an indication of whether or not it's a public event.\n- an indication of whether or not it's an all day event.\n\nEvents can also be associated with a list of attendees, with each attendee defined by\n- a name,\n- an email address\n\n### Special Dates\n\nThe service also includes an API you can use to populate a calendar with special dates, so that you can display them on your calendars.\nAny date returned by the API will indicate whether or not;\n- it's a weekend,\n- it's a holiday,\n- it's a business day,\n- it's an in-lieu day\n\nYou can retrieve the information for a specific date, or all dates between a min and a max.\n"},"paths":{"/calendar/v1/calendars":{"get":{"tags":["Calendar"],"description":"Retrieves the calendar definitions, with tenant and core definitions listed separately (including definitions with the same name). Public: no roles are required and anonymous requests are allowed. Anonymous requests, and core users without tenantId, receive only core definitions; tenant users receive their tenant's definitions and the core definitions.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarTenantId"}],"responses":{"200":{"description":"Calendar definitions successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CalendarDefinition"}}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}},"post":{"tags":["Calendar"],"description":"Creates a tenant calendar definition. Requires the calendar-admin role in the tenant, or as a core user; core users must set tenantId, or the request responds 400. The name must not be used by a tenant or core calendar. Signals calendar-definition-created.\n","parameters":[{"$ref":"#/components/parameters/CalendarTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinitionInput"}}}},"responses":{"201":{"description":"Tenant calendar definition created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinition"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"401":{"$ref":"#/components/responses/CalendarUnauthorized"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"409":{"$ref":"#/components/responses/CalendarConflict"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}}},"/calendar/v1/calendars/{name}":{"get":{"tags":["Calendar"],"description":"Retrieves a calendar of the tenant, including core calendars. Public: no roles are required and anonymous requests are allowed. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. When a tenant and a core calendar have the same name, the core calendar is returned.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"responses":{"200":{"description":"Calendar successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"put":{"tags":["Calendar"],"description":"Replaces an existing tenant calendar definition. Core definitions are read-only and respond 404. Requires the calendar-admin role in the tenant, or as a core user; core users must set tenantId, or the request responds 400. The name in the body must match the path. Signals calendar-definition-updated.\n","parameters":[{"$ref":"#/components/parameters/CalendarDefinitionName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinitionInput"}}}},"responses":{"200":{"description":"Tenant calendar definition updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDefinition"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"401":{"$ref":"#/components/responses/CalendarUnauthorized"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}},"delete":{"tags":["Calendar"],"description":"Deletes an existing tenant calendar definition, only if the calendar has no events (409 otherwise). Core definitions are read-only and respond 404. Requires the calendar-admin role in the tenant, or as a core user; core users must set tenantId, or the request responds 400. Signals calendar-definition-deleted.\n","parameters":[{"$ref":"#/components/parameters/CalendarDefinitionName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"responses":{"204":{"description":"Tenant calendar definition deleted."},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"401":{"$ref":"#/components/responses/CalendarUnauthorized"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"},"409":{"$ref":"#/components/responses/CalendarConflict"},"502":{"$ref":"#/components/responses/CalendarBadGateway"}}}},"/calendar/v1/calendars/{name}/events":{"get":{"tags":["Calendar"],"description":"Retrieves calendar events. Public: anonymous requests are allowed. Callers with private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user) receive private and public events; all other callers, including anonymous users and users of another tenant, receive only public events. Attendees are included only with includeAttendees, which requires private access. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n\nCalendar date/time values use the service timezone, America/Edmonton (Mountain time; MST or MDT depending on the date). When both from and to are specified, returns the complete set of events that overlap the requested range in a single response; top and after are ignored for range retrieval, but criteria can still be used to filter the results. An event overlaps the range when it occurs at least partially within it, including events that start before from or end after to. Range retrieval supports a maximum range of 366 days. Range retrieval returns each occurrence of a recurring event that overlaps the range, excluding cancelled occurrences; without from and to, recurring events are returned once and time criteria apply to their first occurrence.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"},{"$ref":"#/components/parameters/CalendarEventsTop"},{"$ref":"#/components/parameters/CalendarEventsAfter"},{"$ref":"#/components/parameters/CalendarIncludeAttendees"},{"name":"from","description":"ISO 8601 date/time for the start of a calendar display range. Must be specified with to. Events overlapping this range are returned without pagination.","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00-06:00"},{"name":"to","description":"ISO 8601 date/time for the end of a calendar display range. Must be specified with from, must not be before from, and must be within 366 days of from.","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-31T23:59:59-06:00"},{"name":"criteria","description":"JSON criteria for the events to retrieve.","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventCriteria"}}}}],"responses":{"200":{"description":"Calendar events successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventsPage"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"post":{"tags":["Calendar"],"description":"Creates a calendar event. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Invalid recurrence rules respond 400. Signals calendar-event-created.\n","parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventInput"},"examples":{"single":{"summary":"Create a single event","value":{"recordId":"inspection-1024","context":{"region":"north"},"name":"Site inspection","description":"Inspection of the Edmonton north facility.","start":"2026-11-17T09:00:00-07:00","end":"2026-11-17T10:30:00-07:00","isPublic":false}},"recurring":{"summary":"Create a weekly recurring event","value":{"name":"Team meeting","description":"Weekly inspection planning meeting.","start":"2026-09-29T10:00:00-06:00","end":"2026-09-29T11:00:00-06:00","isPublic":true,"recurrence":{"frequency":"weekly","daysOfWeek":["TU"],"end":{"until":"2026-12-15"}}}}}}}},"responses":{"200":{"description":"Calendar event successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"get":{"tags":["Calendar"],"description":"Retrieves a calendar event. Public events are public: anonymous requests are allowed. Private events require private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user); other callers receive 403. Attendees are included only with includeAttendees, which also requires private access. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Events of other tenants or calendars respond 404.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarIncludeAttendees"}],"responses":{"200":{"description":"Calendar event successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"patch":{"tags":["Calendar"],"description":"Updates a calendar event with the properties in the request. For a recurring event, the update applies to all occurrences. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Events of other tenants or calendars respond 404. Signals calendar-event-updated.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventUpdate"},"examples":{"reschedule":{"summary":"Reschedule an event","value":{"start":"2026-11-18T09:00:00-07:00","end":"2026-11-18T10:30:00-07:00"}},"make-single":{"summary":"Stop a recurring event from repeating","value":{"recurrence":null}}}}}},"responses":{"200":{"description":"Calendar event successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"delete":{"tags":["Calendar"],"description":"Deletes a calendar event and its attendees. For a recurring event, deletes all occurrences. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Events of other tenants or calendars respond 404. Signals calendar-event-deleted.\n","responses":{"200":{"description":"Calendar event successfully deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDeleteResult"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}/attendees":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"get":{"tags":["Calendar"],"description":"Retrieves the attendees of a calendar event. Attendees are never public, even for public events: requires private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user); other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n","responses":{"200":{"description":"Attendees successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Attendee"}}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"post":{"tags":["Calendar"],"description":"Adds an attendee to a calendar event. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. Adding an attendee to a private event also requires read access, which updateRoles include. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttendeeInput"}}}},"responses":{"200":{"description":"Attendee successfully added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attendee"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}/attendees/{attendeeId}":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"$ref":"#/components/parameters/CalendarAttendeeId"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"get":{"tags":["Calendar"],"description":"Retrieves an attendee of a calendar event. Attendees are never public, even for public events: requires private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user); other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n","responses":{"200":{"description":"Attendee successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attendee"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"put":{"tags":["Calendar"],"description":"Replaces the name and email of an attendee of a calendar event. Use the ID of an existing attendee of the event. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttendeeInput"}}}},"responses":{"200":{"description":"Attendee successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attendee"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}},"delete":{"tags":["Calendar"],"description":"Removes an attendee from a calendar event. deleted is false if the event has no attendee with the ID. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated.\n","responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDeleteResult"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/events/{id}/occurrences/{occurrence}":{"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarEventId"},{"name":"occurrence","description":"Mountain time date of the occurrence (e.g. 2026-10-13), or its URL-encoded recurrenceId. Must be an ISO 8601 date or date/time.","in":"path","required":true,"schema":{"type":"string"},"example":"2026-10-13"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"}],"delete":{"tags":["Calendar"],"description":"Cancels one occurrence of a recurring event. The rest of the recurring event is unchanged. Cancelled occurrences cannot be restored. Requires the calendar-admin role, or one of the calendar's updateRoles, held in the calendar's tenant or by a core user; other callers, including anonymous users, receive 403. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400. Signals calendar-event-updated when an occurrence is cancelled.\n","responses":{"200":{"description":"Request completed successfully. deleted is false if the occurrence was already cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDeleteResult"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/calendars/{name}/export":{"get":{"tags":["Calendar"],"description":"Exports a page of the calendar's events as an iCalendar (.ics) file. Public: anonymous requests are allowed. Callers with private access (the calendar-admin role, or one of the calendar's readRoles or updateRoles, held in the calendar's tenant or by a core user) export private and public events; all other callers, including anonymous users and users of another tenant, export only public events. Attendees are included only with includeAttendees, which requires private access. The calendar is found in the tenant named by the tenant parameter; otherwise in the tenant of the token, or of tenantId for core users. Without a tenant context the request responds 400.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/CalendarName"},{"$ref":"#/components/parameters/CalendarTenantName"},{"$ref":"#/components/parameters/CalendarTenantId"},{"$ref":"#/components/parameters/CalendarEventsTop"},{"$ref":"#/components/parameters/CalendarEventsAfter"},{"$ref":"#/components/parameters/CalendarIncludeAttendees"},{"name":"filename","description":"Name of the file to download. Defaults to the calendar name with the .ics extension.","in":"query","required":false,"schema":{"type":"string"},"example":"site-inspections.ics"},{"name":"criteria","description":"JSON criteria for the events to export. Must be valid JSON. activeOn is not supported for export.\n","in":"query","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventCriteria"}}}}],"responses":{"200":{"description":"Calendar successfully exported.","content":{"text/calendar":{"schema":{"type":"string"},"example":"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Government of Alberta//urn:ads:platform:calendar-service//EN\nNAME:Site inspections\nX-WR-CALNAME:Site inspections\nBEGIN:VEVENT\nUID:42\nDTSTART;TZID=America/Edmonton:20261117T090000\nDTEND;TZID=America/Edmonton:20261117T103000\nSUMMARY:Site inspection\nEND:VEVENT\nEND:VCALENDAR\n"}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"403":{"$ref":"#/components/responses/CalendarForbidden"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}},"/calendar/v1/dates":{"get":{"tags":["Dates"],"description":"Retrieves calendar dates in ascending order, with information about weekends, holidays, and business days in Alberta. Public: no roles are required and anonymous requests are allowed. Dates are platform data and the same for every tenant, so no tenant context is used.\n","security":[{},{"accessToken":[]}],"parameters":[{"name":"top","description":"Number of dates to return in a page. Must be a positive integer.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":10},"example":50},{"name":"after","description":"Cursor for the page of results to retrieve, from page.next of the previous page.","in":"query","required":false,"schema":{"type":"string"},"example":"Mg=="},{"name":"criteria","description":"JSON criteria for the dates to retrieve. Must be valid JSON. min and max are inclusive date IDs in the format yyyyMMdd.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"max":{"type":"integer","example":20261231},"min":{"type":"integer","example":20260101},"isWeekend":{"type":"boolean"},"isHoliday":{"type":"boolean"},"isBusinessDay":{"type":"boolean"},"isInLieuOfDay":{"type":"boolean"}}},"example":{"min":20260101,"max":20261231,"isHoliday":true}}}}],"responses":{"200":{"description":"Dates successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDatesPage"}}}}}}},"/calendar/v1/dates/{id}":{"parameters":[{"name":"id","description":"ID of the date to retrieve, in the format yyyyMMdd.","in":"path","required":true,"schema":{"type":"integer","minimum":20200000,"maximum":20600000},"example":20261111}],"get":{"tags":["Dates"],"description":"Retrieves information about a calendar date. Public: no roles are required and anonymous requests are allowed. Dates are platform data and the same for every tenant, so no tenant context is used.\n","security":[{},{"accessToken":[]}],"responses":{"200":{"description":"Date successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarDate"}}}},"400":{"$ref":"#/components/responses/CalendarBadRequest"},"404":{"$ref":"#/components/responses/CalendarNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"CalendarAttendeeId":{"name":"attendeeId","description":"ID of the attendee.","in":"path","required":true,"schema":{"type":"integer"},"example":7},"CalendarDefinitionName":{"name":"name","description":"Name of the tenant calendar.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"site-inspections"},"CalendarEventId":{"name":"id","description":"ID of the calendar event.","in":"path","required":true,"schema":{"type":"integer"},"example":42},"CalendarEventsAfter":{"name":"after","description":"Cursor for the page of results to retrieve, from page.next of the previous page.","in":"query","required":false,"schema":{"type":"string"},"example":"MjU="},"CalendarEventsTop":{"name":"top","description":"Number of events to return in a page. Must be a positive integer.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":10},"example":25},"CalendarIncludeAttendees":{"name":"includeAttendees","description":"Set to true to include attendees in the events. Requires private access to the calendar (see the operation description), even for public events; other callers receive 403.\n","in":"query","required":false,"schema":{"type":"boolean","default":false}},"CalendarName":{"name":"name","description":"Name of the calendar.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"site-inspections"},"CalendarTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users; tenant users always act on the tenant of their token and this parameter is ignored. Must be a valid tenant URN.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"CalendarTenantName":{"name":"tenant","description":"Name of the tenant whose calendar to use. Any caller can set it, including anonymous users and users of another tenant, and it replaces the tenant of the token or tenantId parameter. Anonymous callers must set it, since they have no tenant context. An unknown tenant name responds 400.\n","in":"query","required":false,"schema":{"type":"string"},"example":"service-delivery"}},"responses":{"CalendarBadGateway":{"description":"Configuration service is unavailable, rejected the service's credentials, or returned invalid calendar definitions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Configuration service is unavailable."}}}},"CalendarBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Validation failed with error(s): id (params) - Invalid value"}}}},"CalendarConflict":{"description":"Request conflicts with the current state of the calendar.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Calendar 'site-inspections' already exists."}}}},"CalendarForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"User Test User (ID: 9f1c2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b) not permitted to create calendar event."}}}},"CalendarNotFound":{"description":"Calendar, event, occurrence, attendee, or date not found in the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarError"},"example":{"errorMessage":"Calendar with ID 'site-inspections' could not be found."}}}},"CalendarUnauthorized":{"description":"Request does not include a valid bearer token.","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}}},"schemas":{"Attendee":{"type":"object","properties":{"id":{"type":"integer","readOnly":true},"name":{"type":"string"},"email":{"type":"string","format":"email"}},"example":{"id":7,"name":"Test User","email":"test.user@gov.ab.ca"}},"AttendeeInput":{"type":"object","properties":{"name":{"type":"string","description":"Name of the attendee. Can be an empty string."},"email":{"type":"string","format":"email","description":"Email of the attendee. An event can't have two attendees with the same email."}},"required":["name","email"],"example":{"name":"Test User","email":"test.user@gov.ab.ca"}},"Calendar":{"type":"object","properties":{"urn":{"type":"string","readOnly":true},"name":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string"},"readRoles":{"type":"array","description":"Roles that can read private events and the attendees of events.","items":{"type":"string"}},"updateRoles":{"type":"array","description":"Roles that can read private events, and create, update, and delete events and attendees.","items":{"type":"string"}}},"example":{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections","name":"site-inspections","displayName":"Site inspections","description":"Calendar of scheduled site inspections.","readRoles":["inspection-viewer"],"updateRoles":["inspection-scheduler"]}},"CalendarDate":{"type":"object","properties":{"id":{"type":"integer","description":"ID of the date in the format yyyyMMdd."},"date":{"type":"string","format":"date-time"},"dayOfWeek":{"type":"integer","minimum":1,"maximum":7,"description":"ISO day of the week, from 1 (Monday) to 7 (Sunday)."},"isWeekend":{"type":"boolean"},"isHoliday":{"type":"boolean"},"isBusinessDay":{"type":"boolean"},"holiday":{"type":"string","nullable":true,"description":"Name of the holiday, if the date is a holiday."},"isInLieuOfDay":{"type":"boolean","description":"Indicates the date is a day off in lieu of a holiday that falls on a weekend."}},"example":{"id":20261111,"date":"2026-11-11T00:00:00.000Z","dayOfWeek":3,"isWeekend":false,"isHoliday":true,"isBusinessDay":false,"holiday":"Remembrance Day","isInLieuOfDay":false}},"CalendarDatesPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CalendarDate"}},"page":{"$ref":"#/components/schemas/CalendarPage"}},"example":{"results":[{"id":20261111,"date":"2026-11-11T00:00:00.000Z","dayOfWeek":3,"isWeekend":false,"isHoliday":true,"isBusinessDay":false,"holiday":"Remembrance Day","isInLieuOfDay":false},{"id":20261225,"date":"2026-12-25T00:00:00.000Z","dayOfWeek":5,"isWeekend":false,"isHoliday":true,"isBusinessDay":false,"holiday":"Christmas Day","isInLieuOfDay":false}],"page":{"next":"Mg==","size":2}}},"CalendarDefinition":{"allOf":[{"$ref":"#/components/schemas/Calendar"},{"type":"object","required":["source"],"properties":{"source":{"type":"string","enum":["tenant","core"],"readOnly":true,"description":"tenant for calendars managed by the tenant; core for read-only calendars registered by platform services."}}}],"example":{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections","name":"site-inspections","displayName":"Site inspections","description":"Calendar of scheduled site inspections.","readRoles":["inspection-viewer"],"updateRoles":["inspection-scheduler"],"source":"tenant"}},"CalendarDefinitionInput":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$","description":"Must not be the reserved __proto__ property. On update, must match the name in the path."},"displayName":{"type":"string","minLength":1,"maxLength":32,"pattern":"\\S"},"description":{"type":"string","maxLength":250},"readRoles":{"type":"array","items":{"type":"string"}},"updateRoles":{"type":"array","items":{"type":"string"}}},"required":["name","displayName","readRoles","updateRoles"],"example":{"name":"site-inspections","displayName":"Site inspections","description":"Calendar of scheduled site inspections.","readRoles":["inspection-viewer"],"updateRoles":["inspection-scheduler"]}},"CalendarDeleteResult":{"type":"object","properties":{"deleted":{"type":"boolean"}},"example":{"deleted":true}},"CalendarError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"CalendarEvent":{"type":"object","properties":{"urn":{"type":"string","readOnly":true},"id":{"type":"integer","readOnly":true},"recordId":{"type":"string","nullable":true,"description":"ID of a record in another system that the event relates to."},"context":{"type":"object","nullable":true,"description":"Properties of the event that can be used as criteria to find it."},"name":{"type":"string"},"description":{"type":"string"},"isPublic":{"type":"boolean","description":"Public events can be read by anyone, including anonymous users. Their attendees are not public."},"isAllDay":{"type":"boolean"},"start":{"type":"string","format":"date-time","description":"Start in the service timezone (America/Edmonton)."},"end":{"type":"string","format":"date-time","nullable":true,"description":"End in the service timezone (America/Edmonton)."},"recurrenceId":{"type":"string","format":"date-time","readOnly":true,"description":"Original start of the occurrence (RFC 5545 RECURRENCE-ID). Only included on occurrences of recurring events returned by range retrieval; id is the recurring event."},"recurrence":{"allOf":[{"$ref":"#/components/schemas/EventRecurrence"}],"description":"Only included for recurring events. exclusions is only included when retrieving the recurring event itself."},"attendees":{"type":"array","description":"Only included when includeAttendees is true.","items":{"$ref":"#/components/schemas/Attendee"}}},"example":{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections/events/42","id":42,"recordId":"inspection-1024","context":{"region":"north"},"name":"Site inspection","description":"Inspection of the Edmonton north facility.","isPublic":false,"isAllDay":false,"start":"2026-11-17T09:00:00.000-07:00","end":"2026-11-17T10:30:00.000-07:00"}},"CalendarEventCriteria":{"type":"object","properties":{"recordId":{"type":"string"},"context":{"type":"object","description":"Matches events whose context contains these properties and values."},"isPublic":{"type":"boolean","description":"Only applies to callers with private access; other callers always receive only public events."},"startsAfter":{"type":"string","format":"date-time"},"endsBefore":{"type":"string","format":"date-time"},"startsBefore":{"type":"string","format":"date-time","description":"Matches events that start at or before this time. Combine with endsAfter to find events that overlap a period."},"endsAfter":{"type":"string","format":"date-time","description":"Matches events that end at or after this time, or have no end."},"activeOn":{"type":"string","format":"date-time"},"attendeeCriteria":{"type":"object","properties":{"nameEquals":{"type":"string","nullable":true},"emailEquals":{"type":"string","nullable":true}}},"orderBy":{"type":"string","enum":["id","start"]}},"example":{"recordId":"inspection-1024","startsAfter":"2026-11-01T00:00:00-06:00"}},"CalendarEventInput":{"type":"object","properties":{"recordId":{"type":"string","nullable":true},"context":{"type":"object","nullable":true},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string"},"start":{"type":"string","format":"date-time","description":"ISO 8601 date/time. Values without an offset are read in the service timezone (America/Edmonton)."},"end":{"type":"string","format":"date-time","description":"ISO 8601 date/time. Must not be before start."},"isPublic":{"type":"boolean","default":false},"isAllDay":{"type":"boolean","default":false},"recurrence":{"allOf":[{"$ref":"#/components/schemas/EventRecurrence"}],"nullable":true}},"required":["name","start","end"]},"CalendarEventUpdate":{"type":"object","description":"Properties to change. Omitted properties are unchanged. end, name, description, and context can't be cleared, and recordId can't be changed.\n","properties":{"context":{"type":"object"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string"},"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time","description":"Must not be before start."},"isPublic":{"type":"boolean"},"isAllDay":{"type":"boolean"},"recurrence":{"allOf":[{"$ref":"#/components/schemas/EventRecurrence"}],"nullable":true,"description":"Replaces the whole recurrence. Set to null to make the event a single event."}}},"CalendarEventsPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CalendarEvent"}},"page":{"allOf":[{"$ref":"#/components/schemas/CalendarPage"}],"description":"Not included for range retrieval with from and to."}},"example":{"results":[{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections/events/42","id":42,"recordId":"inspection-1024","context":{"region":"north"},"name":"Site inspection","description":"Inspection of the Edmonton north facility.","isPublic":false,"isAllDay":false,"start":"2026-11-17T09:00:00.000-07:00","end":"2026-11-17T10:30:00.000-07:00"},{"urn":"urn:ads:platform:calendar-service:v1:/calendars/site-inspections/events/43/occurrences/2026-11-17","id":43,"name":"Team meeting","description":"Weekly inspection planning meeting.","isPublic":true,"isAllDay":false,"start":"2026-11-17T13:00:00.000-07:00","end":"2026-11-17T14:00:00.000-07:00","recurrenceId":"2026-11-17T13:00:00.000-07:00","recurrence":{"frequency":"weekly","interval":1,"daysOfWeek":["TU"],"end":{"until":"2026-12-15"}}}],"page":{"next":"Mg==","size":2}}},"CalendarPage":{"type":"object","properties":{"after":{"type":"string","description":"Cursor of the current page, if one was requested."},"next":{"type":"string","nullable":true,"description":"Cursor of the next page; not set when there are no more results."},"size":{"type":"integer"}}},"EventRecurrence":{"type":"object","description":"Recurrence of an event based on a subset of the RFC 5545 RRULE. Occurrences are generated in Mountain time (America/Edmonton) and keep the local start time across daylight saving changes.","properties":{"frequency":{"type":"string","enum":["daily","weekly","monthly","yearly"],"description":"Monthly and yearly recurrence use the day of the event start; months or years without that day are skipped."},"interval":{"type":"integer","minimum":1,"maximum":99,"default":1,"description":"Interval of the frequency; e.g. 2 with weekly is every two weeks."},"daysOfWeek":{"type":"array","description":"Weekly recurrence only. Must include the day of the event start. Defaults to the day of the event start.","items":{"type":"string","enum":["MO","TU","WE","TH","FR","SA","SU"]}},"end":{"type":"object","description":"Optional end of the recurrence. Specify until or count, not both.","properties":{"until":{"type":"string","format":"date","description":"Last date (inclusive) on which an occurrence can start."},"count":{"type":"integer","minimum":1,"maximum":1000,"description":"Number of occurrences, including the first and any cancelled occurrences."}}},"exclusions":{"type":"array","readOnly":true,"description":"Recurrence IDs of cancelled occurrences.","items":{"type":"string","format":"date-time"}}},"required":["frequency"],"example":{"frequency":"weekly","interval":1,"daysOfWeek":["TU"],"end":{"until":"2026-12-15"}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Calendar","description":"API to manage calendars, calendar events, and event attendees."},{"name":"Dates","description":"API to retrieve information about dates, such as holidays and business days."}]}