@abgov/adsp-sdk-mcp-server 1.40.1 → 1.42.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.
@@ -1 +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, or the latest revision if none is set as active. Use `latest` to read the latest revision, which can include changes that are not active yet; this requires the form-service admin role, always reads from configuration service, and doesn't include the scheduled intake (`intake` is null).\n","in":"query","required":false,"schema":{"oneOf":[{"type":"integer","minimum":0},{"type":"string","enum":["latest"]}]},"example":"latest"},{"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}/access-requests":{"post":{"tags":["Form registration"],"description":"Submits a request for access to a restricted form. Requires the `form-access-requester` role (`urn:ads:platform:form-service:form-access-requester`) or the `form-admin` role; core users with either role must set `tenantId`. If the form definition doesn't have registration enabled yet, the request enables it by setting `registration.enabled` to true in the latest revision of the definition. The registration is created with status `pending`. Only one pending registration is allowed per email address and form.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationCreate"}}}},"responses":{"201":{"description":"Successfully submitted the access request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationSubmitted"}}}},"400":{"description":"Request is invalid, the answers don't match the registration questions, or the request has no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Validation failed with error(s): email (body) - Invalid value"}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"},"409":{"description":"A pending access request already exists for this email address and form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"A pending registration already exists for this email address and form."}}}}}},"get":{"tags":["Form registration"],"description":"Retrieves the access requests of a form definition, newest first. Requires the `form-access-reader`, `form-access-writer` or `form-admin` role; core users with any of these roles must set `tenantId`. Only requests of the caller's tenant are returned.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"},{"name":"status","description":"Only return requests with this status.","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","denied"]}},{"name":"top","description":"Maximum number of results to return. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor of the page to return, from the next value of the previous page.","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the access requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationPage"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}},"delete":{"tags":["Form registration"],"description":"Removes the registration settings from the latest revision of a form definition, so the form no longer accepts access requests. Existing access requests are kept. Requires the `form-admin` role; core users with the role must set `tenantId`. A definition without registration settings also responds 204.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"204":{"description":"Successfully removed the registration settings."},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/definitions/{definitionId}/access-requests/{id}":{"get":{"tags":["Form registration"],"description":"Retrieves the latest access request for an email address. Users can retrieve their own request (matching the email of their token); retrieving the request of another email address requires the `form-access-reader`, `form-access-writer` or `form-admin` role. Core users must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"name":"id","description":"Email address of the applicant. Matched without regard to case.","in":"path","required":true,"schema":{"type":"string","format":"email"},"example":"test.user@gov.ab.ca"},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"200":{"description":"Successfully retrieved the access request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistration"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"description":"Form definition not found, or there is no access request for the email address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"registration with ID 'test.user@gov.ab.ca' could not be found."}}}}}},"patch":{"tags":["Form registration"],"description":"Approves or denies a pending access request, and records the reviewing administrator and the review time. Requires the `form-access-writer` or `form-admin` role; core users with either role must set `tenantId`. Requests that are no longer pending respond 409. Requests of another tenant or form definition respond 404.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"name":"id","description":"ID of the access request.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationReview"}}}},"responses":{"200":{"description":"Successfully updated the access request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistration"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"description":"Form definition or access request not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"registration with ID '6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01' could not be found."}}}},"409":{"description":"The access request has already been approved or denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Registration has already been approved."}}}}}}},"/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."}}},"registration":{"type":"object","description":"Restricts the form to approved users. When enabled, users submit an access request answering the registration questions, and an administrator approves or denies it.\n","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean","description":"Whether the form is restricted and accepts access requests. Defaults to false."},"accessGroup":{"type":"string","writeOnly":true,"minLength":1,"maxLength":255,"description":"Keycloak group containing the roles needed to access the form. Not returned by the form APIs.\n"},"dataSchema":{"type":"object","description":"JSON schema (draft-07) of the registration questions. Must not define firstName, lastName or email, which are standard fields of every access request.\n"},"uiSchema":{"type":"object","description":"Layout of the registration questions."}}},"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"}]},"registration":{"enabled":false},"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"},"registration":{"type":"object","description":"Access request settings, merged into the existing settings. Omitted properties keep their current value, and enabled defaults to false for definitions that have no registration settings yet.\n","additionalProperties":false,"properties":{"enabled":{"type":"boolean","description":"Whether the form is restricted and accepts access requests."},"accessGroup":{"type":"string","writeOnly":true,"minLength":1,"maxLength":255,"description":"Keycloak group containing the roles needed to access the form. Not returned by the form APIs.\n"},"dataSchema":{"type":"object","description":"JSON schema (draft-07) of the registration questions. Must not define firstName, lastName or email, which are standard fields of every access request.\n"},"uiSchema":{"type":"object","description":"Layout of the registration questions."}}}},"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}}},"FormRegistration":{"type":"object","description":"A request for access to a restricted form.","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"formDefinitionId":{"type":"string","readOnly":true},"status":{"type":"string","enum":["pending","approved","denied"],"readOnly":true},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email","description":"Email address of the applicant, stored in lower case."},"data":{"type":"object","description":"Answers to the registration questions of the form definition."},"submittedAt":{"type":"string","format":"date-time","readOnly":true},"reviewedAt":{"type":"string","format":"date-time","nullable":true,"readOnly":true,"description":"Date the request was approved or denied."},"reviewedBy":{"type":"object","nullable":true,"readOnly":true,"description":"Administrator who approved or denied the request.","properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"example":{"id":"6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01","formDefinitionId":"medical-intake","status":"approved","firstName":"Test","lastName":"User","email":"test.user@gov.ab.ca","data":{"profession":"physician","registrationNumber":"12345"},"submittedAt":"2026-11-12T16:00:00.000Z","reviewedAt":"2026-11-13T09:30:00.000Z","reviewedBy":{"id":"1c0fa56b-f818-4cc7-9254-7513aecb5d9f","name":"Admin User"}}},"FormRegistrationCreate":{"type":"object","additionalProperties":false,"required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"email":{"type":"string","format":"email","maxLength":254},"data":{"type":"object","description":"Answers to the registration questions. Validated against the registration data schema of the form definition; properties the schema does not define respond 400.\n"}},"example":{"firstName":"Test","lastName":"User","email":"test.user@gov.ab.ca","data":{"profession":"physician","registrationNumber":"12345"}}},"FormRegistrationPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/FormRegistration"}},"page":{"$ref":"#/components/schemas/FormResultsPageInfo"}}},"FormRegistrationReview":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["pending","approved","denied"]}},"example":{"status":"approved"}},"FormRegistrationSubmitted":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"formDefinitionId":{"type":"string"},"status":{"type":"string","enum":["pending"]},"submittedAt":{"type":"string","format":"date-time"}},"example":{"id":"6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01","formDefinitionId":"medical-intake","status":"pending","submittedAt":"2026-11-12T16:00:00.000Z"}},"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."},{"name":"Form registration","description":"API to request access to restricted forms and to approve or deny those requests."}]}
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, or the latest revision if none is set as active. Use `latest` to read the latest revision, which can include changes that are not active yet; this requires the form-service admin role, always reads from configuration service, and doesn't include the scheduled intake (`intake` is null).\n","in":"query","required":false,"schema":{"oneOf":[{"type":"integer","minimum":0},{"type":"string","enum":["latest"]}]},"example":"latest"},{"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}/access-requests":{"post":{"tags":["Form registration"],"description":"Submits a request for access to a restricted form. Requires the `form-access-requester` role (`urn:ads:platform:form-service:form-access-requester`) or the `form-admin` role; core users with either role must set `tenantId`. If the form definition doesn't have registration enabled yet, the request enables it by setting `registration.enabled` to true in the latest revision of the definition. The registration is created with status `pending`. Only one pending registration is allowed per email address and form.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationCreate"}}}},"responses":{"201":{"description":"Successfully submitted the access request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationSubmitted"}}}},"400":{"description":"Request is invalid, the answers don't match the registration questions, or the request has no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Validation failed with error(s): email (body) - Invalid value"}}}},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"},"409":{"description":"A pending access request already exists for this email address and form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"A pending registration already exists for this email address and form."}}}}}},"get":{"tags":["Form registration"],"description":"Retrieves the access requests of a form definition, newest first. Requires the `form-access-reader`, `form-access-writer` or `form-admin` role; core users with any of these roles must set `tenantId`. Only requests of the caller's tenant are returned.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"},{"name":"status","description":"Only return requests with this status.","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","denied"]}},{"name":"top","description":"Maximum number of results to return. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor of the page to return, from the next value of the previous page.","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the access requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationPage"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}},"delete":{"tags":["Form registration"],"description":"Removes the registration settings from the latest revision of a form definition, so the form no longer accepts access requests, and permanently deletes all access requests of the definition. Requires the `form-admin` role; core users with the role must set `tenantId`. A definition without registration settings also responds 204, and its access requests are still deleted.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"204":{"description":"Successfully removed the registration settings and deleted the access requests."},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"$ref":"#/components/responses/FormDefinitionNotFound"}}}},"/form/v1/definitions/{definitionId}/access-requests/{id}":{"get":{"tags":["Form registration"],"description":"Retrieves the latest access request for an email address. Users can retrieve their own request (matching the email of their token); retrieving the request of another email address requires the `form-access-reader`, `form-access-writer` or `form-admin` role. Core users must set `tenantId`.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"name":"id","description":"Email address of the applicant. Matched without regard to case.","in":"path","required":true,"schema":{"type":"string","format":"email"},"example":"test.user@gov.ab.ca"},{"$ref":"#/components/parameters/FormTenantId"}],"responses":{"200":{"description":"Successfully retrieved the access request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistration"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"description":"Form definition not found, or there is no access request for the email address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"registration with ID 'test.user@gov.ab.ca' could not be found."}}}}}},"patch":{"tags":["Form registration"],"description":"Approves or denies a pending access request, and records the reviewing administrator and the review time. Requires the `form-access-writer` or `form-admin` role; core users with either role must set `tenantId`. Requests that are no longer pending respond 409. Requests of another tenant or form definition respond 404.\n","parameters":[{"$ref":"#/components/parameters/FormDefinitionIdPath"},{"name":"id","description":"ID of the access request.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01"},{"$ref":"#/components/parameters/FormTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistrationReview"}}}},"responses":{"200":{"description":"Successfully updated the access request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRegistration"}}}},"400":{"$ref":"#/components/responses/FormBadRequest"},"401":{"$ref":"#/components/responses/FormUnauthorized"},"403":{"$ref":"#/components/responses/FormForbidden"},"404":{"description":"Form definition or access request not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"registration with ID '6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01' could not be found."}}}},"409":{"description":"The access request has already been approved or denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormError"},"example":{"errorMessage":"Registration has already been approved."}}}}}}},"/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."}}},"registration":{"type":"object","description":"Restricts the form to approved users. When enabled, users submit an access request answering the registration questions, and an administrator approves or denies it.\n","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean","description":"Whether the form is restricted and accepts access requests. Defaults to false."},"accessGroup":{"type":"string","writeOnly":true,"minLength":1,"maxLength":255,"description":"Keycloak group containing the roles needed to access the form. Not returned by the form APIs.\n"},"dataSchema":{"type":"object","description":"JSON schema (draft-07) of the registration questions. Must not define firstName, lastName or email, which are standard fields of every access request.\n"},"uiSchema":{"type":"object","description":"Layout of the registration questions."}}},"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"}]},"registration":{"enabled":false},"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"},"registration":{"type":"object","description":"Access request settings, merged into the existing settings. Omitted properties keep their current value, and enabled defaults to false for definitions that have no registration settings yet.\n","additionalProperties":false,"properties":{"enabled":{"type":"boolean","description":"Whether the form is restricted and accepts access requests."},"accessGroup":{"type":"string","writeOnly":true,"minLength":1,"maxLength":255,"description":"Keycloak group containing the roles needed to access the form. Not returned by the form APIs.\n"},"dataSchema":{"type":"object","description":"JSON schema (draft-07) of the registration questions. Must not define firstName, lastName or email, which are standard fields of every access request.\n"},"uiSchema":{"type":"object","description":"Layout of the registration questions."}}}},"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}}},"FormRegistration":{"type":"object","description":"A request for access to a restricted form.","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"formDefinitionId":{"type":"string","readOnly":true},"status":{"type":"string","enum":["pending","approved","denied"],"readOnly":true},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email","description":"Email address of the applicant, stored in lower case."},"data":{"type":"object","description":"Answers to the registration questions of the form definition."},"submittedAt":{"type":"string","format":"date-time","readOnly":true},"reviewedAt":{"type":"string","format":"date-time","nullable":true,"readOnly":true,"description":"Date the request was approved or denied."},"reviewedBy":{"type":"object","nullable":true,"readOnly":true,"description":"Administrator who approved or denied the request.","properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"example":{"id":"6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01","formDefinitionId":"medical-intake","status":"approved","firstName":"Test","lastName":"User","email":"test.user@gov.ab.ca","data":{"profession":"physician","registrationNumber":"12345"},"submittedAt":"2026-11-12T16:00:00.000Z","reviewedAt":"2026-11-13T09:30:00.000Z","reviewedBy":{"id":"1c0fa56b-f818-4cc7-9254-7513aecb5d9f","name":"Admin User"}}},"FormRegistrationCreate":{"type":"object","additionalProperties":false,"required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"email":{"type":"string","format":"email","maxLength":254},"data":{"type":"object","description":"Answers to the registration questions. Validated against the registration data schema of the form definition; properties the schema does not define respond 400.\n"}},"example":{"firstName":"Test","lastName":"User","email":"test.user@gov.ab.ca","data":{"profession":"physician","registrationNumber":"12345"}}},"FormRegistrationPage":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/FormRegistration"}},"page":{"$ref":"#/components/schemas/FormResultsPageInfo"}}},"FormRegistrationReview":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["pending","approved","denied"]}},"example":{"status":"approved"}},"FormRegistrationSubmitted":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"formDefinitionId":{"type":"string"},"status":{"type":"string","enum":["pending"]},"submittedAt":{"type":"string","format":"date-time"}},"example":{"id":"6f1c2a9e-3b4d-4c8e-9a2f-1d5e7b8c9a01","formDefinitionId":"medical-intake","status":"pending","submittedAt":"2026-11-12T16:00:00.000Z"}},"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."},{"name":"Form registration","description":"API to request access to restricted forms and to approve or deny those requests."}]}
@@ -1 +1 @@
1
- {"openapi":"3.0.0","info":{"title":"Tenant management service","version":"0.0.0","description":"The tenant management service includes APIs for common platform capabilities like retrieving tenant information."},"paths":{"/api/tenant/v1":{"post":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use POST /api/tenant/v2/tenants, which shares this endpoint's implementation but also validates the name length and characters. Creates a tenant. Requires the core realm beta-tester or tenant-service-admin role; tenant users are rejected even with those roles.\n\nBy default a new realm is created for the tenant, with the current user as the administrator; the response is sent with status 202 while the realm is provisioned. Users with the tenant-service-admin role can instead set realm to associate the tenant with an existing realm, in which case adminEmail is required and the response is sent with status 200. Only tenant-service-admin users can set realm or adminEmail.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the tenant. Must be unique (ignoring case) and must not contain special characters such as ! & % - or /.\n"},"realm":{"type":"string","description":"Existing realm to associate with the tenant. Requires the tenant-service-admin role."},"adminEmail":{"type":"string","format":"email","description":"Email of the tenant administrator. Requires the tenant-service-admin role."}}},"examples":{"newRealm":{"summary":"Create a tenant with a new realm","value":{"name":"Test Tenant"}},"existingRealm":{"summary":"Associate an existing realm (tenant-service-admin only)","value":{"name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","adminEmail":"test.admin@gov.ab.ca"}}}}}},"responses":{"200":{"description":"Tenant is created with an existing realm.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"202":{"description":"Tenant is created and its realm is being provisioned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"provisioning","adminEmail":"test.admin@gov.ab.ca"}}}},"400":{"description":"The name is missing, the name is invalid or already used, the administrator already has a tenant, or the realm is already associated with a tenant or set without adminEmail.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TenantV1ValidationError"},{"$ref":"#/components/schemas/TenantError"}]},"examples":{"missingName":{"summary":"Name is missing","value":{"success":false,"errors":[{"property":"name","constraints":{"isDefined":"name should not be null or undefined"}}]}},"nameUsed":{"summary":"Name is already used","value":{"errorMessage":"Value not valid for Tenant name: This tenant name has already been used. Please enter a different tenant name."}}}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"}}},"delete":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use DELETE /api/tenant/v2/tenants/{id}, after looking up the tenant ID with GET /api/tenant/v2/tenants?realm={realm}. Archives the tenant with the given realm and disables the realm; the tenant is not deleted. Requires the core realm tenant-service-admin role.\n","parameters":[{"in":"query","name":"realm","required":true,"description":"Realm of the tenant to archive.","schema":{"type":"string"},"example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}],"responses":{"200":{"description":"The archived tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"description":"No tenant has the realm.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"tenant with ID 'realm: 2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f' could not be found."}}}}}}},"/api/tenant/v1/email":{"post":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants?adminEmail={email}. Retrieves the tenant with the given administrator email. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other tenant; core users can retrieve any tenant.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","description":"Email of the tenant administrator."}}},"example":{"email":"test.admin@gov.ab.ca"}}}},"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v1/name":{"post":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants?name={name}. Retrieves the tenant with the given name, ignoring case. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other tenant; core users can retrieve any tenant.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the tenant."}}},"example":{"name":"Test Tenant"}}}},"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v1/realm/roles":{"get":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; there is no v2 replacement. Returns the Keycloak roles of the realm that issued the current user's token, which is the user's own tenant realm. Requires the tenant-admin role.\n","responses":{"200":{"description":"Roles of the realm.","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/TenantRealmRole"}}}},"example":{"roles":[{"id":"0b9a6c2e-7d4f-4e1a-9c3b-5a8d2f6e1c7b","name":"offline_access","description":"${role_offline-access}","composite":false,"clientRole":false,"containerId":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}]}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"}}}},"/api/tenant/v1/realm/{realm}":{"get":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants?realm={realm}. Retrieves a tenant by realm. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other realm; core users can retrieve any tenant.\n","parameters":[{"in":"path","name":"realm","required":true,"description":"Realm of the tenant.","schema":{"type":"string"},"example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}],"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResult"}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v1/user/default-idp":{"get":{"tags":["Tenant service"],"description":"Internal endpoint used by the tenant admin webapp. Checks if the given user in the core realm is linked to the default ADSP identity provider. Requires the tenant-admin role and is rate limited.\n","parameters":[{"in":"query","name":"userId","required":true,"description":"ID of the user in the core realm.","schema":{"type":"string"},"example":"3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a"}],"responses":{"200":{"description":"Whether the user is linked to the default identity provider in the core realm.","content":{"application/json":{"schema":{"type":"object","properties":{"hasDefaultIdpInCore":{"type":"boolean"}}},"example":{"hasDefaultIdpInCore":true}}}},"400":{"description":"userId is missing, or the identity providers of the user could not be read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TenantV1ValidationError"},{"$ref":"#/components/schemas/TenantError"}]},"examples":{"missingUserId":{"summary":"userId is missing","value":{"success":false,"errors":[{"property":"userId","constraints":{"isDefined":"userId should not be null or undefined"}}]}},"checkFailed":{"summary":"Identity providers could not be read","value":{"errorMessage":"Failed to check the goa-ad IdP in core for user 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a due to Request failed with status code 404"}}}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v1/user/id":{"get":{"tags":["Tenant service"],"description":"Internal endpoint used by the tenant admin webapp. Looks up the ID of the user with the given email in a realm, which defaults to the core realm. Requires the tenant-admin role and is rate limited. Tenant users can only look up users in their own realm or the core realm; core users can use any realm.\n","parameters":[{"in":"query","name":"email","required":true,"description":"Email of the user.","schema":{"type":"string"},"example":"test.user@gov.ab.ca"},{"in":"query","name":"realm","required":false,"description":"Realm to look up the user in. Defaults to core.","schema":{"type":"string"},"example":"core"}],"responses":{"200":{"description":"ID of the user, or null if there is no user with the email.","content":{"application/json":{"schema":{"type":"object","properties":{"userIdInCore":{"type":"string","nullable":true}}},"example":{"userIdInCore":"3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Tenant user is not permitted to use the realm of another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to find user."}}}},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v1/user/idp":{"delete":{"tags":["Tenant service"],"description":"Internal endpoint used by the tenant admin webapp. Removes the link between a user and an identity provider in a realm. Requires the tenant-admin role and is rate limited. Tenant users can only act on their own realm or the core realm; core users can use any realm.\n","parameters":[{"in":"query","name":"userId","required":true,"description":"ID of the user in the realm.","schema":{"type":"string"},"example":"3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a"},{"in":"query","name":"realm","required":true,"description":"Realm of the user.","schema":{"type":"string"},"example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"},{"in":"query","name":"idpName","required":false,"description":"Alias of the identity provider. Defaults to goa-ad.","schema":{"type":"string"},"example":"goa-ad"}],"responses":{"200":{"description":"Identity provider link removed.","content":{"text/plain":{"schema":{"type":"string"},"example":"OK"}}},"400":{"description":"A required parameter is missing, or the identity provider link could not be removed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TenantV1ValidationError"},{"$ref":"#/components/schemas/TenantError"}]},"examples":{"missingRealm":{"summary":"realm is missing","value":{"success":false,"errors":[{"property":"realm","constraints":{"isDefined":"realm should not be null or undefined"}}]}},"removeFailed":{"summary":"Link could not be removed","value":{"errorMessage":"Failed to delete the IdP goa-ad from user 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a due to Request failed with status code 404"}}}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Tenant user is not permitted to use the realm of another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to delete user identity provider link."}}}},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v1/{id}":{"get":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants/{id}. Retrieves a tenant by ID. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other tenant; core users can retrieve any tenant.\n","parameters":[{"in":"path","name":"id","required":true,"description":"ID of the tenant, without the URN prefix.","schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResult"}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v2/tenants":{"get":{"tags":["Tenant service"],"description":"Search for active tenants; tenants that are still provisioning or archived are not included. No role is required. Authenticated tenant users only find their own tenant; authenticated core users, including service accounts, can find any tenant.\n\nArchived tenants are only returned when status is archived, which requires the core realm tenant-service-admin role.\n\nAnonymous requests (without a valid bearer token) are allowed if they include the name or realm criteria, and the results do not include the administrator email.\n","security":[{},{"accessToken":[]}],"parameters":[{"in":"query","name":"name","schema":{"type":"string","minLength":1,"maxLength":50},"description":"Name of the tenant, matched as a whole and ignoring case.","example":"Test Tenant"},{"in":"query","name":"realm","schema":{"type":"string","minLength":1,"maxLength":50},"description":"Realm of the tenant.","example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"},{"in":"query","name":"adminEmail","schema":{"type":"string","format":"email"},"description":"Email of the tenant administrator. Anonymous requests must also include name or realm.","example":"test.admin@gov.ab.ca"},{"in":"query","name":"status","schema":{"type":"string","enum":["active","archived"]},"description":"Status of the tenants to find. Archived requires the core realm tenant-service-admin role."}],"responses":{"200":{"description":"Matching tenants.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Tenant"}},"page":{"type":"object","properties":{"size":{"type":"number"}}}}},"examples":{"authenticated":{"summary":"Authenticated request","value":{"results":[{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}],"page":{"size":1}}},"anonymous":{"summary":"Anonymous request, without the administrator email","value":{"results":[{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active"}],"page":{"size":1}}}}}}},"400":{"$ref":"#/components/responses/TenantBadRequest"},"401":{"description":"Anonymous request does not include name or realm criteria, or the request for archived tenants is not from a core tenant-service-admin.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Request must include realm id or name criteria."}}}}}},"post":{"tags":["Tenant service"],"description":"Create a tenant. Requires the core realm beta-tester or tenant-service-admin role; tenant users are rejected even with those roles.\n\nBy default a new realm is created for the tenant, with the current user as the administrator; the response is sent with status 202 while the realm is provisioned, and a beta-tester who is already the administrator of a tenant is rejected. Users with the tenant-service-admin role can instead set realm to associate the tenant with an existing realm, in which case adminEmail is required and the response is sent with status 200. Only tenant-service-admin users can set realm or adminEmail.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[0-9a-zA-Z _]{1,50}$","description":"Name of the tenant. Must be unique, ignoring case."},"realm":{"type":"string","nullable":true,"minLength":1,"maxLength":50,"description":"Existing realm to associate with the tenant. Requires the tenant-service-admin role."},"adminEmail":{"type":"string","nullable":true,"format":"email","description":"Email of the tenant administrator. Requires the tenant-service-admin role."}}},"examples":{"newRealm":{"summary":"Create a tenant with a new realm","value":{"name":"Test Tenant"}},"existingRealm":{"summary":"Associate an existing realm (tenant-service-admin only)","value":{"name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","adminEmail":"test.admin@gov.ab.ca"}}}}}},"responses":{"200":{"description":"Tenant created with an existing realm.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"202":{"description":"Tenant created and its realm is being provisioned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"provisioning","adminEmail":"test.admin@gov.ab.ca"}}}},"400":{"description":"Request is invalid, for example the name is invalid or already used, the administrator already has a tenant, or the realm is already associated with a tenant or set without adminEmail.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"examples":{"invalidName":{"summary":"Name failed validation","value":{"errorMessage":"Validation failed with error(s): name (body) - Invalid value"}},"nameUsed":{"summary":"Name is already used","value":{"errorMessage":"Value not valid for Tenant name: This tenant name has already been used. Please enter a different tenant name."}},"adminHasTenant":{"summary":"Administrator already has a tenant","value":{"errorMessage":"test.admin@gov.ab.ca is the tenant admin in our record. One user can create only one realm."}}}}}},"401":{"description":"Request does not include a valid bearer token, the user does not have the required role, or a user without the tenant-service-admin role set realm or adminEmail.\n","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"},"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"tenant-service-admin role needed!"}}}}}}},"/api/tenant/v2/tenants/{id}":{"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"ID of the tenant, without the URN prefix.","example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"get":{"tags":["Tenant service"],"description":"Retrieves a tenant. No role is required, but the request must be authenticated. Tenant users can only retrieve their own tenant, and get 403 for any other tenant ID; core users can retrieve any tenant.\n","responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Tenant user is not permitted to retrieve another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to get tenant."}}}},"404":{"$ref":"#/components/responses/TenantNotFound"}}},"delete":{"tags":["Tenant service"],"description":"Archives a tenant: its realm is disabled, so users can no longer sign in, and the tenant and realm are retained. Archiving an archived tenant has no effect. Use the restore endpoint to recover an archived tenant. Requires the core realm tenant-service-admin role, which can archive any tenant; tenant users are rejected.\n\nSet purge to true to permanently delete an archived tenant and its realm. Purge also requires the core realm tenant-purge role and responds 400 if the tenant is not archived.\n","parameters":[{"in":"query","name":"purge","schema":{"type":"string","enum":["true","false"],"default":"false"},"description":"Permanently delete the archived tenant and its realm."}],"responses":{"200":{"description":"The archived tenant, or for purge the result of the deletion. success is false if the realm or the tenant record wasn't deleted.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Tenant"},{"$ref":"#/components/schemas/TenantDeleteResult"}]}}}},"400":{"description":"Request is invalid, for example the tenant is not archived for purge, or is still provisioning.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Tenant must be archived before it can be purged."}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Purge was requested without the core realm tenant-purge role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to purge tenant."}}}},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v2/tenants/{id}/name":{"parameters":[{"in":"path","name":"id","required":true,"description":"ID of the tenant, without the URN prefix.","schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"patch":{"tags":["Tenant service"],"description":"Update the tenant name. Requires the core realm tenant-service-admin role, which can rename any tenant; tenant users, including tenant administrators, are rejected. Rate limited.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[0-9a-zA-Z _]{1,50}$"}}},"example":{"name":"Renamed Tenant"}}}},"responses":{"200":{"description":"Updated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Renamed Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}}}},"400":{"$ref":"#/components/responses/TenantBadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v2/tenants/{id}/restore":{"parameters":[{"in":"path","name":"id","required":true,"description":"ID of the tenant, without the URN prefix.","schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"post":{"tags":["Tenant service"],"description":"Restores an archived tenant: its realm is enabled again and its status is active. Requires the core realm tenant-service-admin role; tenant users are rejected.\n","responses":{"200":{"description":"The restored tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"description":"The tenant is not archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Only an archived tenant can be restored."}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"TenantBadRequest":{"description":"Request is invalid, for example a parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Validation failed with error(s): name (body) - Invalid value"}}}},"TenantNotFound":{"description":"Tenant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Tenant with ID '61f2e3a8c9b1d2e3f4a5b6c7' could not be found."}}}},"TenantTooManyRequests":{"description":"Too many requests; limited to 200 requests per 5 minutes.","content":{"text/plain":{"schema":{"type":"string"},"example":"Too many requests, please try again later."}}},"TenantUnauthorized":{"description":"Request does not include a valid bearer token, or the user does not have the role required for the operation. Role checks in this API respond with 401 rather than 403.\n","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}},"TenantV1BadRequest":{"description":"A required parameter is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantV1ValidationError"}}}}},"schemas":{"Tenant":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"URN of the tenant.","example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"name":{"type":"string","example":"Test Tenant"},"realm":{"type":"string","description":"Keycloak realm of the tenant, which is the issuer of the tenant's access tokens.","example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"},"status":{"type":"string","readOnly":true,"enum":["provisioning","active","archived"],"description":"Status of the tenant; a new tenant is provisioning until its realm has been created. An archived tenant has its realm disabled.\n","example":"active"},"adminEmail":{"type":"string","description":"Email of the tenant administrator. Not included for anonymous requests.","example":"test.admin@gov.ab.ca"},"deletedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Time the tenant was archived. Only included for an archived tenant."}},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}},"TenantDeleteResult":{"type":"object","properties":{"deletedRealm":{"type":"boolean"},"deletedTenant":{"type":"boolean"},"success":{"type":"boolean"}},"example":{"deletedRealm":true,"deletedTenant":true,"success":true}},"TenantError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Tenant with ID '61f2e3a8c9b1d2e3f4a5b6c7' could not be found."}},"TenantRealmRole":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"composite":{"type":"boolean"},"clientRole":{"type":"boolean"},"containerId":{"type":"string"}},"example":{"id":"0b9a6c2e-7d4f-4e1a-9c3b-5a8d2f6e1c7b","name":"offline_access","description":"${role_offline-access}","composite":false,"clientRole":false,"containerId":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}},"TenantResult":{"type":"object","properties":{"success":{"type":"boolean"},"tenant":{"$ref":"#/components/schemas/Tenant"}},"example":{"success":true,"tenant":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}}},"TenantV1ValidationError":{"type":"object","properties":{"success":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"property":{"type":"string"},"constraints":{"type":"object","additionalProperties":{"type":"string"}}}}}},"example":{"success":false,"errors":[{"property":"email","constraints":{"isDefined":"email should not be null or undefined"}}]}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Tenant service","description":"Tenant API to store and read tenant information."}]}
1
+ {"openapi":"3.0.0","info":{"title":"Tenant management service","version":"0.0.0","description":"The tenant management service includes APIs for common platform capabilities like retrieving tenant information."},"paths":{"/api/tenant/v1":{"post":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use POST /api/tenant/v2/tenants, which shares this endpoint's implementation but also validates the name length and characters. Creates a tenant. Requires the core realm beta-tester or tenant-service-admin role; tenant users are rejected even with those roles.\n\nBy default a new realm is created for the tenant, with the current user as the administrator; the response is sent with status 202 while the realm is provisioned. Users with the tenant-service-admin role can instead set realm to associate the tenant with an existing realm, in which case adminEmail is required and the response is sent with status 200. Only tenant-service-admin users can set realm or adminEmail.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the tenant. Must be unique (ignoring case) and must not contain special characters such as ! & % - or /.\n"},"realm":{"type":"string","description":"Existing realm to associate with the tenant. Requires the tenant-service-admin role."},"adminEmail":{"type":"string","format":"email","description":"Email of the tenant administrator. Requires the tenant-service-admin role."}}},"examples":{"newRealm":{"summary":"Create a tenant with a new realm","value":{"name":"Test Tenant"}},"existingRealm":{"summary":"Associate an existing realm (tenant-service-admin only)","value":{"name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","adminEmail":"test.admin@gov.ab.ca"}}}}}},"responses":{"200":{"description":"Tenant is created with an existing realm.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"202":{"description":"Tenant is created and its realm is being provisioned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"provisioning","adminEmail":"test.admin@gov.ab.ca"}}}},"400":{"description":"The name is missing, the name is invalid or already used, the administrator already has a tenant, or the realm is already associated with a tenant or set without adminEmail.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TenantV1ValidationError"},{"$ref":"#/components/schemas/TenantError"}]},"examples":{"missingName":{"summary":"Name is missing","value":{"success":false,"errors":[{"property":"name","constraints":{"isDefined":"name should not be null or undefined"}}]}},"nameUsed":{"summary":"Name is already used","value":{"errorMessage":"Value not valid for Tenant name: This tenant name has already been used. Please enter a different tenant name."}}}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"}}},"delete":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use DELETE /api/tenant/v2/tenants/{id}, after looking up the tenant ID with GET /api/tenant/v2/tenants?realm={realm}. Archives the tenant with the given realm and disables the realm; the tenant is not deleted. Requires the core realm tenant-service-admin role.\n","parameters":[{"in":"query","name":"realm","required":true,"description":"Realm of the tenant to archive.","schema":{"type":"string"},"example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}],"responses":{"200":{"description":"The archived tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"description":"No tenant has the realm.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"tenant with ID 'realm: 2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f' could not be found."}}}}}}},"/api/tenant/v1/email":{"post":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants?adminEmail={email}. Retrieves the tenant with the given administrator email. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other tenant; core users can retrieve any tenant.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","description":"Email of the tenant administrator."}}},"example":{"email":"test.admin@gov.ab.ca"}}}},"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v1/name":{"post":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants?name={name}. Retrieves the tenant with the given name, ignoring case. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other tenant; core users can retrieve any tenant.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the tenant."}}},"example":{"name":"Test Tenant"}}}},"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v1/realm/roles":{"get":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; there is no v2 replacement. Returns the Keycloak roles of the realm that issued the current user's token, which is the user's own tenant realm. Requires the tenant-admin role.\n","responses":{"200":{"description":"Roles of the realm.","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/TenantRealmRole"}}}},"example":{"roles":[{"id":"0b9a6c2e-7d4f-4e1a-9c3b-5a8d2f6e1c7b","name":"offline_access","description":"${role_offline-access}","composite":false,"clientRole":false,"containerId":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}]}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"}}}},"/api/tenant/v1/realm/{realm}":{"get":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants?realm={realm}. Retrieves a tenant by realm. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other realm; core users can retrieve any tenant.\n","parameters":[{"in":"path","name":"realm","required":true,"description":"Realm of the tenant.","schema":{"type":"string"},"example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}],"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResult"}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v1/user/default-idp":{"get":{"tags":["Tenant service"],"description":"Internal endpoint used by the tenant admin webapp. Checks if the given user in the core realm is linked to the default ADSP identity provider. Requires the tenant-admin role and is rate limited.\n","parameters":[{"in":"query","name":"userId","required":true,"description":"ID of the user in the core realm.","schema":{"type":"string"},"example":"3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a"}],"responses":{"200":{"description":"Whether the user is linked to the default identity provider in the core realm.","content":{"application/json":{"schema":{"type":"object","properties":{"hasDefaultIdpInCore":{"type":"boolean"}}},"example":{"hasDefaultIdpInCore":true}}}},"400":{"description":"userId is missing, or the identity providers of the user could not be read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TenantV1ValidationError"},{"$ref":"#/components/schemas/TenantError"}]},"examples":{"missingUserId":{"summary":"userId is missing","value":{"success":false,"errors":[{"property":"userId","constraints":{"isDefined":"userId should not be null or undefined"}}]}},"checkFailed":{"summary":"Identity providers could not be read","value":{"errorMessage":"Failed to check the goa-ad IdP in core for user 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a due to Request failed with status code 404"}}}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v1/user/id":{"get":{"tags":["Tenant service"],"description":"Internal endpoint used by the tenant admin webapp. Looks up the ID of the user with the given email in a realm, which defaults to the core realm. Requires the tenant-admin role and is rate limited. Tenant users can only look up users in their own realm or the core realm; core users can use any realm.\n","parameters":[{"in":"query","name":"email","required":true,"description":"Email of the user.","schema":{"type":"string"},"example":"test.user@gov.ab.ca"},{"in":"query","name":"realm","required":false,"description":"Realm to look up the user in. Defaults to core.","schema":{"type":"string"},"example":"core"}],"responses":{"200":{"description":"ID of the user, or null if there is no user with the email.","content":{"application/json":{"schema":{"type":"object","properties":{"userIdInCore":{"type":"string","nullable":true}}},"example":{"userIdInCore":"3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a"}}}},"400":{"$ref":"#/components/responses/TenantV1BadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Tenant user is not permitted to use the realm of another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to find user."}}}},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v1/user/idp":{"delete":{"tags":["Tenant service"],"description":"Internal endpoint used by the tenant admin webapp. Removes the link between a user and an identity provider in a realm. Requires the tenant-admin role and is rate limited. Tenant users can only act on their own realm or the core realm; core users can use any realm.\n","parameters":[{"in":"query","name":"userId","required":true,"description":"ID of the user in the realm.","schema":{"type":"string"},"example":"3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a"},{"in":"query","name":"realm","required":true,"description":"Realm of the user.","schema":{"type":"string"},"example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"},{"in":"query","name":"idpName","required":false,"description":"Alias of the identity provider. Defaults to goa-ad.","schema":{"type":"string"},"example":"goa-ad"}],"responses":{"200":{"description":"Identity provider link removed.","content":{"text/plain":{"schema":{"type":"string"},"example":"OK"}}},"400":{"description":"A required parameter is missing, or the identity provider link could not be removed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TenantV1ValidationError"},{"$ref":"#/components/schemas/TenantError"}]},"examples":{"missingRealm":{"summary":"realm is missing","value":{"success":false,"errors":[{"property":"realm","constraints":{"isDefined":"realm should not be null or undefined"}}]}},"removeFailed":{"summary":"Link could not be removed","value":{"errorMessage":"Failed to delete the IdP goa-ad from user 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a due to Request failed with status code 404"}}}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Tenant user is not permitted to use the realm of another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to delete user identity provider link."}}}},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v1/{id}":{"get":{"deprecated":true,"tags":["Tenant service"],"description":"Deprecated; use GET /api/tenant/v2/tenants/{id}. Retrieves a tenant by ID. No role is required. Tenant users can only retrieve their own tenant, and get 404 for any other tenant; core users can retrieve any tenant.\n","parameters":[{"in":"path","name":"id","required":true,"description":"ID of the tenant, without the URN prefix.","schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResult"}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v2/tenants":{"get":{"tags":["Tenant service"],"description":"Search for active tenants; tenants that are still provisioning or archived are not included. No role is required. Authenticated tenant users only find their own tenant; authenticated core users, including service accounts, can find any tenant.\n\nArchived tenants are only returned when status is archived, which requires the core realm tenant-service-admin role.\n\nAnonymous requests (without a valid bearer token) are allowed if they include the name or realm criteria, and the results do not include the administrator email.\n","security":[{},{"accessToken":[]}],"parameters":[{"in":"query","name":"name","schema":{"type":"string","minLength":1,"maxLength":50},"description":"Name of the tenant, matched as a whole and ignoring case.","example":"Test Tenant"},{"in":"query","name":"realm","schema":{"type":"string","minLength":1,"maxLength":50},"description":"Realm of the tenant.","example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"},{"in":"query","name":"adminEmail","schema":{"type":"string","format":"email"},"description":"Email of the tenant administrator. Anonymous requests must also include name or realm.","example":"test.admin@gov.ab.ca"},{"in":"query","name":"status","schema":{"type":"string","enum":["active","archived"]},"description":"Status of the tenants to find. Archived requires the core realm tenant-service-admin role."}],"responses":{"200":{"description":"Matching tenants.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Tenant"}},"page":{"type":"object","properties":{"size":{"type":"number"}}}}},"examples":{"authenticated":{"summary":"Authenticated request","value":{"results":[{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}],"page":{"size":1}}},"anonymous":{"summary":"Anonymous request, without the administrator email","value":{"results":[{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active"}],"page":{"size":1}}}}}}},"400":{"$ref":"#/components/responses/TenantBadRequest"},"401":{"description":"Anonymous request does not include name or realm criteria, or the request for archived tenants is not from a core tenant-service-admin.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Request must include realm id or name criteria."}}}}}},"post":{"tags":["Tenant service"],"description":"Create a tenant. Requires the core realm beta-tester or tenant-service-admin role; tenant users are rejected even with those roles.\n\nBy default a new realm is created for the tenant, with the current user as the administrator; the response is sent with status 202 while the realm is provisioned, and a beta-tester who is already the administrator of a tenant is rejected. Users with the tenant-service-admin role can instead set realm to associate the tenant with an existing realm, in which case adminEmail is required and the response is sent with status 200. Only tenant-service-admin users can set realm or adminEmail.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[0-9a-zA-Z _]{1,50}$","description":"Name of the tenant. Must be unique, ignoring case."},"realm":{"type":"string","nullable":true,"minLength":1,"maxLength":50,"description":"Existing realm to associate with the tenant. Requires the tenant-service-admin role."},"adminEmail":{"type":"string","nullable":true,"format":"email","description":"Email of the tenant administrator. Requires the tenant-service-admin role."}}},"examples":{"newRealm":{"summary":"Create a tenant with a new realm","value":{"name":"Test Tenant"}},"existingRealm":{"summary":"Associate an existing realm (tenant-service-admin only)","value":{"name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","adminEmail":"test.admin@gov.ab.ca"}}}}}},"responses":{"200":{"description":"Tenant created with an existing realm.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"202":{"description":"Tenant created and its realm is being provisioned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"provisioning","adminEmail":"test.admin@gov.ab.ca"}}}},"400":{"description":"Request is invalid, for example the name is invalid or already used, the administrator already has a tenant, or the realm is already associated with a tenant or set without adminEmail.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"examples":{"invalidName":{"summary":"Name failed validation","value":{"errorMessage":"Validation failed with error(s): name (body) - Invalid value"}},"nameUsed":{"summary":"Name is already used","value":{"errorMessage":"Value not valid for Tenant name: This tenant name has already been used. Please enter a different tenant name."}},"adminHasTenant":{"summary":"Administrator already has a tenant","value":{"errorMessage":"test.admin@gov.ab.ca is the tenant admin in our record. One user can create only one realm."}}}}}},"401":{"description":"Request does not include a valid bearer token, the user does not have the required role, or a user without the tenant-service-admin role set realm or adminEmail.\n","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"},"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"tenant-service-admin role needed!"}}}}}}},"/api/tenant/v2/tenants/{id}":{"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"ID of the tenant, without the URN prefix.","example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"get":{"tags":["Tenant service"],"description":"Retrieves a tenant. No role is required, but the request must be authenticated. Tenant users can only retrieve their own tenant, and get 403 for any other tenant ID; core users can retrieve any tenant.\n","responses":{"200":{"description":"Tenant information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Tenant user is not permitted to retrieve another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to get tenant."}}}},"404":{"$ref":"#/components/responses/TenantNotFound"}}},"delete":{"tags":["Tenant service"],"description":"Archives a tenant: its realm is disabled, so users can no longer sign in, and the tenant and realm are retained. Archiving an archived tenant has no effect. Use the restore endpoint to recover an archived tenant. Requires the core realm tenant-service-admin role, which can archive any tenant; tenant users are rejected.\n\nSet purge to true to permanently delete an archived tenant and its realm. Purge also requires the core realm tenant-purge role and responds 400 if the tenant is not archived.\n","parameters":[{"in":"query","name":"purge","schema":{"type":"string","enum":["true","false"],"default":"false"},"description":"Permanently delete the archived tenant and its realm."}],"responses":{"200":{"description":"The archived tenant, or for purge the result of the deletion. success is false if the realm or the tenant record wasn't deleted.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Tenant"},{"$ref":"#/components/schemas/TenantDeleteResult"}]}}}},"400":{"description":"Request is invalid, for example the tenant is not archived for purge, or is still provisioning.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Tenant must be archived before it can be purged."}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"403":{"description":"Purge was requested without the core realm tenant-purge role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"User Test User (ID: 3d1c5e7a-9b2f-4c6d-8e0a-1f3b5d7c9e2a) not permitted to purge tenant."}}}},"404":{"$ref":"#/components/responses/TenantNotFound"}}}},"/api/tenant/v2/tenants/{id}/name":{"parameters":[{"in":"path","name":"id","required":true,"description":"ID of the tenant, without the URN prefix.","schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"patch":{"tags":["Tenant service"],"description":"Update the tenant name. Requires the core realm tenant-service-admin role, which can rename any tenant; tenant users, including tenant administrators, are rejected. Rate limited. The name must not be used by another tenant (compared ignoring case), so a duplicate responds 400; renaming a tenant to its own current name, or changing only its case, is allowed.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[0-9a-zA-Z _]{1,50}$"}}},"example":{"name":"Renamed Tenant"}}}},"responses":{"200":{"description":"Updated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Renamed Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}}}},"400":{"$ref":"#/components/responses/TenantBadRequest"},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"},"429":{"$ref":"#/components/responses/TenantTooManyRequests"}}}},"/api/tenant/v2/tenants/{id}/restore":{"parameters":[{"in":"path","name":"id","required":true,"description":"ID of the tenant, without the URN prefix.","schema":{"type":"string"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}],"post":{"tags":["Tenant service"],"description":"Restores an archived tenant: its realm is enabled again and its status is active. Requires the core realm tenant-service-admin role; tenant users are rejected.\n","responses":{"200":{"description":"The restored tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"description":"The tenant is not archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Only an archived tenant can be restored."}}}},"401":{"$ref":"#/components/responses/TenantUnauthorized"},"404":{"$ref":"#/components/responses/TenantNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"TenantBadRequest":{"description":"Request is invalid, for example a parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Validation failed with error(s): name (body) - Invalid value"}}}},"TenantNotFound":{"description":"Tenant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantError"},"example":{"errorMessage":"Tenant with ID '61f2e3a8c9b1d2e3f4a5b6c7' could not be found."}}}},"TenantTooManyRequests":{"description":"Too many requests; limited to 200 requests per 5 minutes.","content":{"text/plain":{"schema":{"type":"string"},"example":"Too many requests, please try again later."}}},"TenantUnauthorized":{"description":"Request does not include a valid bearer token, or the user does not have the role required for the operation. Role checks in this API respond with 401 rather than 403.\n","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}},"TenantV1BadRequest":{"description":"A required parameter is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantV1ValidationError"}}}}},"schemas":{"Tenant":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"URN of the tenant.","example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"name":{"type":"string","example":"Test Tenant"},"realm":{"type":"string","description":"Keycloak realm of the tenant, which is the issuer of the tenant's access tokens.","example":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"},"status":{"type":"string","readOnly":true,"enum":["provisioning","active","archived"],"description":"Status of the tenant; a new tenant is provisioning until its realm has been created. An archived tenant has its realm disabled.\n","example":"active"},"adminEmail":{"type":"string","description":"Email of the tenant administrator. Not included for anonymous requests.","example":"test.admin@gov.ab.ca"},"deletedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Time the tenant was archived. Only included for an archived tenant."}},"example":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}},"TenantDeleteResult":{"type":"object","properties":{"deletedRealm":{"type":"boolean"},"deletedTenant":{"type":"boolean"},"success":{"type":"boolean"}},"example":{"deletedRealm":true,"deletedTenant":true,"success":true}},"TenantError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Tenant with ID '61f2e3a8c9b1d2e3f4a5b6c7' could not be found."}},"TenantRealmRole":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"composite":{"type":"boolean"},"clientRole":{"type":"boolean"},"containerId":{"type":"string"}},"example":{"id":"0b9a6c2e-7d4f-4e1a-9c3b-5a8d2f6e1c7b","name":"offline_access","description":"${role_offline-access}","composite":false,"clientRole":false,"containerId":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f"}},"TenantResult":{"type":"object","properties":{"success":{"type":"boolean"},"tenant":{"$ref":"#/components/schemas/Tenant"}},"example":{"success":true,"tenant":{"id":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","name":"Test Tenant","realm":"2f6c8f1e-3b7a-4d5c-9e8f-1a2b3c4d5e6f","status":"active","adminEmail":"test.admin@gov.ab.ca"}}},"TenantV1ValidationError":{"type":"object","properties":{"success":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"property":{"type":"string"},"constraints":{"type":"object","additionalProperties":{"type":"string"}}}}}},"example":{"success":false,"errors":[{"property":"email","constraints":{"isDefined":"email should not be null or undefined"}}]}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Tenant service","description":"Tenant API to store and read tenant information."}]}
@@ -398,6 +398,21 @@ Each model call gets the agent's instructions followed by this context as text;
398
398
  | `AGENT_NOTIFICATION_LAST_MESSAGES` | `8` | Messages of the thread the agent reads |
399
399
  | `AGENT_NOTIFICATION_MAX_OUTPUT_TOKENS` | `6000` | Longest reply the model may write in one call, including the body |
400
400
 
401
+ #### PDF template agent
402
+
403
+ `pdfGenerationAgent` edits the PDF template open in the tenant admin PDF Template Editor; the client sends `{ pdfDefinitionId }` as the message context. To keep each model call small:
404
+
405
+ - Each call gets short instructions and the saved template itself, so the agent edits and saves in one call instead of first calling `pdfConfigurationRetrievalTool`. The guidance on files from the user (design references and uploaded images) is added only while a file is part of the conversation.
406
+ - Long data URIs, such as the logo in the default header and footer, and long comments are shown to the model as placeholders like `[[elided-asset-1]]`. `pdfConfigurationUpdateTool` puts the original content back when it saves, and rejects a save that uses a placeholder the template does not have. Test data wrapped in a `data` object is saved at the root, where the template reads it.
407
+ - The model gets a short note for each save, while the client still gets the saved template in the tool result. Template copies from earlier turns are replaced with notes in later requests (the thread keeps them), and files from turns before the previous one are left out.
408
+ - A save is followed by a short closing reply that needs neither the template nor the tools.
409
+ - It keeps its own short history without observational memory.
410
+
411
+ | Variable | Default | Meaning |
412
+ | ----------------------------- | ------- | --------------------------------------------- |
413
+ | `AGENT_PDF_LAST_MESSAGES` | `8` | Messages of the thread the agent reads |
414
+ | `AGENT_PDF_MAX_OUTPUT_TOKENS` | `10000` | Longest reply the model may write in one call |
415
+
401
416
  ### Delete a thread
402
417
 
403
418
  Delete one of your own threads, with its stored messages, context, and workspace, for example when the user starts a new chat. The response is `{ "deleted": false }` when you have no thread with that ID, so repeating the request is harmless. The thread ID is the `threadId` used on socket.io.
@@ -56,7 +56,7 @@ All endpoints are under `https://form-service.adsp.alberta.ca/form/v1`. See the
56
56
  | `PATCH /form/v1/definitions/{definitionId}/submission-actions` | Update what happens when a form is submitted. | `form-admin` |
57
57
  | `PUT /form/v1/definitions/{definitionId}/schedule` | Update the scheduled intake period. | `form-admin` |
58
58
  | `POST /form/v1/definitions/{definitionId}/access-requests` | Request access to a restricted form, enabling registration on the first request. | `form-access-requester` or `form-admin` |
59
- | `DELETE /form/v1/definitions/{definitionId}/access-requests` | Remove the registration settings, so the form no longer accepts access requests. | `form-admin` |
59
+ | `DELETE /form/v1/definitions/{definitionId}/access-requests` | Remove the registration settings and delete all access requests, so the form no longer accepts them. | `form-admin` |
60
60
  | `GET /form/v1/definitions/{definitionId}/access-requests` | Find the access requests of a form, by status, newest first. | `form-access-reader`, `form-access-writer` or `form-admin` |
61
61
  | `GET /form/v1/definitions/{definitionId}/access-requests/{email}` | Read the latest access request of an email address. | The user with that email address, `form-access-reader`, `form-access-writer` or `form-admin` |
62
62
  | `PATCH /form/v1/definitions/{definitionId}/access-requests/{requestId}` | Approve or deny a pending access request. | `form-access-writer` or `form-admin` |
@@ -107,7 +107,7 @@ Some forms are restricted to a segment of the population, for example to physici
107
107
 
108
108
  Submitting the first access request for a form enables registration: form service sets `registration.enabled` to `true` in the latest revision of the definition, creating the `registration` settings if the definition has none. Like the other definition endpoints, it doesn't change the active revision; if an older revision is set as active, the change takes effect once the latest revision is set as active in configuration service. Use `GET /form/v1/definitions/{definitionId}?version=latest` (`form-admin` only) to read the latest revision.
109
109
 
110
- `DELETE /form/v1/definitions/{definitionId}/access-requests` removes the `registration` settings from the definition, the same way, so the form no longer accepts access requests until a new request enables it again. Existing access requests are kept.
110
+ `DELETE /form/v1/definitions/{definitionId}/access-requests` removes the `registration` settings from the definition, the same way, so the form no longer accepts access requests until a new request enables it again. It also permanently deletes all access requests of the form, including approved and denied ones.
111
111
 
112
112
  An applicant submits an _access request_ with their name, email address and answers. Answers are validated against the registration questions, and answers to questions that aren't defined are rejected. The request starts as `pending`, and an administrator then approves or denies it. Each email address can have only one pending request per form; after a request is reviewed, the applicant can submit a new one. Approved or denied requests can't be reviewed again.
113
113
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/adsp-sdk-mcp-server",
3
- "version": "1.40.1",
3
+ "version": "1.42.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - MCP server for ADSP documentation and Node SDK reference lookup.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",
package/provenance.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "kind": "release",
3
- "builtAt": "2026-11-23T15:59:31.452Z",
4
- "sourceCommit": "05199bb414f1d6a7c0e79312e8caf3e54347c277",
5
- "latestRelease": "1.40.0",
6
- "docsCommit": "d0010bba46594bacd5a6cfe3265816b18fc9e45a",
3
+ "builtAt": "2026-11-23T17:37:01.307Z",
4
+ "sourceCommit": "c27b1081812dfdb41c5c6cedc126c5763f348606",
5
+ "latestRelease": "1.41.0",
6
+ "docsCommit": "c27b1081812dfdb41c5c6cedc126c5763f348606",
7
7
  "sdk": {
8
8
  "version": "2.37.0",
9
9
  "commit": "4721e7cf9f8bd770e911058cb3a233be7ebc0923",