@abgov/adsp-sdk-mcp-server 1.26.0 → 1.27.0

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.
Files changed (58) hide show
  1. package/README.md +53 -7
  2. package/assets/api-specs/agent-service.json +1 -0
  3. package/assets/api-specs/audit-service.json +1 -0
  4. package/assets/api-specs/cache-service.json +1 -0
  5. package/assets/api-specs/calendar-service.json +1 -0
  6. package/assets/api-specs/comment-service.json +1 -0
  7. package/assets/api-specs/configuration-service.json +1 -0
  8. package/assets/api-specs/directory-service.json +1 -0
  9. package/assets/api-specs/event-service.json +1 -0
  10. package/assets/api-specs/export-service.json +1 -0
  11. package/assets/api-specs/feedback-service.json +1 -0
  12. package/assets/api-specs/file-service.json +1 -0
  13. package/assets/api-specs/form-service.json +1 -0
  14. package/assets/api-specs/index.json +186 -0
  15. package/assets/api-specs/notification-service.json +1 -0
  16. package/assets/api-specs/pdf-service.json +1 -0
  17. package/assets/api-specs/pii-service.json +1 -0
  18. package/assets/api-specs/project-planner-service.json +1 -0
  19. package/assets/api-specs/push-service.json +1 -0
  20. package/assets/api-specs/status-service.json +1 -0
  21. package/assets/api-specs/task-service.json +1 -0
  22. package/assets/api-specs/tenant-management-api.json +1 -0
  23. package/assets/api-specs/token-handler.json +1 -0
  24. package/assets/api-specs/value-service.json +1 -0
  25. package/assets/api-specs/verify-service.json +1 -0
  26. package/assets/docs/services/agent-service.md +31 -0
  27. package/assets/docs/services/notification-service.md +23 -0
  28. package/assets/docs/services/value-service.md +16 -0
  29. package/package.json +1 -1
  30. package/provenance.json +4 -4
  31. package/src/api-specs/apiSpecsRepository.d.ts +44 -0
  32. package/src/api-specs/apiSpecsRepository.js +113 -0
  33. package/src/api-specs/apiSpecsRepository.js.map +1 -0
  34. package/src/config.d.ts +2 -0
  35. package/src/config.js +7 -0
  36. package/src/config.js.map +1 -1
  37. package/src/hosted.d.ts +20 -0
  38. package/src/hosted.js +30 -0
  39. package/src/hosted.js.map +1 -0
  40. package/src/http.d.ts +4 -1
  41. package/src/http.js +22 -1
  42. package/src/http.js.map +1 -1
  43. package/src/index.d.ts +2 -0
  44. package/src/index.js +3 -1
  45. package/src/index.js.map +1 -1
  46. package/src/lifecycle.d.ts +18 -0
  47. package/src/lifecycle.js +52 -0
  48. package/src/lifecycle.js.map +1 -0
  49. package/src/main.js +2 -22
  50. package/src/main.js.map +1 -1
  51. package/src/metrics.js +7 -1
  52. package/src/metrics.js.map +1 -1
  53. package/src/server.d.ts +2 -0
  54. package/src/server.js +13 -3
  55. package/src/server.js.map +1 -1
  56. package/src/tools/registerApiTools.d.ts +7 -0
  57. package/src/tools/registerApiTools.js +110 -0
  58. package/src/tools/registerApiTools.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"openapi":"3.0.0","info":{"title":"Form service","version":"1.0.0","description":""},"paths":{"/form/v1/definitions":{"get":{"tags":["Form"],"description":"Retrieves the form definitions of the tenant, with optional name search. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`) in the tenant; core users are not accepted, and anonymous requests respond 403.\n","parameters":[{"name":"top","description":"Number of definitions to return in a page. Passed to the configuration service, which accepts 1 to 1000.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"after","description":"Cursor for retrieving additional pages.","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","description":"Search for form definitions by name (partial match, case-insensitive).","in":"query","required":false,"schema":{"type":"string"}},{"name":"createDateAfter","description":"Only include definitions created on or after this date (ISO-8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"createDateBefore","description":"Only include definitions created on or before this date (ISO-8601).","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successfully retrieved form definitions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionPage"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"403":{"$ref":"#/components/responses/FormForbidden"}}},"post":{"tags":["Form"],"description":"Creates a new form definition in the tenant. Requires the form-service admin role\n(`urn:ads:platform:form-service:form-admin`). Core users with the role must set `tenantId`.\n\nOnly `name` and `description` are accepted in the request body. All other fields are set automatically:\n- `id`: auto-generated from `name` in kebab-case\n- `anonymousApply`: `false`\n- `applicantRoles`, `assessorRoles`, and `clerkRoles`: `[]`\n- `securityClassification`: `protected b`\n","parameters":[{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionCreate"}}}},"responses":{"201":{"description":"Successfully created the form definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"description":"Validation failed, the ID could not be generated from the provided name, or the configuration service rejected the definition.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Form definition ID could not be generated from the provided name."}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"409":{"description":"Form definition with the generated ID already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Form definition with ID 'business-licence-application' already exists."}}}}}}},"/form/v1/definitions/{definitionId}":{"get":{"tags":["Form"],"description":"Retrieves a form definition, with its current scheduled intake if it uses scheduled intakes. Requires the form-service admin or intake-application role, or one of the definition's applicant or clerk roles, in the tenant of the definition.\n\nIf the definition allows anonymous applications, any user can read it and the request does not need a bearer token. Anonymous requests have no token to determine the tenant from, so they must include the tenantId query parameter.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"name":"version","description":"Revision of the form definition to retrieve. Defaults to the active revision.","in":"query","required":false,"schema":{"type":"number"}},{"name":"tenantId","description":"ID of the tenant of the definition. Required for anonymous requests and core users; ignored for tenant users.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}],"responses":{"200":{"description":"Successfully retrieved a form definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"description":"Request is invalid, or the tenant cannot be determined for an anonymous request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Cannot determine tenant context of request."}}}},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}},"patch":{"tags":["Form"],"description":"Partially updates an existing form definition. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. Only the provided fields are changed; omitted fields are left unchanged.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionPatch"}}}},"responses":{"200":{"description":"Successfully patched the form definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}},"put":{"tags":["Form"],"description":"Replaces a form definition with the request body, creating it if it does not exist. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. The `id` of the definition is taken from the path.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"},"example":{"name":"Business licence application","description":"Application for a municipal business licence.","anonymousApply":false,"oneFormPerApplicant":true,"applicantRoles":["business-licence-applicant"],"assessorRoles":["business-licence-assessor"],"clerkRoles":[],"formDraftUrlTemplate":"https://form.alberta.ca/business-licence-application/{{ id }}","dataSchema":{"type":"object","properties":{"businessName":{"type":"string"}}},"submissionRecords":true,"securityClassification":"protected b"}}}},"responses":{"200":{"description":"Successfully updated the form definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}},"delete":{"tags":["Form"],"description":"Deletes a form definition. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. Deleting a definition that does not exist also responds 204.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"204":{"description":"Successfully deleted the form definition."},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}}},"/form/v1/definitions/{definitionId}/lifecycle":{"patch":{"tags":["Form"],"description":"Partially updates the lifecycle settings of an existing form definition. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. Only provided fields are changed; omitted fields are left unchanged.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"allowAnonymousApplication":{"type":"boolean","description":"Whether anonymous (unauthenticated) applicants can submit the form."},"allowMultipleFormsPerApplicant":{"type":"boolean","description":"Whether an applicant can submit more than one form. When false, only one form per applicant is allowed."},"createSupportTopic":{"type":"boolean","description":"Whether a support topic is created for each new form."},"securityClassification":{"type":"string","enum":["protected a","protected b","protected c","public"],"description":"Security classification of the form definition."}}},"example":{"allowAnonymousApplication":false,"allowMultipleFormsPerApplicant":true,"createSupportTopic":true,"securityClassification":"protected b"}}}},"responses":{"200":{"description":"Successfully updated lifecycle settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/definitions/{definitionId}/roles":{"put":{"tags":["Form"],"description":"Replaces the applicant, assessor, and clerk roles of an existing form definition. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. The provided roles replace the existing roles entirely; any role array omitted from the request is reset to empty.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"applicantRoles":{"type":"array","items":{"type":"string"},"description":"Roles permitted to apply. Replaces the existing applicant roles entirely."},"assessorRoles":{"type":"array","items":{"type":"string"},"description":"Roles permitted to assess submissions. Replaces the existing assessor roles entirely."},"clerkRoles":{"type":"array","items":{"type":"string"},"description":"Roles permitted to act as clerks. Replaces the existing clerk roles entirely."}}},"example":{"applicantRoles":["business-licence-applicant"],"assessorRoles":["business-licence-assessor"],"clerkRoles":["business-licence-clerk"]}}}},"responses":{"200":{"description":"Successfully replaced form definition roles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/definitions/{definitionId}/schedule":{"put":{"tags":["Form schedules"],"description":"Updates the scheduled intake period of a form definition, by updating its event in the calendar service. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. Responds with the form definition and its updated intake. A definition that does not exist responds 400.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutIntakeParameters"}}}},"responses":{"200":{"description":"Successfully updated the intake schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"description":"Request is invalid, or the form definition does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Form definition not found"}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}}},"/form/v1/definitions/{definitionId}/schemas":{"put":{"tags":["Form"],"description":"Updates the data and UI schemas for an existing form definition. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data-schema":{"type":"object","description":"JSON Schema describing the shape of the form data. If omitted, the existing data schema is preserved."},"ui-schema":{"type":"object","description":"UI schema describing the layout and controls of the form. If omitted, the existing UI schema is preserved."}}},"example":{"data-schema":{"type":"object","properties":{"businessName":{"type":"string"}},"required":["businessName"]},"ui-schema":{"type":"VerticalLayout","elements":[{"type":"Control","scope":"#/properties/businessName"}]}}}}},"responses":{"204":{"description":"Schemas updated successfully. No content is returned."},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/definitions/{definitionId}/submission-actions":{"patch":{"tags":["Form"],"description":"Partially updates the actions invoked when a form is submitted. Requires the form-service admin role (`urn:ads:platform:form-service:form-admin`); core users with the role must set `tenantId`. Only provided fields are changed; omitted fields are left unchanged. Properties other than those listed respond 400.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"createPDF":{"type":"boolean","description":"Whether to generate a submission PDF using the default submitted-form template."},"createSubmissionRecords":{"type":"boolean","description":"Whether to create submission records when the form is submitted."},"event":{"type":"string","nullable":true,"pattern":"^[^:]+:[^:]+$","description":"Custom submission event in namespace:name format. Set to null to clear."},"includeDataInEvent":{"type":"boolean","description":"Whether submitted form data is included in the submission event payload."},"taskQueue":{"type":"string","nullable":true,"pattern":"^[^:]+:[^:]+$","description":"Queue task target in queueNameSpace:queueName format. Set to null to clear."},"dispositionStates":{"type":"array","items":{"type":"object","required":["name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}}}}},"example":{"createPDF":true,"createSubmissionRecords":true,"event":"business-licence:application-received","includeDataInEvent":false,"taskQueue":"business-licence:intake","dispositionStates":[{"id":"approved","name":"Approved","description":"Licence is approved."},{"id":"rejected","name":"Rejected","description":"Licence is rejected."}]}}}},"responses":{"200":{"description":"Successfully updated submission actions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinition"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/forms":{"get":{"tags":["Form"],"description":"Find forms. Users with the form-service admin role, or the export-service export-job role, can find all forms of the tenant. When the criteria include definitionIdEquals, users with one of that definition's assessor roles can find its submitted forms. Other users only find the forms they created, and cannot use includeData. Core users must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormTenantId"},{"name":"top","description":"Number of forms to return in a page. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"includeData","description":"Flag indicating if form data should be included in results.","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"after","description":"Cursor for retrieving additional pages.","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortBy","description":"Column to sort results on. Use 'created' or 'status' for form fields, and 'data.' followed by\nthe path into the form data for a data value (e.g. 'data.applicant.lastName').\n","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"sortDirection","description":"Direction of the sort. Defaults to descending.","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"criteria","description":"Criteria for the forms to retrieve, as JSON. Date values must be ISO-8601 strings.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"anonymousApplicantEquals":{"type":"boolean"},"definitionIdEquals":{"type":"string"},"statusEquals":{"type":"string","enum":["draft","locked","submitted","archived"]},"lastAccessedBefore":{"type":"string","format":"date-time"},"lockedBefore":{"type":"string","format":"date-time"},"createDateBefore":{"type":"string","format":"date-time"},"createDateAfter":{"type":"string","format":"date-time"},"createdByIdEquals":{"type":"string"},"hashEquals":{"type":"string"},"dataCriteria":{"type":"object","description":"Values to match in the form data, keyed by the path into the data (e.g. 'applicant.lastName'). Text values are case-insensitive partial matches.\n","additionalProperties":true}}},"example":{"definitionIdEquals":"business-licence-application","statusEquals":"submitted"}}}}],"responses":{"200":{"description":"Successfully retrieved forms.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormPage"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}},"post":{"tags":["Form"],"description":"Creates a draft form of a definition in the tenant, optionally with data, and optionally submits it straight away. Requires one of the definition's applicant or clerk roles; if the definition allows anonymous applications, the form-service intake-application role is also accepted. When the definition uses scheduled intakes, forms can only be created during an active intake, unless the user has the form-service form-tester role or the request is a dry run.\n\nAn applicant who creates their own form is set as the form's applicant (and notified by email) when applicant information is included or the definition allows one form per applicant. Clerks and intake applications can provide the details of the applicant they act for.\n","parameters":[{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definitionId":{"type":"string","minLength":1,"maxLength":50},"applicant":{"type":"object","properties":{"id":{"type":"string","description":"ID of an existing notification service subscriber to use as the applicant."},"userId":{"type":"string"},"addressAs":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"]},"address":{"type":"string"}},"required":["channel","address"]}}}},"data":{"type":"object","description":"Initial form data. File references can be embedded as file-service URNs."},"files":{"type":"object","deprecated":true,"description":"Not used; file references are resolved from the data.","additionalProperties":{"type":"string"}},"submit":{"type":"boolean","description":"Submit the form immediately after it is created."},"dryRun":{"type":"boolean","description":"Validate and simulate the request without saving the form."}},"required":["definitionId"]},"examples":{"applicant":{"summary":"Applicant creates their own draft","value":{"definitionId":"business-licence-application"}},"anonymousApplicant":{"summary":"Intake application creates a draft for an anonymous applicant","value":{"definitionId":"business-licence-application","applicant":{"addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca"}]}}},"createAndSubmit":{"summary":"Create with data and submit","value":{"definitionId":"business-licence-application","data":{"businessName":"Example Bakery Ltd."},"submit":true}}}}}},"responses":{"200":{"description":"Successfully created a form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Request is invalid, the definition has no active intake, or the data is not valid for the definition when the form is submitted.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Cannot create form as there is no active intake."}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/forms/{formId}":{"parameters":[{"$ref":"#/components/parameters/FormIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"get":{"tags":["Form"],"description":"Retrieves a form, and its submission if it is submitted. Requires the form-service admin or intake-application role, one of the definition's clerk or assessor roles, or one of its applicant roles for the form's creator (unless the form is archived). Including the data needs the form data access described for `GET /form/v1/forms/{formId}/data`, and fails for locked forms. Core users must set `tenantId`.\n","parameters":[{"name":"includeData","description":"Flag indicating if data should be included in results.","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successfully retrieved the form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}},"post":{"tags":["Form"],"description":"Executes a form operation. The user must be able to read the form (see `GET /form/v1/forms/{formId}`), and\neach operation needs a further role:\n- `send-code`: the form-service intake-application role. Sends a verification code to the applicant.\n- `unlock`: the form-service admin role. Only locked forms can be unlocked.\n- `submit`: one of the definition's clerk roles, or an applicant role for the form's creator. Only draft forms\n can be submitted, and the data must be valid for the definition's data schema.\n- `to-draft`: the form-service admin role or one of the definition's assessor roles. Only submitted forms can be\n set back to draft.\n- `archive`: the form-service admin role.\n\nCore users must set `tenantId`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/UnlockFormOperation"},{"$ref":"#/components/schemas/SubmitFormOperation"},{"$ref":"#/components/schemas/ArchiveFormOperation"},{"$ref":"#/components/schemas/SendCodeOperation"},{"$ref":"#/components/schemas/SetToDraftOperation"}],"discriminator":{"propertyName":"operation","mapping":{"unlock":"#/components/schemas/UnlockFormOperation","submit":"#/components/schemas/SubmitFormOperation","archive":"#/components/schemas/ArchiveFormOperation","send-code":"#/components/schemas/SendCodeOperation","to-draft":"#/components/schemas/SetToDraftOperation"}}},"examples":{"submit":{"summary":"Submit the form","value":{"operation":"submit"}},"sendCode":{"summary":"Send a verification code to the applicant","value":{"operation":"send-code"}},"unlock":{"summary":"Unlock a locked form","value":{"operation":"unlock"}},"toDraft":{"summary":"Set a submitted form back to draft","value":{"operation":"to-draft"}},"archive":{"summary":"Archive the form","value":{"operation":"archive"}}}}}},"responses":{"200":{"description":"Successfully executed operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Request is invalid, the form is not in a status that allows the operation, or the data is not valid for the definition on submit.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Cannot submit form not in draft."}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}},"delete":{"tags":["Form"],"description":"Deletes a form and its files. Requires the form-service admin role. Draft forms can also be deleted by users with one of the definition's clerk roles, and by their creator with one of the definition's applicant roles. The user must also be able to read the form (see `GET /form/v1/forms/{formId}`). Core users must set `tenantId`.\n","responses":{"200":{"description":"Successfully deleted the form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDeleteResult"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}}},"/form/v1/forms/{formId}/data":{"parameters":[{"$ref":"#/components/parameters/FormIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"get":{"tags":["Form"],"description":"Retrieves form data. Requires the form-service admin role, one of the definition's applicant roles for the form's creator, one of its clerk roles while the form is a draft, or one of its assessor roles once it is submitted. Alternatively, a user with the form-service intake-application role can provide the verification code sent to the applicant. Locked forms cannot be read. Core users must set `tenantId`.\n","parameters":[{"name":"code","description":"Verification code sent to the applicant with the send-code operation.","required":false,"in":"query","schema":{"type":"string","minLength":1,"maxLength":10}}],"responses":{"200":{"description":"Successfully retrieved the form data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormData"}}}},"400":{"description":"Request is invalid, or the form is locked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Locked form cannot be read."}}}},"401":{"description":"Request does not include a valid bearer token, or the provided code could not be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Provided code could not be verified."}}}},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}},"put":{"tags":["Form"],"description":"Sets the form data of a draft form. Requires one of the definition's clerk roles, or one of its applicant roles for the form's creator. Files that are no longer referenced in the data are deleted. Core users must set `tenantId`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Form data. File references can be embedded directly as file-service URNs anywhere in this object."}},"required":["data"]},"example":{"data":{"businessName":"Example Bakery Ltd.","proofOfRegistration":"urn:ads:platform:file-service:v1:/files/3c2b1a0f-9e8d-4c7b-a6f5-e4d3c2b1a0f9"}}}}},"responses":{"200":{"description":"Successfully updated the form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormData"}}}},"400":{"description":"Request is invalid, or the form is not a draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Cannot update form not in draft."}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}}},"/form/v1/forms/{formId}/submissions":{"parameters":[{"$ref":"#/components/parameters/FormIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"get":{"tags":["Form Submission"],"description":"Retrieves submissions of a specified form matching search criteria. Requires the form-service admin role,\none of the form definition's assessor roles, or the export-service export-job role. Core users must set\n`tenantId`.\n","parameters":[{"name":"top","description":"Number of submissions to return in a page. Defaults to 100.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for retrieving additional pages.","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortBy","description":"Column to sort results on. Use 'created', 'submissionStatus', or 'disposition' for submission\nfields, and 'data.' followed by the path into the form data for a data value\n(e.g. 'data.applicant.lastName').\n","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"sortDirection","description":"Direction of the sort. Defaults to descending.","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"criteria","description":"Criteria for form submissions to retrieve, as JSON. Date values must be ISO-8601 strings.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"createDateBefore":{"description":"The form submission create date that it was created before.","type":"string","format":"date-time"},"createDateAfter":{"description":"The form submission create date that it was created after.","type":"string","format":"date-time"},"dispositionStatusEquals":{"description":"The disposition status for the form submission.","type":"string"},"dispositionDateBefore":{"description":"The disposition before date for the form submission was updated.","type":"string","format":"date-time"},"dispositionDateAfter":{"description":"The disposition after date for the form submission was updated","type":"string","format":"date-time"},"createdByIdEquals":{"description":"Name of the user the form submission was created by.","type":"string"},"definitionIdEquals":{"description":"ID of the form definition of the submissions.","type":"string"},"submissionStatusEquals":{"description":"The status of the form submission.","type":"string"},"dispositioned":{"description":"True to only include submissions with a disposition; false to only include submissions without one.","type":"boolean"},"dataCriteria":{"description":"Values to match in the submission data, keyed by the path into the data (e.g. 'applicant.lastName'). Text values are case-insensitive partial matches.\n","type":"object","additionalProperties":true}}},"example":{"dispositioned":false}}}}],"responses":{"200":{"description":"Successfully retrieves the form submissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmissionPage"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}}},"/form/v1/forms/{formId}/submissions/{submissionId}":{"parameters":[{"$ref":"#/components/parameters/FormIdPath"},{"$ref":"#/components/parameters/FormSubmissionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"get":{"tags":["Form Submission"],"description":"Retrieves a form submission. Requires the form-service admin role or one of the definition's assessor roles. Core users must set `tenantId`.\n","responses":{"200":{"description":"Successfully retrieved the form submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmission"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}},"post":{"tags":["Form Submission"],"description":"Update the form disposition for the form submission. Requires the form-service admin role or one of the definition's assessor roles. The status must match the ID or name of one of the definition's disposition states. Core users must set `tenantId`.\n","responses":{"200":{"description":"Successfully updated the form submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmission"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dispositionStatus":{"type":"string","minLength":1},"dispositionReason":{"type":"string","minLength":1}},"required":["dispositionStatus","dispositionReason"]},"example":{"dispositionStatus":"approved","dispositionReason":"Application meets all eligibility criteria."}}}}}},"/form/v1/forms/{formId}/submissions/{submissionId}/notes":{"parameters":[{"$ref":"#/components/parameters/FormIdPath"},{"$ref":"#/components/parameters/FormSubmissionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"post":{"tags":["Form Submission"],"description":"Adds a reviewer note to the form submission. Requires the form-service admin role or one of the definition's assessor roles. Core users must set `tenantId`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":5000}},"required":["content"]},"example":{"content":"Called applicant to confirm their mailing address."}}}},"responses":{"200":{"description":"Successfully added the note to the form submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmission"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}}},"/form/v1/forms/{formId}/submissions/{submissionId}/notes/{noteId}":{"parameters":[{"$ref":"#/components/parameters/FormIdPath"},{"$ref":"#/components/parameters/FormSubmissionIdPath"},{"name":"noteId","description":"ID of the note.","required":true,"in":"path","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/FormTenantId"}],"delete":{"tags":["Form Submission"],"description":"Removes a reviewer note from the form submission. Requires the form-service admin role or one of the definition's assessor roles. Core users must set `tenantId`.\n","responses":{"200":{"description":"Successfully removed the note from the form submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmission"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}}},"/form/v1/registers":{"get":{"tags":["Form"],"description":"Retrieves the data registers that have both a definition and a data document, i.e. the registers manageable through this API. Requires the form-service admin role or the configuration-service configuration-admin role. Core users with either role must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"200":{"description":"Successfully retrieved the list of data registers.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataRegister"}},"example":[{"namespace":"data-register","name":"weekdays","description":"Days of the week","entries":["Monday","Tuesday","Wednesday","Thursday","Friday"]}]}}},"400":{"description":"Request has no tenant context. A core user must specify the tenantId query parameter."},"401":{"description":"User is not authenticated."},"403":{"description":"User is not authorized. Requires the form-service admin or configuration-admin role."},"502":{"description":"configuration-service returned an unexpected error."}}},"post":{"tags":["Form"],"description":"Creates a new data register: its definition in the shared platform/configuration-service document, followed by its entries in a data-register/<name> configuration document. Requires the form-service admin role or the configuration-service configuration-admin role. Core users with either role must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRegisterCreate"},"example":{"name":"weekdays","description":"Days of the week","entries":["Monday","Tuesday","Wednesday","Thursday","Friday"]}}}},"responses":{"201":{"description":"Successfully created the data register.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRegister"},"example":{"namespace":"data-register","name":"weekdays","description":"Days of the week","entries":["Monday","Tuesday","Wednesday","Thursday","Friday"]}}}},"400":{"description":"Request is not valid or has no tenant context, or configuration-service rejected the request.\n"},"401":{"description":"User is not authenticated."},"403":{"description":"User is not authorized. Requires the form-service admin or configuration-admin role."},"409":{"description":"A data register with this name already exists."},"502":{"description":"configuration-service returned an unexpected error."}}}},"/form/v1/registers/{name}":{"get":{"tags":["Form"],"description":"Retrieves a data register by name. Requires the form-service admin role or the configuration-service configuration-admin role. Core users with either role must set `tenantId`.\n","parameters":[{"name":"name","description":"Name of the data register.","required":true,"in":"path","schema":{"type":"string","pattern":"^[a-zA-Z0-9\\-_](?:[a-zA-Z0-9\\-_ ]{0,48}[a-zA-Z0-9\\-_])?$"}},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"200":{"description":"Successfully retrieved the data register.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRegister"},"example":{"namespace":"data-register","name":"weekdays","description":"Days of the week","entries":["Monday","Tuesday","Wednesday","Thursday","Friday"]}}}},"400":{"description":"Name is not valid, or the request has no tenant context."},"401":{"description":"User is not authenticated."},"403":{"description":"User is not authorized. Requires the form-service admin or configuration-admin role."},"404":{"description":"No data register with this name was found; it must have both a definition and a data document to be considered to exist.\n"},"502":{"description":"configuration-service returned an unexpected error."}}},"patch":{"tags":["Form"],"description":"Updates the description and/or entries of an existing data register. Only provided fields are changed: sending description alone leaves the entries unchanged, and vice versa. Entries are written to the latest revision; if an older revision is pinned as active, the pin moves to that revision so the new entries are live. Requires the form-service admin role or the configuration-service configuration-admin role. Core users with either role must set `tenantId`.\n","parameters":[{"name":"name","description":"Name of the data register.","required":true,"in":"path","schema":{"type":"string","pattern":"^[a-zA-Z0-9\\-_](?:[a-zA-Z0-9\\-_ ]{0,48}[a-zA-Z0-9\\-_])?$"}},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRegisterUpdate"},"example":{"description":"Updated list of weekdays","entries":["Monday","Tuesday","Wednesday","Thursday","Friday"]}}}},"responses":{"200":{"description":"Successfully updated the data register.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRegister"}}}},"400":{"description":"Request is not valid or has no tenant context, or configuration-service rejected the request.\n"},"401":{"description":"User is not authenticated."},"403":{"description":"User is not authorized. Requires the form-service admin or configuration-admin role."},"404":{"description":"No data register with this name was found."},"502":{"description":"configuration-service returned an unexpected error."}}},"delete":{"tags":["Form"],"description":"Deletes a data register: its entries and its definition. Removes whichever of the two parts still exists, so a retry after a partial failure succeeds. Forms that reference the register in a dropdown or list will lose its options. Requires the form-service admin role or the configuration-service configuration-admin role. Core users with either role must set `tenantId`.\n","parameters":[{"name":"name","description":"Name of the data register to delete.","required":true,"in":"path","schema":{"type":"string","pattern":"^[a-zA-Z0-9\\-_](?:[a-zA-Z0-9\\-_ ]{0,48}[a-zA-Z0-9\\-_])?$"}},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"204":{"description":"Successfully deleted the data register."},"400":{"description":"Name is not valid, or the request has no tenant context."},"401":{"description":"User is not authenticated."},"403":{"description":"User is not authorized. Requires the form-service admin or configuration-admin role."},"404":{"description":"No data register with this name was found; neither a definition nor a data document exists."},"502":{"description":"configuration-service returned an unexpected error."}}}},"/form/v1/submissions":{"get":{"tags":["Form Submission"],"description":"Retrieves submissions of the tenant matching search criteria. Requires the form-service admin role or the\nexport-service export-job role. Users with one of a definition's assessor roles can retrieve its submissions by\nincluding definitionIdEquals in the criteria. Core users must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormTenantId"},{"name":"top","description":"Number of submissions to return in a page. Defaults to 100.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for retrieving additional pages.","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortBy","description":"Column to sort results on. Use 'created', 'submissionStatus', or 'disposition' for submission\nfields, and 'data.' followed by the path into the form data for a data value\n(e.g. 'data.applicant.lastName').\n","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"sortDirection","description":"Direction of the sort. Defaults to descending.","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"criteria","description":"Criteria for form submissions to retrieve, as JSON. Date values must be ISO-8601 strings.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"createDateBefore":{"description":"The form submission create date that it was created before.","type":"string","format":"date-time"},"createDateAfter":{"description":"The form submission create date that it was created after.","type":"string","format":"date-time"},"dispositionStatusEquals":{"description":"The disposition status for the form submission.","type":"string"},"dispositionDateBefore":{"description":"The disposition before date for the form submission was updated.","type":"string","format":"date-time"},"dispositionDateAfter":{"description":"The disposition after date for the form submission was updated","type":"string","format":"date-time"},"createdByIdEquals":{"description":"Name of the user the form submission was created by.","type":"string"},"definitionIdEquals":{"description":"ID of the form definition of the submissions.","type":"string"},"submissionStatusEquals":{"description":"The status of the form submission.","type":"string"},"dispositioned":{"description":"True to only include submissions with a disposition; false to only include submissions without one.","type":"boolean"},"dataCriteria":{"description":"Values to match in the submission data, keyed by the path into the data (e.g. 'applicant.lastName'). Text values are case-insensitive partial matches.\n","type":"object","additionalProperties":true}}},"example":{"definitionIdEquals":"business-licence-application","dispositioned":false}}}}],"responses":{"200":{"description":"Successfully retrieves the form submissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmissionPage"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}}},"/form/v1/submissions/{submissionId}":{"parameters":[{"$ref":"#/components/parameters/FormSubmissionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"get":{"tags":["Form Submission"],"description":"Retrieves a form submission. Requires the form-service admin role or one of the definition's assessor roles. Core users must set `tenantId`.\n","responses":{"200":{"description":"Successfully retrieved the form submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmission"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormNotFound"}}},"delete":{"tags":["Form Submission"],"description":"Deletes a form submission. Requires the form-service admin role. Core users must set `tenantId`. A submission that does not exist responds 200 with `deleted: false`.\n","responses":{"200":{"description":"Successfully deleted the form submission, or no submission was found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDeleteResult"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"FormDefinitionIdPath":{"name":"definitionId","description":"ID of the form definition.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-zA-Z0-9-]+$"},"example":"business-licence-application"},"FormIdPath":{"name":"formId","description":"ID of the form.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f"},"FormSubmissionIdPath":{"name":"submissionId","description":"ID of the form submission.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"6a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"},"FormTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Required for core (platform) users. Tenant users always act on the tenant of their token, and this parameter is ignored for them.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"FormBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Validation failed with error(s): formId (params) - Invalid value"}}}},"FormDefinitionNotFound":{"description":"Form definition not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"form definition with ID 'business-licence-application' could not be found."}}}},"FormForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to find submissions."}}}},"FormNotFound":{"description":"Form definition, form, or submission not found. Forms and submissions of another tenant also respond 404.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Form submission with ID '5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f' could not be found."}}}},"FormUnauthorized":{"description":"Request does not include a valid bearer token."}},"schemas":{"ArchiveFormOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["archive"]}}},"DataRegister":{"type":"object","required":["name"],"properties":{"namespace":{"type":"string","description":"Namespace of the data register. Always data-register."},"name":{"type":"string","description":"Name of the data register."},"description":{"type":"string","description":"Human-readable description of what the register contains."},"entries":{"type":"array","description":"List of values stored in the register, from its active revision, or its latest revision if none is active.\n","items":{"oneOf":[{"type":"string"},{"type":"object"}]}}},"example":{"namespace":"data-register","name":"weekdays","description":"Days of the week","entries":["Monday","Tuesday","Wednesday","Thursday","Friday"]}},"DataRegisterCreate":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the data register. Unique within the tenant. 1 to 50 letters, numbers, spaces, hyphens and underscores, not starting or ending with a space.\n","pattern":"^[a-zA-Z0-9\\-_](?:[a-zA-Z0-9\\-_ ]{0,48}[a-zA-Z0-9\\-_])?$"},"description":{"type":"string","description":"Human-readable description of what the register contains."},"entries":{"type":"array","description":"Initial list of values stored in the register. Defaults to an empty array.","items":{"oneOf":[{"type":"string"},{"type":"object"}]}}},"additionalProperties":false},"DataRegisterUpdate":{"type":"object","description":"Partial update payload for a data register. Only provided fields are changed; omitting entries leaves the existing entries unchanged.\n","properties":{"description":{"type":"string","description":"Updated description for the register."},"entries":{"type":"array","description":"Replacement list of values for the register.","items":{"oneOf":[{"type":"string"},{"type":"object"}]}}},"additionalProperties":false},"Form":{"type":"object","properties":{"urn":{"type":"string"},"id":{"type":"string"},"jobId":{"type":"string","nullable":true,"description":"ID of the PDF generation job, when submitting the form generates a PDF."},"definition":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}},"applicant":{"type":"object","nullable":true,"properties":{"addressAs":{"type":"string"}}},"status":{"type":"string","enum":["draft","locked","submitted","archived"]},"securityClassification":{"type":"string","enum":["public","protected a","protected b","protected c"]},"formDraftUrl":{"type":"string","description":"URL of the draft form in the application, based on the definition's formDraftUrlTemplate."},"data":{"type":"object","description":"Form data; only included when requested with includeData."},"files":{"type":"object","description":"Form files as file-service URNs; only included when requested with includeData.","additionalProperties":{"type":"string"}},"dryRun":{"type":"boolean","description":"Indicates the form was created as a dry run and was not saved."},"created":{"type":"string","format":"date-time"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"lastAccessed":{"type":"string","format":"date-time"},"locked":{"type":"string","format":"date-time","nullable":true},"submitted":{"type":"string","format":"date-time","nullable":true},"submission":{"type":"object","description":"submission for the form if form is submitted.","properties":{"id":{"type":"string"},"urn":{"type":"string"}}}},"example":{"urn":"urn:ads:platform:form-service:v1:/forms/5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","id":"5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","jobId":null,"securityClassification":"protected b","definition":{"id":"business-licence-application","name":"Business licence application","description":"Application for a municipal business licence."},"formDraftUrl":"https://form.alberta.ca/business-licence-application/5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","status":"draft","created":"2026-10-02T15:04:05.000Z","createdBy":{"id":"0f9e8d7c-6b5a-4f3e-9d2c-1b0a9f8e7d6c","name":"Test User"},"locked":null,"submitted":null,"lastAccessed":"2026-10-02T15:04:05.000Z","applicant":{"addressAs":"Test User"}}},"FormData":{"type":"object","properties":{"id":{"type":"string","description":"ID of the form."},"data":{"type":"object"},"files":{"type":"object","description":"File-service URNs of the files referenced in the data, keyed by their path in the data.","additionalProperties":{"type":"string"}}},"example":{"id":"5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","data":{"businessName":"Example Bakery Ltd.","proofOfRegistration":"urn:ads:platform:file-service:v1:/files/3c2b1a0f-9e8d-4c7b-a6f5-e4d3c2b1a0f9"},"files":{"proofOfRegistration":"urn:ads:platform:file-service:v1:/files/3c2b1a0f-9e8d-4c7b-a6f5-e4d3c2b1a0f9"}}},"FormDefinition":{"type":"object","required":["name","anonymousApply","applicantRoles","assessorRoles"],"properties":{"id":{"type":"string","readOnly":true,"description":"Unique identifier for the form definition. Generated from the name in kebab-case when the definition is created, and taken from the path on update.\n"},"revision":{"type":"number","readOnly":true,"description":"Revision of the definition in the configuration service."},"created":{"type":"string","format":"date-time","readOnly":true,"description":"Date the form definition (latest revision) was created. Only returned when listing definitions."},"name":{"type":"string"},"description":{"type":"string"},"anonymousApply":{"type":"boolean","default":false,"description":"Whether anonymous (unauthenticated) applicants can submit the form. Defaults to false."},"oneFormPerApplicant":{"type":"boolean"},"applicantRoles":{"type":"array","description":"Roles allowed to submit the form.","items":{"type":"string"}},"assessorRoles":{"type":"array","description":"Roles allowed to assess submitted forms.","items":{"type":"string"}},"clerkRoles":{"type":"array","description":"Roles allowed to fill in and submit forms on behalf of applicants.","items":{"type":"string"}},"formDraftUrlTemplate":{"type":"string","minLength":6,"maxLength":500,"pattern":"^https?://.+$","description":"Optional URL template for linking applicants back to their draft. Use '{{ id }}' as a placeholder for the form ID (e.g. https://example.com/form/{{ id }}). Must be between 6 and 500 characters.\n"},"dataSchema":{"type":"object"},"uiSchema":{"type":"object"},"dispositionStates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}}},"generatesPdf":{"type":"boolean","readOnly":true,"description":"Whether a PDF is generated for submissions. Anonymous application definitions never generate one."},"submissionRecords":{"type":"boolean"},"submissionPdfTemplate":{"type":"string","writeOnly":true,"description":"PDF service template used for the submission PDF. Not returned by the form APIs."},"scheduledIntakes":{"type":"boolean","description":"Allow this form definition to accept schedule intakes"},"supportTopic":{"type":"boolean"},"registeredId":{"type":"string","readOnly":true},"securityClassification":{"type":"string","enum":["public","protected a","protected b","protected c"],"writeOnly":true,"description":"The security classification for the form definition. Not returned by the form definition APIs."},"queueTaskToProcess":{"type":"object","writeOnly":true,"description":"Task queue that a task is created in for each submission. Not returned by the form APIs.","properties":{"queueNameSpace":{"type":"string"},"queueName":{"type":"string"}}},"customSubmissionEvent":{"type":"object","writeOnly":true,"description":"Additional event sent when a form is submitted. Not returned by the form APIs.","properties":{"namespace":{"type":"string"},"name":{"type":"string"}}},"includeDataInSubmission":{"type":"boolean","writeOnly":true,"description":"Whether submitted data is included in the form-submitted event. Not returned by the form APIs."},"reviewConfiguration":{"type":"object","description":"Ordered form data fields shown as columns in the Form Admin submission and form lists.","additionalProperties":false,"properties":{"columns":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["path"],"properties":{"path":{"type":"string","description":"Dot-separated path of a leaf field in the form data schema.","minLength":1}}}},"questionsEmail":{"type":"string","description":"Address that applicant questions are forwarded to while no reviewer is part of the conversation. Not returned by the form APIs."}}},"dryRun":{"type":"boolean"},"intake":{"type":"object","readOnly":true,"nullable":true,"properties":{"urn":{"type":"string","description":"The urn of the form schedule intake"},"name":{"type":"string","description":"The description of the form schedule intake"},"description":{"type":"string","description":"The description of the form schedule intake"},"start":{"type":"string","format":"date-time","description":"The start date time of the form schedule intake"},"end":{"type":"string","format":"date-time","description":"The end date time of the form schedule intake"},"isAllDay":{"type":"boolean","description":"Is form schedule intake all day"},"isUpcoming":{"type":"boolean","description":"Is the form schedule intake upcoming"}}}},"example":{"id":"business-licence-application","revision":3,"name":"Business licence application","description":"Application for a municipal business licence.","anonymousApply":false,"oneFormPerApplicant":true,"applicantRoles":["business-licence-applicant"],"assessorRoles":["business-licence-assessor"],"clerkRoles":[],"formDraftUrlTemplate":"https://form.alberta.ca/business-licence-application/{{ id }}","dataSchema":{"type":"object","properties":{"businessName":{"type":"string"}},"required":["businessName"]},"uiSchema":{"type":"VerticalLayout","elements":[{"type":"Control","scope":"#/properties/businessName"}]},"dispositionStates":[{"id":"approved","name":"Approved","description":"Licence is approved."}],"generatesPdf":true,"submissionRecords":true,"scheduledIntakes":false,"supportTopic":false,"reviewConfiguration":{"columns":[{"path":"businessName"}]},"intake":null}},"FormDefinitionCreate":{"type":"object","description":"Payload for creating a new form definition. Only name and description are accepted; all other fields are set to defaults.","required":["name"],"properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"}},"additionalProperties":false,"example":{"name":"Business licence application","description":"Application for a municipal business licence."}},"FormDefinitionPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/FormDefinition"}},"page":{"$ref":"#/components/schemas/FormResultsPageInfo"}},"example":{"results":[{"id":"business-licence-application","revision":3,"name":"Business licence application","description":"Application for a municipal business licence.","anonymousApply":false,"applicantRoles":["business-licence-applicant"],"assessorRoles":["business-licence-assessor"],"clerkRoles":[],"created":"2026-09-14T16:20:00.000Z"}],"page":{"next":"MTA=","size":1,"total":24}}},"FormDefinitionPatch":{"type":"object","description":"Partial update payload for a form definition. Only provided fields will be updated; omitted fields will not be changed.","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"dataSchema":{"type":"object"},"uiSchema":{"type":"object"}},"additionalProperties":false,"example":{"description":"Application for a municipal business licence, including home-based businesses."}},"FormDeleteResult":{"type":"object","properties":{"deleted":{"type":"boolean"}},"example":{"deleted":true}},"FormDisposition":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"reason":{"type":"string"},"date":{"type":"string","format":"date-time"}}},"FormError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"FormPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Form"}},"page":{"$ref":"#/components/schemas/FormResultsPageInfo"}},"example":{"results":[{"urn":"urn:ads:platform:form-service:v1:/forms/5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","id":"5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","definition":{"id":"business-licence-application","name":"Business licence application"},"status":"submitted","created":"2026-10-02T15:04:05.000Z","createdBy":{"id":"0f9e8d7c-6b5a-4f3e-9d2c-1b0a9f8e7d6c","name":"Test User"},"submitted":"2026-10-03T09:30:00.000Z"}],"page":{"next":"MTA=","size":1,"total":312}}},"FormResultsPageInfo":{"type":"object","properties":{"after":{"type":"string","description":"Cursor of this page."},"next":{"type":"string","description":"Cursor of the next page. Not set on the last page."},"size":{"type":"number","description":"Number of results in this page."},"total":{"type":"number","description":"Total number of available results before filters are applied."}},"example":{"next":"MTA=","size":1,"total":24}},"FormSubmission":{"type":"object","properties":{"urn":{"type":"string"},"id":{"type":"string"},"formId":{"type":"string"},"formDefinitionId":{"type":"string"},"formDefinitionRevision":{"type":"number","description":"Revision of the form definition the form was submitted with."},"formData":{"type":"object"},"formFiles":{"type":"object","additionalProperties":{"type":"string"}},"securityClassification":{"type":"string","enum":["public","protected a","protected b","protected c"]},"hash":{"type":"string","description":"Hash of the submitted data."},"created":{"type":"string","format":"date-time"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"updatedBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"updated":{"type":"string","format":"date-time"},"disposition":{"$ref":"#/components/schemas/FormDisposition"},"notes":{"type":"array","items":{"$ref":"#/components/schemas/FormSubmissionNote"}}},"example":{"urn":"urn:ads:platform:form-service:v1:/submissions/6a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","id":"6a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","formId":"5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","formDefinitionId":"business-licence-application","formDefinitionRevision":3,"formData":{"businessName":"Example Bakery Ltd."},"formFiles":{},"securityClassification":"protected b","hash":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","created":"2026-10-03T09:30:00.000Z","createdBy":{"id":"0f9e8d7c-6b5a-4f3e-9d2c-1b0a9f8e7d6c","name":"Test User"},"updated":"2026-10-06T14:00:00.000Z","updatedBy":{"id":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","name":"Test Assessor"},"disposition":{"id":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","status":"Approved","reason":"Application meets all eligibility criteria.","date":"2026-10-06T14:00:00.000Z"},"notes":[{"id":"7b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e","content":"Called applicant to confirm their mailing address.","created":"2026-10-05T10:15:00.000Z","createdBy":{"id":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","name":"Test Assessor"}}]}},"FormSubmissionCriteria":{"type":"object","properties":{"createDateBefore":{"type":"string","format":"date-time"},"createDateAfter":{"type":"string","format":"date-time"},"dispositioned":{"type":"boolean"},"dispositionStatusEquals":{"type":"string"},"dispositionDateBefore":{"type":"string","format":"date-time"},"dispositionDateAfter":{"type":"string","format":"date-time"},"createdByIdEquals":{"type":"string"}}},"FormSubmissionNote":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"created":{"type":"string","format":"date-time"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"FormSubmissionPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/FormSubmission"}},"page":{"$ref":"#/components/schemas/FormResultsPageInfo"}},"example":{"results":[{"urn":"urn:ads:platform:form-service:v1:/submissions/6a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","id":"6a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","formId":"5f1e2d3c-4b5a-4f6e-8d7c-9b0a1c2d3e4f","formDefinitionId":"business-licence-application","formDefinitionRevision":3,"formData":{"businessName":"Example Bakery Ltd."},"created":"2026-10-03T09:30:00.000Z","createdBy":{"id":"0f9e8d7c-6b5a-4f3e-9d2c-1b0a9f8e7d6c","name":"Test User"},"disposition":null,"notes":[]}],"page":{"next":"MTAw","size":1,"total":87}}},"PutIntakeParameters":{"type":"object","description":"Payload for updating schedule intake","required":["name","calendarEventId","start","end"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"},"calendarEventId":{"type":"integer","description":"ID of the calendar service event for the intake period."}},"example":{"name":"Spring intake","calendarEventId":42,"start":"2026-10-01T15:00:00.000Z","end":"2026-10-31T23:00:00.000Z"}},"SendCodeOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["send-code"]}}},"SetToDraftOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["to-draft"]}}},"SubmitFormOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["submit"]},"dryRun":{"type":"boolean","description":"Validate and simulate the submission without saving it."}}},"UnlockFormOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["unlock"]}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Form","description":"API to managed forms."},{"name":"Form Submission","description":"API to review and disposition form submissions."},{"name":"Form schedules","description":"API to manage the scheduled intake periods of form definitions."}]}
@@ -0,0 +1,186 @@
1
+ [
2
+ {
3
+ "app": "agent-service",
4
+ "urn": "urn:ads:platform:agent-service",
5
+ "name": "Agent service",
6
+ "title": "Agent service",
7
+ "operations": 6,
8
+ "file": "agent-service.json"
9
+ },
10
+ {
11
+ "app": "audit-service",
12
+ "urn": "urn:ads:platform:audit-service",
13
+ "name": "Audit service",
14
+ "title": "Audit service",
15
+ "operations": 13,
16
+ "file": "audit-service.json"
17
+ },
18
+ {
19
+ "app": "cache-service",
20
+ "urn": "urn:ads:platform:cache-service",
21
+ "name": "Cache service",
22
+ "title": "Cache service",
23
+ "operations": 1,
24
+ "file": "cache-service.json"
25
+ },
26
+ {
27
+ "app": "calendar-service",
28
+ "urn": "urn:ads:platform:calendar-service",
29
+ "name": "Calendar service",
30
+ "title": "Calendar service",
31
+ "operations": 19,
32
+ "file": "calendar-service.json"
33
+ },
34
+ {
35
+ "app": "comment-service",
36
+ "urn": "urn:ads:platform:comment-service",
37
+ "name": "Comment service",
38
+ "title": "Comment service",
39
+ "operations": 16,
40
+ "file": "comment-service.json"
41
+ },
42
+ {
43
+ "app": "configuration-service",
44
+ "urn": "urn:ads:platform:configuration-service",
45
+ "name": "Configuration service",
46
+ "title": "Configuration service",
47
+ "operations": 9,
48
+ "file": "configuration-service.json"
49
+ },
50
+ {
51
+ "app": "directory-service",
52
+ "urn": "urn:ads:platform:directory-service",
53
+ "name": "Directory service",
54
+ "title": "Directory service",
55
+ "operations": 20,
56
+ "file": "directory-service.json"
57
+ },
58
+ {
59
+ "app": "event-service",
60
+ "urn": "urn:ads:platform:event-service",
61
+ "name": "Event service",
62
+ "title": "Event service",
63
+ "operations": 7,
64
+ "file": "event-service.json"
65
+ },
66
+ {
67
+ "app": "export-service",
68
+ "urn": "urn:ads:platform:export-service",
69
+ "name": "Export service",
70
+ "title": "Export service",
71
+ "operations": 2,
72
+ "file": "export-service.json"
73
+ },
74
+ {
75
+ "app": "feedback-service",
76
+ "urn": "urn:ads:platform:feedback-service",
77
+ "name": "Feedback service",
78
+ "title": "Feedback service",
79
+ "operations": 6,
80
+ "file": "feedback-service.json"
81
+ },
82
+ {
83
+ "app": "file-service",
84
+ "urn": "urn:ads:platform:file-service",
85
+ "name": "File service",
86
+ "title": "File service",
87
+ "operations": 9,
88
+ "file": "file-service.json"
89
+ },
90
+ {
91
+ "app": "form-service",
92
+ "urn": "urn:ads:platform:form-service",
93
+ "name": "Form service",
94
+ "title": "Form service",
95
+ "operations": 31,
96
+ "file": "form-service.json"
97
+ },
98
+ {
99
+ "app": "notification-service",
100
+ "urn": "urn:ads:platform:notification-service",
101
+ "name": "Notification service",
102
+ "title": "Notification service",
103
+ "operations": 22,
104
+ "file": "notification-service.json"
105
+ },
106
+ {
107
+ "app": "pdf-service",
108
+ "urn": "urn:ads:platform:pdf-service",
109
+ "name": "PDF service",
110
+ "title": "PDF Service",
111
+ "operations": 7,
112
+ "file": "pdf-service.json"
113
+ },
114
+ {
115
+ "app": "pii-service",
116
+ "urn": "urn:ads:platform:pii-service",
117
+ "name": "PII service",
118
+ "title": "PII Service",
119
+ "operations": 3,
120
+ "file": "pii-service.json"
121
+ },
122
+ {
123
+ "app": "project-planner-service",
124
+ "urn": "urn:ads:platform:project-planner-service",
125
+ "name": "Project planner service",
126
+ "title": "Project planner service",
127
+ "operations": 31,
128
+ "file": "project-planner-service.json"
129
+ },
130
+ {
131
+ "app": "push-service",
132
+ "urn": "urn:ads:platform:push-service",
133
+ "name": "Push service",
134
+ "title": "Push service",
135
+ "operations": 2,
136
+ "file": "push-service.json"
137
+ },
138
+ {
139
+ "app": "status-service",
140
+ "urn": "urn:ads:platform:status-service",
141
+ "name": "Status service",
142
+ "title": "Status service",
143
+ "operations": 17,
144
+ "file": "status-service.json"
145
+ },
146
+ {
147
+ "app": "task-service",
148
+ "urn": "urn:ads:platform:task-service",
149
+ "name": "Task service",
150
+ "title": "Task service",
151
+ "operations": 17,
152
+ "file": "task-service.json"
153
+ },
154
+ {
155
+ "app": "tenant-management-api",
156
+ "urn": "urn:ads:platform:tenant-service",
157
+ "name": "Tenant service",
158
+ "title": "Tenant management service",
159
+ "operations": 15,
160
+ "file": "tenant-management-api.json"
161
+ },
162
+ {
163
+ "app": "token-handler",
164
+ "urn": "urn:ads:platform:token-handler",
165
+ "name": "Token handler",
166
+ "title": "Token handler",
167
+ "operations": 13,
168
+ "file": "token-handler.json"
169
+ },
170
+ {
171
+ "app": "value-service",
172
+ "urn": "urn:ads:platform:value-service",
173
+ "name": "Value service",
174
+ "title": "Value service",
175
+ "operations": 14,
176
+ "file": "value-service.json"
177
+ },
178
+ {
179
+ "app": "verify-service",
180
+ "urn": "urn:ads:platform:verify-service",
181
+ "name": "Verify service",
182
+ "title": "Verify service",
183
+ "operations": 1,
184
+ "file": "verify-service.json"
185
+ }
186
+ ]
@@ -0,0 +1 @@
1
+ {"openapi":"3.0.0","info":{"title":"Notification service","version":"0.0.0","description":"The notification service provides the capability to define notification types and manage subscriptions."},"paths":{"/subscription/v1/contact":{"parameters":[{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Retrieves the tenant's support contact and from email for notifications. Requires the subscription-admin or configuration-admin role.\n","responses":{"200":{"description":"Contact successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationContact"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"}}},"patch":{"tags":["Subscription"],"description":"Updates the tenant's support contact and from email for notifications with the properties in the request. Requires the subscription-admin or configuration-admin role. An email property can be set to an empty string to clear it.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationContact"}}}},"responses":{"200":{"description":"Contact successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationContact"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"}}}},"/subscription/v1/subscribers":{"get":{"tags":["Subscription"],"description":"Retrieves subscribers of the tenant. Requires the subscription-admin role.","parameters":[{"name":"top","description":"Number of results to retrieve. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for page of results to retrieve.","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","description":"Email address of subscriber.","in":"query","required":false,"schema":{"type":"string"}},{"name":"sms","description":"SMS number of subscriber.","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","description":"Name (address as) of subscriber.","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","description":"Value matched against the name, email address, or SMS number of the subscriber; a subscriber matching any of them is included.","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortBy","description":"Column to sort results on. Defaults to name.","in":"query","required":false,"schema":{"type":"string","enum":["name","email","sms","verified","created","updated"]}},{"name":"sortDirection","description":"Direction to sort results in. Defaults to asc.","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"responses":{"200":{"description":"Subscribers successfully retrieved.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Subscriber"}},"page":{"allOf":[{"$ref":"#/components/schemas/SubscriptionPage"},{"type":"object","properties":{"total":{"type":"number","description":"Number of subscribers matching the criteria, across all pages."}}}]}}},"example":{"results":[{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","urn":"urn:ads:platform:notification-service:v1:/subscribers/63f5a0d2c9b1d2e3f4a5b6c7","id":"63f5a0d2c9b1d2e3f4a5b6c7","userId":"9c1f2b7e-4d3a-4f6b-8a2e-1b2c3d4e5f60","addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca","verified":true}],"created":"2026-09-01T17:00:00.000Z","updated":"2026-09-01T17:00:00.000Z"}],"page":{"after":"MTA=","size":1,"next":"MjA=","total":21}}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"}}},"post":{"tags":["Subscription"],"description":"Creates a subscriber. Users with the subscription-admin or subscription-app role can create any subscriber; other users can only create a subscriber for themselves.\n","parameters":[{"name":"userSub","description":"Flag indicating the subscriber is the current user. When true, the subscriber is created from the user's token (name and email) and the body is ignored.\n","in":"query","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"addressAs":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberChannel"}}}},"example":{"addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca"}]}}}},"responses":{"200":{"description":"Subscriber successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"}}}},"/subscription/v1/subscribers/my-subscriber":{"parameters":[{"name":"includeSubscriptions","description":"Flag indicating whether to include subscriptions or not.","in":"query","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Retrieves the subscriber of the current user, along with their current subscriptions if requested. Available to any authenticated user.\n","responses":{"200":{"description":"User subscriber and subscriptions information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MySubscriberDetails"}}}},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/subscribers/{subscriber}":{"parameters":[{"$ref":"#/components/parameters/SubscriberId"},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Retrieves a subscriber. Users with the subscription-admin or subscription-app role can retrieve any subscriber of the tenant; other users can only retrieve their own subscriber.\n","parameters":[{"name":"includeSubscriptions","description":"Flag indicating whether to include subscriptions or not.","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Subscriber successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"patch":{"tags":["Subscription"],"description":"Updates a subscriber. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addressAs":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberChannel"}}}},"example":{"addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca"},{"channel":"sms","address":"7805551234"}]}}}},"responses":{"200":{"description":"Subscriber successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriber"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"post":{"tags":["Subscription"],"description":"Executes a subscriber operation to send or check a verification code for a channel. Same permissions as retrieving the subscriber. Users with the code-sender role can also send and check codes (but not verify the channel) for any subscriber of the tenant.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SendVerifyCodeOperation"},{"$ref":"#/components/schemas/SendVerifyCodeWithLinkOperation"},{"$ref":"#/components/schemas/VerifyChannelOperation"},{"$ref":"#/components/schemas/CheckCodeOperation"}],"discriminator":{"propertyName":"operation","mapping":{"send-code":"#/components/schemas/SendVerifyCodeOperation","send-code-with-link":"#/components/schemas/SendVerifyCodeWithLinkOperation","check-code":"#/components/schemas/CheckCodeOperation","verify-channel":"#/components/schemas/VerifyChannelOperation"}}},"examples":{"send-code":{"summary":"Send a verification code","value":{"operation":"send-code","channel":"email","address":"test.user@gov.ab.ca","reason":"Verify your email address."}},"send-code-with-link":{"summary":"Send a verification code with a link","value":{"operation":"send-code-with-link","channel":"email","address":"test.user@gov.ab.ca","reason":"Verify your email address.","expireIn":30,"verificationLink":"https://my-app.alberta.ca/verify"}},"check-code":{"summary":"Check a code without verifying the channel","value":{"operation":"check-code","channel":"email","address":"test.user@gov.ab.ca","code":"123456"}},"verify-channel":{"summary":"Verify the channel with the code","value":{"operation":"verify-channel","channel":"email","address":"test.user@gov.ab.ca","code":"123456"}}}}}},"responses":{"200":{"description":"Subscriber operation successfully executed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"verified":{"type":"boolean"}}},{"type":"object","properties":{"sent":{"type":"boolean"}}}]},"example":{"sent":true}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"delete":{"tags":["Subscription"],"description":"Deletes a subscriber. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber.\n","responses":{"200":{"description":"Subscriber successfully deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/subscribers/{subscriber}/subscriptions":{"parameters":[{"$ref":"#/components/parameters/SubscriberId"},{"name":"top","description":"Number of results to retrieve. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for page of results to retrieve.","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Retrieves subscriptions for a subscriber. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber.\n","responses":{"200":{"description":"Subscriptions successfully retrieved.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MySubscriberSubscriptions"}},"page":{"$ref":"#/components/schemas/SubscriptionPage"}}},"example":{"results":[{"typeId":"application-status","subscriberId":"63f5a0d2c9b1d2e3f4a5b6c7","type":{"id":"application-status","name":"Application status","description":"Notifications about changes to an application.","manageSubscribe":true,"publicSubscribe":false,"channels":["email"]},"criteria":{"correlationId":"application-1234"}}],"page":{"size":1}}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/subscribers/{subscriber}/types/{type}/channels":{"parameters":[{"$ref":"#/components/parameters/SubscriberId"},{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Retrieves the channels of the subscriber that the notification type can send to, for the subscriber's subscription to that type. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber.\n","responses":{"200":{"description":"Channels successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberChannel"}}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/types":{"get":{"tags":["Subscription"],"description":"Retrieves notification types available to subscribe to. Available to any authenticated user. Includes the platform notification types and the types configured by the tenant; a tenant type with the same ID as a platform type replaces it. With the source parameter, retrieves the type definitions as configured instead, which requires the subscription-admin or configuration-admin role.\n","parameters":[{"$ref":"#/components/parameters/SubscriptionTenantId"},{"name":"source","description":"Retrieve the definitions configured by the tenant (tenant) or the platform (core) instead of the combined types. Tenant definitions with the ID of a platform type are customizations of that type's templates.\n","in":"query","required":false,"schema":{"type":"string","enum":["tenant","core"]}}],"responses":{"200":{"description":"Notification types successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NotificationTypeDefinition"}}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"}}},"post":{"tags":["Subscription"],"description":"Creates a notification type for the tenant. Requires the subscription-admin or configuration-admin role. The definition is validated, including its channels, trigger events, and templates.\n","parameters":[{"$ref":"#/components/parameters/SubscriptionTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTypeDefinition"}}}},"responses":{"201":{"description":"Notification type successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTypeDefinition"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"409":{"$ref":"#/components/responses/SubscriptionConflict"}}}},"/subscription/v1/types/{type}":{"get":{"tags":["Subscription"],"description":"Retrieves a notification type. Available to any authenticated user.","parameters":[{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"responses":{"200":{"description":"Notification type successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationType"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"patch":{"tags":["Subscription"],"description":"Updates a notification type of the tenant with the properties in the request. Requires the subscription-admin or configuration-admin role. Updating a platform type saves a tenant customization of it, where only the event templates apply. The updated definition is validated, including its channels, trigger events, and templates.\n","parameters":[{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTypeDefinition"},"examples":{"rename":{"summary":"Update properties of a tenant type","value":{"name":"Application progress","subscriberRoles":["applicant","reviewer"]}},"customize-template":{"summary":"Customize the email template of a platform type","value":{"events":[{"namespace":"status-service","name":"health-check-started","templates":{"email":{"subject":"{{ event.payload.application.name }} is being monitored","body":"<p>Health checks started for {{ event.payload.application.name }}.</p>"}}}]}}}}}},"responses":{"200":{"description":"Notification type successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTypeDefinition"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"delete":{"tags":["Subscription"],"description":"Deletes a notification type of the tenant. Requires the subscription-admin or configuration-admin role. Platform types can't be deleted; deleting the tenant customization of a platform type reverts it to the platform templates. Existing subscriptions to the type are not removed.\n","parameters":[{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"responses":{"200":{"description":"Notification type successfully deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/types/{type}/subscriptions":{"parameters":[{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Retrieves subscriptions for a notification type. Requires the subscription-admin or subscription-app role.","parameters":[{"name":"top","description":"Number of results to retrieve. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for page of results to retrieve.","in":"query","required":false,"schema":{"type":"string"}},{"name":"subscriberCriteria","description":"Criteria for the subscriber of the subscription.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}}}}}},{"name":"subscriptionMatch","description":"Criteria for the subscription criteria.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"correlationId":{"type":"string"},"context":{"type":"object","additionalProperties":true}}}}}}],"responses":{"200":{"description":"Subscriptions successfully retrieved.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"page":{"$ref":"#/components/schemas/SubscriptionPage"}}},"example":{"results":[{"typeId":"application-status","subscriberId":"63f5a0d2c9b1d2e3f4a5b6c7","subscriber":{"id":"63f5a0d2c9b1d2e3f4a5b6c7","addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca","verified":true}]},"criteria":{"correlationId":"application-1234"}}],"page":{"after":"MTA=","size":1,"next":"MjA="}}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"post":{"tags":["Subscription"],"description":"Creates a subscription for a notification type, creating the subscriber first if it does not exist. Users with the subscription-admin or subscription-app role can subscribe anyone. Other users can only subscribe themselves, and only when the type allows users to manage their own subscription and is public or the user has one of the type's subscriber roles.\n","parameters":[{"name":"userSub","description":"Flag indicating the subscription is for the current user. When true, the subscriber is created from the user's token (name and email) and only the criteria property of the body is used.\n","in":"query","required":false,"schema":{"type":"boolean"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"criteria":{"$ref":"#/components/schemas/SubscriptionCriteria"},"id":{"type":"string","description":"ID of an existing subscriber to subscribe."},"userId":{"type":"string","description":"User ID of the subscriber; an existing subscriber for the user is reused."},"addressAs":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberChannel"}}}},"examples":{"self":{"summary":"Current user (with userSub=true)","value":{"criteria":{"correlationId":"application-1234"}}},"other":{"summary":"New subscriber (subscription admin)","value":{"addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca"}]}}}}}},"responses":{"200":{"description":"Subscription successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/types/{type}/subscriptions/{subscriber}":{"parameters":[{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriberId"},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"get":{"tags":["Subscription"],"description":"Gets a subscription for a notification type and subscriber. Requires the subscription-admin role. Responds with null if the subscriber is not subscribed to the type.\n","responses":{"200":{"description":"Subscription successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"post":{"tags":["Subscription"],"description":"Adds or updates the subscription of a subscriber to the notification type. If a subscription exists, its criteria are replaced; otherwise a new subscription is created, which requires a single criteria object. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber, and only when the type allows users to manage their own subscription and is public or the user has one of the type's subscriber roles. Responds 403 when updating an existing subscription without permission, and 401 when creating one.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["criteria"],"properties":{"criteria":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionCriteria"},{"type":"array","minItems":1,"maxItems":200,"items":{"$ref":"#/components/schemas/SubscriptionCriteria"}}]}}},"example":{"criteria":[{"correlationId":"application-1234"},{"correlationId":"application-5678"}]}}}},"responses":{"200":{"description":"Subscription successfully added or updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}},"delete":{"tags":["Subscription"],"description":"Removes a subscription from a notification type. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber, and only when the type allows users to manage their own subscription and is public or the user has one of the type's subscriber roles. Responds 401 when the user is not permitted to remove the subscription, and with deleted false if the subscriber or subscription does not exist.\n","responses":{"200":{"description":"Subscription removal processed.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}},"/subscription/v1/types/{type}/subscriptions/{subscriber}/criteria":{"parameters":[{"name":"type","description":"ID of the notification type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50}},{"$ref":"#/components/parameters/SubscriberId"},{"name":"criteria","description":"JSON encoded criteria for deletion of subscription criteria. Must be valid JSON. Deletion criteria can match multiple subscription criteria. The subscription is deleted when its last criteria is removed.\n","in":"query","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCriteria"},"example":{"correlationId":"application-1234"}}}},{"$ref":"#/components/parameters/SubscriptionTenantId"}],"delete":{"tags":["Subscription"],"description":"Removes a subscription criteria. Users with the subscription-admin or subscription-app role can act on any subscriber of the tenant; other users can only act on their own subscriber, and only when the type allows users to manage their own subscription and is public or the user has one of the type's subscriber roles.\n","responses":{"200":{"description":"Subscription criteria removal processed.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/SubscriptionBadRequest"},"401":{"$ref":"#/components/responses/SubscriptionUnauthorized"},"403":{"$ref":"#/components/responses/SubscriptionForbidden"},"404":{"$ref":"#/components/responses/SubscriptionNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"SubscriberId":{"name":"subscriber","description":"ID of the subscriber.","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"example":"63f5a0d2c9b1d2e3f4a5b6c7"},"SubscriptionTenantId":{"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. Core users must set it, since operations are scoped to a tenant; only operations on a specific subscriber can find the subscriber without it.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"SubscriptionBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionError"},"example":{"errorMessage":"Validation failed with error(s): subscriber (params) - Invalid value"}}}},"SubscriptionConflict":{"description":"A notification type with the ID already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionError"},"example":{"errorMessage":"Notification type with ID 'application-status' already exists."}}}},"SubscriptionForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to get subscribers."}}}},"SubscriptionNotFound":{"description":"Notification type or subscriber not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionError"},"example":{"errorMessage":"Subscriber with ID '63f5a0d2c9b1d2e3f4a5b6c7' could not be found."}}}},"SubscriptionUnauthorized":{"description":"Request does not include a valid bearer token, or the user is not permitted to act on the subscriber or subscription.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionError"},"example":{"errorMessage":"User not authorized to update subscriber."}}}}},"schemas":{"CheckCodeOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["check-code"]},"channel":{"type":"string","enum":["email","sms","bot"]},"address":{"type":"string"},"code":{"type":"string"}},"required":["operation","channel","address","code"]},"MySubscriberDetails":{"type":"object","properties":{"tenantId":{"type":"string"},"urn":{"type":"string"},"id":{"type":"string"},"userId":{"type":"string"},"addressAs":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberChannel"}},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/MySubscriberSubscriptions"}},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}},"example":{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","urn":"urn:ads:platform:notification-service:v1:/subscribers/63f5a0d2c9b1d2e3f4a5b6c7","id":"63f5a0d2c9b1d2e3f4a5b6c7","userId":"9c1f2b7e-4d3a-4f6b-8a2e-1b2c3d4e5f60","addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca","verified":true}],"subscriptions":[{"typeId":"application-status","subscriberId":"63f5a0d2c9b1d2e3f4a5b6c7","type":{"id":"application-status","name":"Application status","description":"Notifications about changes to an application."},"criteria":{"correlationId":"application-1234"}}],"created":"2026-09-01T17:00:00.000Z","updated":"2026-09-01T17:00:00.000Z"}},"MySubscriberSubscriptions":{"type":"object","properties":{"typeId":{"type":"string"},"subscriberId":{"type":"string"},"type":{"$ref":"#/components/schemas/NotificationType"},"criteria":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionCriteria"},{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionCriteria"}}]}},"example":{"typeId":"application-status","subscriberId":"63f5a0d2c9b1d2e3f4a5b6c7","type":{"id":"application-status","name":"Application status","description":"Notifications about changes to an application.","manageSubscribe":true,"publicSubscribe":false,"channels":["email"]},"criteria":[{"correlationId":"application-1234"}]}},"NotificationContact":{"type":"object","properties":{"contactEmail":{"type":"string","description":"Support email shown to subscribers."},"phoneNumber":{"type":"string","description":"Support phone number shown to subscribers."},"supportInstructions":{"type":"string","description":"Support instructions shown to subscribers."},"fromEmail":{"type":"string","description":"Address that email notifications of the tenant are sent from."}},"example":{"contactEmail":"support@example.com","phoneNumber":"7805550100","supportInstructions":"Contact us during business hours.","fromEmail":"noreply@example.com"}},"NotificationType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"manageSubscribe":{"type":"boolean","description":"Indicates that users can manage their own subscription to the type."},"publicSubscribe":{"type":"boolean","description":"Indicates that any authenticated user of the tenant can subscribe, regardless of subscriberRoles."},"subscriberRoles":{"type":"array","description":"Roles a user needs to subscribe themselves when the type is not public.","items":{"type":"string"}},"channels":{"type":"array","items":{"type":"string","enum":["email","sms","bot","mail"]}},"events":{"type":"array","items":{"type":"object","properties":{"namespace":{"type":"string"},"name":{"type":"string"},"templates":{"type":"object","description":"Templates by channel; a channel's template can be null when the event does not use it.","properties":{"email":{"$ref":"#/components/schemas/Template"},"bot":{"$ref":"#/components/schemas/Template"},"sms":{"$ref":"#/components/schemas/Template"},"mail":{"$ref":"#/components/schemas/Template"}}}}}}},"example":{"id":"application-status","name":"Application status","description":"Notifications about changes to an application.","manageSubscribe":true,"publicSubscribe":false,"subscriberRoles":["applicant"],"channels":["email"],"events":[{"namespace":"application-service","name":"application-status-changed","templates":{"email":{"subject":"Your application status changed","body":"<p>Your application is now {{ event.payload.status }}.</p>"}}}]}},"NotificationTypeDefinition":{"description":"Notification type as configured, including the settings for types that send to an address instead of to subscribers.\n","allOf":[{"$ref":"#/components/schemas/NotificationType"},{"type":"object","required":["id","name","publicSubscribe","subscriberRoles","channels","events"],"properties":{"address":{"type":"string","description":"Address to send to instead of to subscribers."},"addressPath":{"type":"string","description":"Path in the event payload of the address to send to instead of to subscribers."},"ccPath":{"type":"string"},"bccPath":{"type":"string"},"attachmentPath":{"type":"string"},"subjectPath":{"type":"string"},"titlePath":{"type":"string"},"subTitlePath":{"type":"string"}}}],"example":{"id":"application-status","name":"Application status","description":"Notifications about changes to an application.","manageSubscribe":true,"publicSubscribe":false,"subscriberRoles":["applicant"],"channels":["email"],"events":[{"namespace":"application-service","name":"application-status-changed","templates":{"email":{"subject":"Your application status changed","body":"<p>Your application is now {{ event.payload.status }}.</p>"}}}]}},"SendVerifyCodeOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["send-code"]},"channel":{"type":"string","enum":["email","sms","bot"]},"address":{"type":"string"},"reason":{"type":"string"}},"required":["operation","channel","address"]},"SendVerifyCodeWithLinkOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["send-code-with-link"]},"channel":{"type":"string","enum":["email","sms","bot"]},"address":{"type":"string"},"reason":{"type":"string"},"expireIn":{"type":"number","description":"Number of minutes before the code expires."},"verificationLink":{"type":"string","description":"Link included in the message, for example to a page where the user enters the code."}},"required":["operation","channel","address"]},"Subscriber":{"type":"object","properties":{"tenantId":{"type":"string","readOnly":true},"urn":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"userId":{"type":"string"},"addressAs":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/SubscriberChannel"}},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"created":{"type":"string","format":"date-time","readOnly":true},"updated":{"type":"string","format":"date-time","readOnly":true}},"example":{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","urn":"urn:ads:platform:notification-service:v1:/subscribers/63f5a0d2c9b1d2e3f4a5b6c7","id":"63f5a0d2c9b1d2e3f4a5b6c7","userId":"9c1f2b7e-4d3a-4f6b-8a2e-1b2c3d4e5f60","addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca","verified":true}],"created":"2026-09-01T17:00:00.000Z","updated":"2026-09-01T17:00:00.000Z"}},"SubscriberChannel":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms","bot","mail"]},"address":{"type":"string"},"verified":{"type":"boolean","readOnly":true},"pendingVerification":{"type":"boolean","readOnly":true},"timeCodeSent":{"type":"number","readOnly":true}},"example":{"channel":"email","address":"test.user@gov.ab.ca","verified":true}},"Subscription":{"type":"object","properties":{"typeId":{"type":"string"},"subscriberId":{"type":"string"},"subscriber":{"$ref":"#/components/schemas/Subscriber"},"criteria":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionCriteria"},{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionCriteria"}}]}},"example":{"typeId":"application-status","subscriberId":"63f5a0d2c9b1d2e3f4a5b6c7","subscriber":{"id":"63f5a0d2c9b1d2e3f4a5b6c7","addressAs":"Test User","channels":[{"channel":"email","address":"test.user@gov.ab.ca","verified":true}]},"criteria":{"correlationId":"application-1234"}}},"SubscriptionCriteria":{"type":"object","properties":{"description":{"type":"string"},"correlationId":{"type":"string"},"context":{"type":"object","additionalProperties":true}},"example":{"description":"Updates on application 1234","correlationId":"application-1234","context":{"applicationId":"1234"}}},"SubscriptionError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"SubscriptionPage":{"type":"object","properties":{"after":{"type":"string"},"size":{"type":"number"},"next":{"type":"string"}},"example":{"after":"MTA=","size":10,"next":"MjA="}},"Template":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"}}},"VerifyChannelOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["verify-channel"]},"channel":{"type":"string","enum":["email","sms","bot"]},"address":{"type":"string"},"code":{"type":"string"}},"required":["operation","channel","address","code"]}}},"security":[{"accessToken":[]}],"tags":[{"name":"Subscription","description":"API to managed subscribers and subscriptions."},{"name":"Provider","description":"API to managed notification providers."}]}