@abgov/adsp-sdk-mcp-server 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -7
- package/assets/api-specs/agent-service.json +1 -0
- package/assets/api-specs/audit-service.json +1 -0
- package/assets/api-specs/cache-service.json +1 -0
- package/assets/api-specs/calendar-service.json +1 -0
- package/assets/api-specs/comment-service.json +1 -0
- package/assets/api-specs/configuration-service.json +1 -0
- package/assets/api-specs/directory-service.json +1 -0
- package/assets/api-specs/event-service.json +1 -0
- package/assets/api-specs/export-service.json +1 -0
- package/assets/api-specs/feedback-service.json +1 -0
- package/assets/api-specs/file-service.json +1 -0
- package/assets/api-specs/form-service.json +1 -0
- package/assets/api-specs/index.json +186 -0
- package/assets/api-specs/notification-service.json +1 -0
- package/assets/api-specs/pdf-service.json +1 -0
- package/assets/api-specs/pii-service.json +1 -0
- package/assets/api-specs/project-planner-service.json +1 -0
- package/assets/api-specs/push-service.json +1 -0
- package/assets/api-specs/status-service.json +1 -0
- package/assets/api-specs/task-service.json +1 -0
- package/assets/api-specs/tenant-management-api.json +1 -0
- package/assets/api-specs/token-handler.json +1 -0
- package/assets/api-specs/value-service.json +1 -0
- package/assets/api-specs/verify-service.json +1 -0
- package/assets/docs/services/agent-service.md +31 -0
- package/assets/docs/services/notification-service.md +23 -0
- package/assets/docs/services/value-service.md +16 -0
- package/package.json +1 -1
- package/provenance.json +4 -4
- package/src/api-specs/apiSpecsRepository.d.ts +44 -0
- package/src/api-specs/apiSpecsRepository.js +113 -0
- package/src/api-specs/apiSpecsRepository.js.map +1 -0
- package/src/config.d.ts +2 -0
- package/src/config.js +7 -0
- package/src/config.js.map +1 -1
- package/src/hosted.d.ts +20 -0
- package/src/hosted.js +30 -0
- package/src/hosted.js.map +1 -0
- package/src/http.d.ts +4 -1
- package/src/http.js +22 -1
- package/src/http.js.map +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +3 -1
- package/src/index.js.map +1 -1
- package/src/lifecycle.d.ts +18 -0
- package/src/lifecycle.js +52 -0
- package/src/lifecycle.js.map +1 -0
- package/src/main.js +2 -22
- package/src/main.js.map +1 -1
- package/src/metrics.js +7 -1
- package/src/metrics.js.map +1 -1
- package/src/server.d.ts +2 -0
- package/src/server.js +13 -3
- package/src/server.js.map +1 -1
- package/src/tools/registerApiTools.d.ts +7 -0
- package/src/tools/registerApiTools.js +110 -0
- package/src/tools/registerApiTools.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"PDF Service","version":"0.0.0","description":"The **PDF Service** allows applications to create custom PDF documents for their end users to download and use. The service itself has two components:\n1. A template editor, and\n2. APIs to combine a template with data in order to generate a customized, downloadable PDF.\n\nAuthoring a template is done through the [PDF Service Webapp](https://adsp.alberta.ca/admin/services/pdf), which facilitates\na *change and test* type of development cycle. Once you are satisfied with a template you can use it's *template-id* in API calls to:\n* Initiate asynchronous *Jobs* to generate PDF documents, based on a template and data supplied by the application. Depending on the complexity, it can take seconds to generate one.\n* Poll the status of a PDF Generation Job, and\n* Get the file ID of the completed PDF for use with the [File Service APIs](https://api.adsp.alberta.ca/platform/?urls.primaryName=File%20service) for managing the PDF file.\n* Without specifying the file type id in the PDF generation API, the PDF files generated will be stored within a default file type. The default file type comes with a retention period of 30 days. This means the PDF file will be automatically deleted in 30 days. To overcome the default retention rule, we shall create our own file type in the file service and specify file type id in the PDF generation API.\n\nFor more, in-depth information on how to use the PDF Service please see the [tutorial](https://govalta.github.io/adsp-monorepo/tutorials/pdf-service/introduction.html).\n"},"paths":{"/pdf/v1/jobs":{"post":{"tags":["Generator"],"description":"Initiate a new, asynchronous Job to generate a PDF document from a tenant or platform template. Requires the `urn:ads:platform:pdf-service:pdf-generator` role, in the tenant or as a core user (for example a platform service account). Core callers must set tenantId. The job is queued and a `pdf-generation-queued` event is sent; the generated PDF is uploaded to the file service, and `pdf-generated` or `pdf-generation-failed` is sent when the job finishes. Job state is kept for about 24 hours after its last update, so your application must read the file ID of the new PDF document within that time, e.g. by polling GET /pdf/v1/jobs/{jobId} or by listening on the push service `pdf-generation-updates` stream.\n","parameters":[{"$ref":"#/components/parameters/PdfTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GenerateOperation"}],"discriminator":{"propertyName":"operation","mapping":{"generate":"#/components/schemas/GenerateOperation"}}},"example":{"operation":"generate","templateId":"submission-summary","filename":"submission-summary-1234.pdf","fileType":"submission-documents","data":{"applicant":{"name":"Test User"}}}}}},"responses":{"200":{"description":"Job successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"urn":"urn:ads:platform:pdf-service:v1:/jobs/7696ed03-977e-4bde-af54-d823be00ffad","id":"7696ed03-977e-4bde-af54-d823be00ffad","status":"queued","result":null}}},"links":{"getJobById":{"description":"The `id` returned can be used as the `jobId` parameter in `GET /pdf/v1/jobs/{jobId}`","operationId":"getJob","parameters":{"jobId":"$response.body#/id"}}}},"400":{"description":"Request is invalid, for example the body failed validation, or the specified file type cannot be found in the tenant.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfError"},"example":{"errorMessage":"Specified target file type 'submission-documents' cannot be found."}}}},"401":{"$ref":"#/components/responses/PdfUnauthorized"},"403":{"$ref":"#/components/responses/PdfForbidden"},"404":{"$ref":"#/components/responses/PdfTemplateNotFound"}}}},"/pdf/v1/jobs/{jobId}":{"get":{"tags":["Generator"],"description":"Retrieve the specified job's status and, once completed, the generated file. Requires the `urn:ads:platform:pdf-service:pdf-generator` role in the job's tenant. Core users and service accounts are not allowed (403), and a job of another tenant responds 403. Jobs expire about 24 hours after their last update and then respond 404.\n","operationId":"getJob","parameters":[{"name":"jobId","description":"ID of job to retrieve.","in":"path","required":true,"schema":{"type":"string","format":"uuid","example":"7696ed03-977e-4bde-af54-d823be00ffad"}}],"responses":{"200":{"description":"Job successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"$ref":"#/components/responses/PdfBadRequest"},"401":{"$ref":"#/components/responses/PdfUnauthorized"},"403":{"$ref":"#/components/responses/PdfForbidden"},"404":{"description":"Job not found, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfError"},"example":{"errorMessage":"Generated PDF with ID '7696ed03-977e-4bde-af54-d823be00ffad' could not be found."}}}}}}},"/pdf/v1/templates":{"get":{"tags":["Templates"],"description":"Retrieves the PDF templates available to the tenant: the tenant's own templates combined with platform templates. A platform template replaces a tenant template with the same ID. Any authenticated user of the tenant can call it; no specific role is required. Core users without a tenantId get only the platform templates.\n","parameters":[{"$ref":"#/components/parameters/PdfTenantId"}],"responses":{"200":{"description":"A list of PDF templates successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}},"401":{"$ref":"#/components/responses/PdfUnauthorized"}}},"post":{"tags":["Templates"],"description":"Creates a new PDF template for the tenant. Requires the `urn:ads:platform:pdf-service:pdf-admin` role, in the tenant or as a core user. The template ID is derived from the name. Core callers must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/PdfTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the template. Can contain letters, numbers, spaces, and hyphens. Leading and trailing whitespace is removed.","minLength":1,"maxLength":50,"pattern":"^[a-zA-Z0-9 -]+$","example":"Submission summary"},"description":{"type":"string","description":"Description of the template's purpose. Defaults to an empty string.","example":"Provides a summary of the submission"},"template":{"type":"string","description":"Initial HTML body content for the template. Defaults to an empty string.","example":"<p>Submitted by {{data.applicant.name}}</p>"},"header":{"type":"string","description":"Initial HTML header content for the template.","example":"<h1>Submission summary</h1>"},"footer":{"type":"string","description":"Initial HTML footer content for the template.","example":"<p>Government of Alberta</p>"},"additionalStyles":{"type":"string","description":"Initial CSS styles shared across template, header, and footer.","example":".label { font-weight: bold; }"},"variables":{"type":"string","description":"Initial variable assignments for the template.","example":"{\"applicant\": {\"name\": \"Test User\"}}"}}},"example":{"name":"Submission summary","description":"Provides a summary of the submission","template":"<p>Submitted by {{data.applicant.name}}</p>"}}}},"responses":{"201":{"description":"PDF template successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/PdfBadRequest"},"401":{"$ref":"#/components/responses/PdfUnauthorized"},"403":{"$ref":"#/components/responses/PdfForbidden"},"409":{"description":"A tenant or platform template with the same ID already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateConflict"}}}}}}},"/pdf/v1/templates/{templateId}":{"get":{"tags":["Templates"],"description":"Retrieve the specified PDF template, from the tenant's templates or the platform templates. Any authenticated user of the tenant can call it; no specific role is required.\n","parameters":[{"$ref":"#/components/parameters/PdfTemplateId"},{"$ref":"#/components/parameters/PdfTenantId"}],"responses":{"200":{"description":"The PDF template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/PdfBadRequest"},"401":{"$ref":"#/components/responses/PdfUnauthorized"},"404":{"$ref":"#/components/responses/PdfTemplateNotFound"}}},"patch":{"tags":["Templates"],"description":"Update an existing PDF template of the tenant. Only the fields included in the request body are updated; all other fields are left unchanged, and the ID does not change when the name does. Requires the `urn:ads:platform:pdf-service:pdf-admin` role, in the tenant or as a core user. The template is looked up before the role is checked, so an unknown ID responds 404 to any caller. Core callers must set tenantId. Responds 201, not 200, on success.\n","parameters":[{"$ref":"#/components/parameters/PdfTemplateId"},{"$ref":"#/components/parameters/PdfTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the template.","minLength":1,"maxLength":50,"example":"Submission summary"},"description":{"type":"string","description":"Description of the template's purpose.","example":"Provides a summary of the submission"},"template":{"type":"string","description":"The template body, designed with HTML/CSS.","example":"<p>Submitted by {{data.applicant.name}}</p>"},"header":{"type":"string","description":"Page header, designed with HTML/CSS.","example":"<h1>Submission summary</h1>"},"footer":{"type":"string","description":"Page footer, designed with HTML/CSS.","example":"<p>Government of Alberta</p>"},"additionalStyles":{"type":"string","description":"CSS styles shared across the template, header, and footer.","example":".label { font-weight: bold; }"},"variables":{"type":"string","description":"Variable assignments available to the template.","example":"{\"applicant\": {\"name\": \"Test User\"}}"}}},"example":{"template":"<p>Submitted by {{data.applicant.name}} on {{formatDate data.submitted}}</p>","additionalStyles":".label { font-weight: bold; }"}}}},"responses":{"201":{"description":"The PDF template was successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/PdfBadRequest"},"401":{"$ref":"#/components/responses/PdfUnauthorized"},"403":{"$ref":"#/components/responses/PdfForbidden"},"404":{"$ref":"#/components/responses/PdfTemplateNotFound"}}},"delete":{"tags":["Templates"],"description":"Delete the specified PDF template of the tenant. Requires the `urn:ads:platform:pdf-service:pdf-admin` role, in the tenant or as a core user. The template is looked up before the role is checked, so an unknown ID responds 404 to any caller. Core callers must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/PdfTemplateId"},{"$ref":"#/components/parameters/PdfTenantId"}],"responses":{"204":{"description":"The PDF template was successfully deleted."},"400":{"$ref":"#/components/responses/PdfBadRequest"},"401":{"$ref":"#/components/responses/PdfUnauthorized"},"403":{"$ref":"#/components/responses/PdfForbidden"},"404":{"$ref":"#/components/responses/PdfTemplateNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"PdfTemplateId":{"name":"templateId","in":"path","required":true,"description":"ID of the template. The ID is derived from the template name when it is created (trimmed, lower case, with whitespace replaced by hyphens), and is shown in the template editor of the tenant admin app.\n","schema":{"type":"string","minLength":1,"maxLength":50,"example":"submission-summary"}},"PdfTenantId":{"name":"tenantId","in":"query","required":false,"description":"Tenant to act on, as a tenant URN. Only read for core (platform) users and service accounts. Tenant users and service accounts always act on the tenant of their token, and this parameter is ignored for them. Core callers must set it on every operation that acts on tenant templates or jobs.\n","schema":{"type":"string","example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}}},"responses":{"PdfBadRequest":{"description":"Request is invalid, for example a parameter or the request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfError"},"example":{"errorMessage":"Validation failed with error(s): name (body) - name is required"}}}},"PdfForbidden":{"description":"User does not have the role required for the operation, or the resource belongs to another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to generate pdf."}}}},"PdfTemplateNotFound":{"description":"PDF template not found in the tenant or platform templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfError"},"example":{"errorMessage":"PDF Template with ID 'submission-summary' could not be found."}}}},"PdfUnauthorized":{"description":"Request does not include a valid bearer token."}},"schemas":{"GenerateOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["generate"],"description":"The operation will always be *generate*."},"fileType":{"type":"string","minLength":1,"maxLength":50,"example":"submission-documents","description":"ID of the file service file type that the generated PDF is uploaded as. It must exist in the tenant. Defaults to `generated-pdf`, which deletes files after 30 days.\n"},"templateId":{"description":"Identifies the template to use when generating the PDF document.","type":"string","minLength":1,"maxLength":50,"example":"submission-summary"},"recordId":{"description":"An arbitrary identifier that can be used by your application to cross reference the PDF document being generated. Set as the record ID of the uploaded file. Defaults to the job ID.\n","type":"string","example":"application-1234"},"context":{"description":"The context in which the PDF is being generated. This is an arbitrary JSON object that is included in the context of the job's domain events.\n","example":{"applicationId":"application-1234"},"type":"object"},"data":{"description":"The variable (Handlebars) assignments to be applied to the template when generating a PDF. This is an arbitrary JSON object, but its properties must match those expected by the template.","example":{"applicant":{"name":"Test User"}},"type":"object"},"filename":{"description":"The name given to the generated PDF document. Any extension is replaced with `.pdf`.\n","type":"string","minLength":1,"maxLength":60,"example":"submission-summary-1234.pdf"}},"required":["operation","templateId","filename"],"example":{"operation":"generate","templateId":"submission-summary","filename":"submission-summary-1234.pdf","fileType":"submission-documents","recordId":"application-1234","context":{"applicationId":"application-1234"},"data":{"applicant":{"name":"Test User"}}}},"Job":{"type":"object","properties":{"id":{"description":"Id of the Job spawned to generate a PDF. Required when polling to get the status of the Job.","type":"string","format":"uuid","readOnly":true,"example":"7696ed03-977e-4bde-af54-d823be00ffad"},"status":{"type":"string","enum":["queued","completed","failed"],"readOnly":true,"description":"Indicates the status of the PDF generation Job. A job is queued when it is created, and changes to completed when the PDF is uploaded to the file service, or to failed if generation fails.\n"},"urn":{"type":"string","readOnly":true,"description":"Logical URN to use for querying the job status. You can map the URN to a URL using the [ADSP Service SDK's](https://github.com/GovAlta/adsp-monorepo/blob/main/libs/adsp-service-sdk/src/directory/serviceDirectory.ts) getResourceUrl(AdspId\\`urn\\`)","example":"urn:ads:platform:pdf-service:v1:/jobs/7696ed03-977e-4bde-af54-d823be00ffad"},"result":{"type":"object","nullable":true,"readOnly":true,"description":"The generated file. Null until the job is completed.","properties":{"urn":{"type":"string","description":"Logical URN to use for downloading the PDF. You can map the URN to a URL using the [ADSP Service SDK's](https://github.com/GovAlta/adsp-monorepo/blob/main/libs/adsp-service-sdk/src/directory/serviceDirectory.ts) getResourceUrl(AdspId\\`urn\\`)","example":"urn:ads:platform:file-service:v1:/files/54e22556-d453-4626-ac6b-9bcadc577901"},"id":{"description":"A `fileId` to be used with the [File Service](https://api.adsp.alberta.ca/platform/?urls.primaryName=File%20service) for downloading the PDF.","type":"string","example":"54e22556-d453-4626-ac6b-9bcadc577901"},"filename":{"type":"string","description":"The name of the PDF file.","example":"submission-summary-1234.pdf"}}}},"example":{"urn":"urn:ads:platform:pdf-service:v1:/jobs/7696ed03-977e-4bde-af54-d823be00ffad","id":"7696ed03-977e-4bde-af54-d823be00ffad","status":"completed","result":{"urn":"urn:ads:platform:file-service:v1:/files/54e22556-d453-4626-ac6b-9bcadc577901","id":"54e22556-d453-4626-ac6b-9bcadc577901","filename":"submission-summary-1234.pdf"}}},"PdfError":{"type":"object","properties":{"errorMessage":{"type":"string","example":"PDF Template with ID 'submission-summary' could not be found."}}},"Template":{"type":"object","description":"A PDF template. Templates are stored in the configuration service under platform:pdf-service. Template content is HTML and CSS with Handlebars expressions, evaluated with a context of { data }.\n","properties":{"id":{"type":"string","description":"The template ID","readOnly":true,"example":"submission-summary"},"name":{"type":"string","description":"The name of the template","example":"Submission summary"},"description":{"type":"string","description":"The purpose of the template","example":"Provides a summary of the submission"},"template":{"type":"string","description":"The template body, designed with HTML/CSS","example":"<p>Submitted by {{data.applicant.name}}</p>"},"header":{"type":"string","description":"Page headers, designed with HTML/CSS","example":"<h1>Submission summary</h1>"},"footer":{"type":"string","description":"Page footers, designed with HTML/CSS","example":"<p>Government of Alberta</p>"},"additionalStyles":{"type":"string","description":"CSS styles shared across the template, header, and footer.","example":".label { font-weight: bold; }"},"variables":{"type":"string","description":"Variable assignments available to the template, as a JSON string.","example":"{\"applicant\": {\"name\": \"Test User\"}}"}},"example":{"id":"submission-summary","name":"Submission summary","description":"Provides a summary of the submission","template":"<p>Submitted by {{data.applicant.name}}</p>","header":"<h1>Submission summary</h1>","footer":"<p>Government of Alberta</p>","additionalStyles":".label { font-weight: bold; }","variables":"{\"applicant\": {\"name\": \"Test User\"}}"}},"TemplateConflict":{"type":"object","description":"Response body when a template with the same ID already exists. Note that the property is `error`.","properties":{"error":{"type":"string"}},"example":{"error":"PDF template 'Submission summary' already exists."}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Templates","description":"APIs for managing PDF templates."},{"name":"Generator","description":"APIs to manage asynchronous jobs for generating PDF documents"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"PII Service","version":"1.0.0","description":"Service for analyzing and anonymizing text for personally identifiable information (PII)."},"paths":{"/pii/v1/analyze":{"post":{"tags":["PII"],"description":"Analyze text for recognized entities.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzerRequest"}}}},"responses":{"200":{"description":"Successfully completed analysis","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RecognizerResult"}}}}}}}},"/pii/v1/anonymize":{"post":{"tags":["PII"],"description":"Anonymize text to remove entities.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzerRequest"}}}},"responses":{"200":{"description":"Successfully anonymized text.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnonymizerResult"}}}}}}},"/pii/v1/entities":{"get":{"tags":["PII"],"description":"Retrieves supported entities.","responses":{"200":{"description":"Successfully retrieved supported entities.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}}},"components":{"securitySchemes":{},"schemas":{"AnalyzerRequest":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string","enum":["en"]},"entities":{"type":"array","items":{"type":"string"}},"correlation_id":{"type":"string"},"score_threshold":{"type":"number","maximum":1,"minimum":0},"return_decision_process":{"type":"boolean"},"context":{"type":"array","items":{"type":"string"}}},"required":["text","language"]},"AnonymizerResult":{"type":"object","properties":{"text":{"type":"string"},"items":{"type":"array","items":{"type":"object"}}}},"RecognizerResult":{"type":"object","properties":{"start":{"type":"integer"},"end":{"type":"integer"},"score":{"type":"number"},"entity_type":{"type":"string"},"analysis_explanation":{"type":"object","properties":{"recognizer":{"type":"string"},"original_score":{"type":"number"},"pattern_name":{"type":"string"},"pattern":{"type":"string"},"validation_result":{"type":"number"},"textual_explanation":{"type":"string"}}}}}}},"security":[],"tags":[{"name":"PII"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Project planner service","version":"0.0.0","description":"The Project Planner Service helps people who are new to ADSP describe a business problem and\nturn it into a plan for using ADSP services.\n\nThe planner builds a structured _business model_ of the problem (actors, goals, workflows, rules, constraints,\nassumptions, unknowns, etc.), matches it against known GoA _business patterns_, and derives one or more\n_solution hypotheses_ that recommend ADSP services. Each recommended service has a _specialist_ that can be consulted\nfor service-specific questions and dependencies, and links to its service workspace.\n\nA _solution_ is the persistent, structured state of this work: decisions made (and why), open questions,\nspecialist progress, and recommended next steps. It survives across sessions so the user does not need\nto repeat information already gathered.\n\nAny recommendation made by the planner is a hypothesis for the user to refine.\n"},"paths":{"/planner/v1/analysis/options":{"get":{"tags":["Solution"],"summary":"Retrieves the available analysis modes.","description":"Retrieves the analysis modes available, the default mode, and the configured model name. Requires the planner-user or planner-admin role in the tenant of the token.\n","responses":{"200":{"description":"Analysis options retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisOptions"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/documents/extract":{"post":{"tags":["Solution"],"summary":"Extracts a problem statement from a document.","description":"Extracts the text of an uploaded document, to use as a problem statement. Supports Markdown (.md, .markdown), Word (.docx, and .doc HTML exports such as Confluence \"Export to Word\") and PDF (.pdf) files up to 20 MB. The file isn't stored. Requires the planner-user or planner-admin role in the tenant of the token. Responds 400 if no file is uploaded, the format isn't supported, or no text can be read from the file.\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The document, in the `file` field. Must be no larger than 20 MB."}},"required":["file"]}}}},"responses":{"200":{"description":"Text extracted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractedText"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/patterns":{"get":{"tags":["Pattern"],"summary":"Retrieves business patterns.","description":"Retrieves the effective business pattern catalogue of the tenant: built-in patterns, overridden by patterns in the tenant's configuration, overridden by patterns stored through this API. Requires the planner-user or planner-admin role in the tenant of the token.\n","responses":{"200":{"description":"Patterns retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternList"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}},"post":{"tags":["Pattern"],"summary":"Creates a custom pattern.","description":"Creates a custom business pattern in the tenant of the token. Requires the planner-admin role. The `id` is optional and defaults to a slug of the name; responds 400 if a pattern with the ID already exists.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,59}$"}}},{"$ref":"#/components/schemas/BusinessPatternInput"}]},"example":{"id":"grant-application","name":"Grant application","description":"Applicants apply for funding, staff assess eligibility and award grants.","domainLanguage":["grant","applicant","funding","award"],"strongSignals":[{"description":"Applicants apply for funding","keywords":["grant","funding"]}],"serviceMappings":[{"service":"form-service","reason":"Collects the application."}],"clarifyingQuestions":["Who assesses the applications?"]}}}},"responses":{"201":{"description":"Pattern created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessPattern"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/patterns/match":{"post":{"tags":["Pattern"],"summary":"Matches free text against patterns.","description":"Matches free text against the tenant's effective pattern catalogue and explains the confidence of each match. Requires the planner-user or planner-admin role in the tenant of the token.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["text"]},"example":{"text":"Caseworkers manage cases from intake to decision."}}}},"responses":{"200":{"description":"Ranked pattern matches, with clarifying questions when confidence is low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternMatchResult"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/patterns/{patternId}":{"parameters":[{"$ref":"#/components/parameters/PlannerPatternId"}],"get":{"tags":["Pattern"],"summary":"Retrieves a business pattern.","description":"Retrieves a pattern from the tenant's effective pattern catalogue. Requires the planner-user or planner-admin role in the tenant of the token.\n","responses":{"200":{"description":"Pattern retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessPattern"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}},"put":{"tags":["Pattern"],"summary":"Updates a pattern.","description":"Updates a pattern of the tenant of the token. Updating a built-in or configured pattern stores a tenant copy that overrides it. Requires the planner-admin role. The `patternId` must match `^[a-z0-9][a-z0-9-]{1,59}$`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessPatternInput"},"example":{"name":"Case management","domainLanguage":["case","caseworker","intake","appeal"],"strongSignals":[{"description":"Staff work cases through a lifecycle","keywords":["case","caseworker"]}],"serviceMappings":[{"service":"form-service","reason":"Collects intake information."}]}}}},"responses":{"200":{"description":"Pattern updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessPattern"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}},"delete":{"tags":["Pattern"],"summary":"Deletes a pattern stored through the API.","description":"Deletes a custom pattern of the tenant of the token, or restores a customized built-in pattern to its built-in version. Built-in and configured patterns themselves can't be deleted and respond 400. Requires the planner-admin role.\n","responses":{"204":{"description":"Pattern deleted."},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions":{"get":{"tags":["Solution"],"summary":"Retrieves solutions.","description":"Retrieves solutions of the tenant of the token, most recently updated first. Requires the planner-user or planner-admin role. Users with planner-user see the solutions they created; planner-admin sees all solutions in the tenant.\n","parameters":[{"name":"top","in":"query","description":"Number of results to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"after","in":"query","description":"Cursor of the page to read, from `page.next` of the previous response.","schema":{"type":"string"},"example":"MTA="},{"name":"status","in":"query","description":"Only include solutions with this status.","schema":{"type":"string","enum":["draft","analyzed","in-progress","completed","archived"]}}],"responses":{"200":{"description":"Solutions retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionList"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}},"post":{"tags":["Solution"],"summary":"Creates a solution.","description":"Creates a draft solution in the tenant of the token, owned by the calling user. Requires the planner-user or planner-admin role. Sends a `solution-created` event.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"scenario":{"type":"string","enum":["new","prototype","existing-app","reconfigure"],"default":"new"},"problemStatement":{"type":"string"}},"required":["name"]},"example":{"name":"Small business grant","description":"Online applications for the small business grant.","scenario":"new","problemStatement":"Applicants apply for a small business grant. Staff review each application and decide."}}}},"responses":{"201":{"description":"Solution created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/solutions/{id}":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"get":{"tags":["Solution"],"summary":"Retrieves a solution.","description":"Retrieves a solution, including its structured state. Requires the planner-user or planner-admin role in the tenant of the token. Only the user who created the solution, or a planner-admin, can retrieve it; other users receive 403. Solutions of other tenants respond 404.\n","responses":{"200":{"description":"Solution retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}},"patch":{"tags":["Solution"],"summary":"Updates a solution.","description":"Updates solution details, concepts, decisions (with their reasons), and questions. Lists replace the existing list; items without an `id` are given one. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Sends a `solution-updated` event and saves a new version when the content changed, unless `checkpoint` is false. Each item of `concepts`, `decisions`, and `questions` must be an object.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","analyzed","in-progress","completed","archived"]},"problemStatement":{"type":"string","description":"Changing the problem statement refreshes the solution's confidence."},"concepts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["actor","goal","activity","decision","evidence","business-rule","constraint","evaluation-criterion","workflow","outcome","document","event","external-system","assumption","unknown"]},"name":{"type":"string","minLength":1},"description":{"type":"string"},"source":{"type":"string","enum":["user","extracted","pattern","assumed"],"default":"user"}}}},"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"decision":{"type":"string"},"reason":{"type":"string"},"decidedOn":{"type":"string","format":"date-time","description":"Defaults to the time of the request."},"decidedBy":{"type":"string","description":"Defaults to the name of the calling user."}}}},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"raisedBy":{"type":"string","default":"user"},"status":{"type":"string","enum":["open","answered"],"default":"open"},"answer":{"type":"string"}}}},"checkpoint":{"$ref":"#/components/schemas/Checkpoint"}}},"example":{"status":"in-progress","decisions":[{"title":"Applicant sign-in","decision":"Applicants sign in with Alberta.ca Account.","reason":"Applicants need to return to saved drafts."}]}}}},"responses":{"200":{"description":"Solution updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}},"delete":{"tags":["Solution"],"summary":"Deletes a solution.","description":"Deletes a solution and its saved versions. Requires the planner-user or planner-admin role in the tenant of the token, and only the user who created the solution can delete it; other users, including planner-admin, receive 403. Sends a `solution-deleted` event.\n","responses":{"200":{"description":"Deletion result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionDeleteResult"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/analyze":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"post":{"tags":["Solution"],"summary":"Analyzes a solution.","description":"Extracts concepts, matches patterns, and generates hypotheses and next steps for the problem statement. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 400 if neither `text` nor the solution has a problem statement. Sends a `solution-updated` event.\n","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":20000,"description":"Problem statement to analyze; replaces the solution's. Defaults to the solution's problem statement."},"mode":{"$ref":"#/components/schemas/AnalysisMode"},"checkpoint":{"$ref":"#/components/schemas/Checkpoint"}}},"example":{"text":"Applicants apply for a small business grant. Staff review each application and decide.","mode":"rules"}}}},"responses":{"200":{"description":"Analyzed solution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/blueprint":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"post":{"tags":["Solution"],"summary":"Generates the project blueprint.","description":"Generates the complete project blueprint: architecture, ADSP service mapping, components to set up, specialist notes, workflows, data and governance, delivery, and acceptance criteria. Saved consultations are reused. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 400 if the solution hasn't been analyzed. Sends `solution-updated` events.\n","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/AnalysisMode"},"refreshConsultations":{"type":"boolean","description":"Run fresh specialist consultations instead of reusing saved ones."},"checkpoint":{"$ref":"#/components/schemas/Checkpoint"}}},"example":{"mode":"ai","refreshConsultations":false}}}},"responses":{"200":{"description":"The solution with state.blueprint populated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/chat":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"post":{"tags":["Solution"],"summary":"Sends a message to the planner about a solution.","description":"Sends a message to the planner. The analysis is refined using the message, the answers, and the conversation so far, and the message and the planner's reply are appended to `state.conversation`. The response is the updated solution as JSON, not a stream. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Sends a `solution-updated` event.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":20000,"description":"Trimmed before validation."},"mode":{"$ref":"#/components/schemas/AnalysisMode"}},"required":["message"]},"example":{"message":"Applicants can also appeal a decision.","mode":"ai"}}}},"responses":{"200":{"description":"The solution with the refined analysis and the reply in state.conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/components/{order}/review":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"},{"name":"order","in":"path","required":true,"description":"The component's order in the blueprint.","schema":{"type":"integer","minimum":1},"example":1}],"put":{"tags":["Solution"],"summary":"Records the review of a blueprint component.","description":"Records the user's review of a blueprint component. Rejected components are left out of the export. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 404 if the blueprint has no component with the order. Sends a `solution-updated` event.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["review"],"properties":{"review":{"type":"string","enum":["not-reviewed","approved","rejected"]}}},"example":{"review":"approved"}}}},"responses":{"200":{"description":"The solution with the component's review updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/consult/{service}":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"},{"$ref":"#/components/parameters/PlannerSpecialistService"}],"post":{"tags":["Solution","Specialist"],"summary":"Consults a service specialist about a solution.","description":"Consults a service specialist about fit, questions, dependencies, and risks, and records the exchange in the caller's chat with the specialist. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 404 for an unknown specialist, and 400 when the chat is full (200 messages). Sends a `solution-updated` event.\n","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","maxLength":2000},"proposal":{"type":"string","maxLength":5000,"description":"A plan for the specialist to validate."},"mode":{"$ref":"#/components/schemas/AnalysisMode"}}},"example":{"question":"Can applicants save a draft and return later?","mode":"ai"}}}},"responses":{"200":{"description":"Consultation result and the updated solution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultResult"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/discovery":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"post":{"tags":["Solution"],"summary":"Advances the discovery conversation.","description":"Advances the discovery conversation. The planner replies with clarifying questions and scores six factors; the solution is analyzed and presented once confidence reaches 75% and every factor is at least 40%, or when `force` is set. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 400 if the solution has no problem statement. Sends a `solution-updated` event.\n","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":20000,"description":"The user's reply to the planner's questions. Trimmed before validation."},"mode":{"$ref":"#/components/schemas/AnalysisMode"},"force":{"type":"boolean","description":"Present the solution regardless of confidence."},"restart":{"type":"boolean","description":"Clear the discovery thread and start over."}}},"example":{"message":"Small businesses apply online. Program staff review and approve each application."}}}},"responses":{"200":{"description":"The solution with state.discovery and state.confidence updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Solution"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/export":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"get":{"tags":["Solution"],"summary":"Downloads a solution.","description":"Downloads the current solution as a JSON attachment (`Content-Disposition: attachment; filename=\"planner-{id}.json\"`), including unsaved changes and the user's specialist chats about it. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin.\n","responses":{"200":{"description":"JSON attachment.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"planner-5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70.json\""}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionExport"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/versions":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"get":{"tags":["Solution"],"summary":"Retrieves the saved versions of a solution.","description":"Retrieves the saved versions of a solution, newest first, and whether the solution has unsaved changes. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin.\n","responses":{"200":{"description":"Versions retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionVersionList"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/versions/checkpoint":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"}],"post":{"tags":["Solution"],"summary":"Saves a version of a solution.","description":"Saves a new version of the solution if it changed since the latest saved version; otherwise returns the latest version. Use it after a series of calls made with `checkpoint` false. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Sends a `solution-updated` event when a version is saved.\n","responses":{"200":{"description":"The saved, or latest, version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionVersionSummary"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/versions/{number}":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"},{"$ref":"#/components/parameters/PlannerVersionNumber"}],"patch":{"tags":["Solution"],"summary":"Renames a saved version.","description":"Renames a saved version of a solution. Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 404 if the version doesn't exist. Sends a `solution-updated` event.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"New name, trimmed. An empty name resets it to `Version {number}`."}},"required":["name"]},"example":{"name":"Before review"}}}},"responses":{"200":{"description":"Version renamed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionVersionSummary"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/solutions/{id}/versions/{number}/export":{"parameters":[{"$ref":"#/components/parameters/PlannerSolutionId"},{"$ref":"#/components/parameters/PlannerVersionNumber"}],"get":{"tags":["Solution"],"summary":"Downloads a saved version of a solution.","description":"Downloads a saved version as a JSON attachment (`Content-Disposition: attachment; filename=\"planner-{id}-v{number}.json\"`). Requires the planner-user or planner-admin role in the tenant of the token, and the user must have created the solution or be a planner-admin. Responds 404 if the version doesn't exist.\n","responses":{"200":{"description":"JSON attachment.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"planner-5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70-v2.json\""}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionExport"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/specialists":{"get":{"tags":["Specialist"],"summary":"Retrieves the service specialists.","description":"Retrieves the service specialists known to the planner. The list is the same for every tenant. Requires the planner-user or planner-admin role in the tenant of the token.\n","responses":{"200":{"description":"Specialists retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpecialistList"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/specialists/chats":{"get":{"tags":["Specialist"],"summary":"Lists the caller's saved specialist chats.","description":"Lists the specialist chats of the calling user in the tenant of the token. Chats are private: planner-admin doesn't see other users' chats. Requires the planner-user or planner-admin role.\n","parameters":[{"$ref":"#/components/parameters/PlannerChatService"},{"$ref":"#/components/parameters/PlannerChatSolutionId"}],"responses":{"200":{"description":"Chat summaries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpecialistChatSummaryList"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/specialists/chats/export":{"get":{"tags":["Specialist"],"summary":"Downloads the caller's saved chats.","description":"Downloads the full history of the calling user's specialist chats as a JSON attachment (`Content-Disposition: attachment; filename=\"planner-specialist-chats.json\"`). Requires the planner-user or planner-admin role in the tenant of the token.\n","parameters":[{"$ref":"#/components/parameters/PlannerChatService"},{"$ref":"#/components/parameters/PlannerChatSolutionId"}],"responses":{"200":{"description":"JSON attachment.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"planner-specialist-chats.json\""}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpecialistChatsExport"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"}}}},"/planner/v1/specialists/chats/{chatId}":{"parameters":[{"$ref":"#/components/parameters/PlannerChatId"}],"get":{"tags":["Specialist"],"summary":"Retrieves a saved chat.","description":"Retrieves a saved chat of the calling user, with its full history. Requires the planner-user or planner-admin role in the tenant of the token. Chats of other users respond 404.\n","responses":{"200":{"description":"The chat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpecialistChat"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}},"delete":{"tags":["Specialist"],"summary":"Deletes a saved chat.","description":"Deletes a saved chat of the calling user. Requires the planner-user or planner-admin role in the tenant of the token. Chats of other users respond 404.\n","responses":{"204":{"description":"Deleted."},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/specialists/chats/{chatId}/export":{"parameters":[{"$ref":"#/components/parameters/PlannerChatId"}],"get":{"tags":["Specialist"],"summary":"Downloads a saved chat.","description":"Downloads a saved chat of the calling user as a JSON attachment (`Content-Disposition: attachment; filename=\"planner-chat-{chatId}.json\"`). Requires the planner-user or planner-admin role in the tenant of the token. Chats of other users respond 404.\n","responses":{"200":{"description":"JSON attachment.","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"planner-chat-b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b.json\""}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpecialistChatExport"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}},"/planner/v1/specialists/{service}/chat":{"parameters":[{"$ref":"#/components/parameters/PlannerSpecialistService"}],"post":{"tags":["Specialist"],"summary":"Converses directly with a service specialist.","description":"Converses with a service specialist (ask, recommend, design, validate, or sample code), without a planner session. The exchange is saved to the caller's chat history, which is private to the caller. Requires the planner-user or planner-admin role in the tenant of the token. With `solutionId`, the user must have created the solution or be a planner-admin. Responds 404 for an unknown specialist, chat, or solution, and 400 when the chat belongs to another specialist or is full (200 messages).\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","minLength":1,"maxLength":5000,"description":"Trimmed before validation."},"chatId":{"type":"string","format":"uuid","description":"Continue a saved chat; omit to start a new one."},"intent":{"type":"string","enum":["ask","recommend","design","validate","sample"],"default":"ask"},"solutionId":{"type":"string","format":"uuid","description":"Give the specialist the context of a solution. Ignored when the chat has a solution."},"mode":{"$ref":"#/components/schemas/AnalysisMode"}}},"example":{"message":"Do applicants need to sign in?","intent":"ask","solutionId":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70"}}}},"responses":{"200":{"description":"Specialist reply, including the chatId of the saved chat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpecialistChatReply"}}}},"400":{"$ref":"#/components/responses/PlannerBadRequest"},"401":{"$ref":"#/components/responses/PlannerUnauthorized"},"403":{"$ref":"#/components/responses/PlannerForbidden"},"404":{"$ref":"#/components/responses/PlannerNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"PlannerChatId":{"name":"chatId","description":"ID of the saved specialist chat.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b"},"PlannerChatService":{"name":"service","description":"Only include chats with the specialist of this service.","in":"query","required":false,"schema":{"type":"string"},"example":"form-service"},"PlannerChatSolutionId":{"name":"solutionId","description":"Only include chats about this solution.","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"example":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70"},"PlannerPatternId":{"name":"patternId","description":"ID of the business pattern, for example a built-in pattern such as `case-management`.","in":"path","required":true,"schema":{"type":"string"},"example":"case-management"},"PlannerSolutionId":{"name":"id","description":"ID of the solution.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70"},"PlannerSpecialistService":{"name":"service","description":"Service of the specialist, as returned by `GET /planner/v1/specialists`.","in":"path","required":true,"schema":{"type":"string"},"example":"form-service"},"PlannerVersionNumber":{"name":"number","description":"Number of the saved version. Versions are numbered from 1.","in":"path","required":true,"schema":{"type":"integer","minimum":1},"example":2}},"responses":{"PlannerBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation. Also returned when there is no tenant context, which is the case for core (platform) users that don't set a tenant.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlannerError"},"example":{"errorMessage":"Validation failed with error(s): id (params) - Invalid value"}}}},"PlannerForbidden":{"description":"User does not have the role required for the operation in the tenant, or is not permitted to act on the solution. Core (platform) users are not granted access.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlannerError"},"example":{"errorMessage":"User Test User (ID: 0d7c3f5e-1b2a-4c6d-8e9f-0a1b2c3d4e5f) not permitted to access planner."}}}},"PlannerNotFound":{"description":"Resource not found, or it belongs to another tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlannerError"},"example":{"errorMessage":"solution with ID '5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70' could not be found."}}}},"PlannerUnauthorized":{"description":"Request does not include a valid bearer token.","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}}},"schemas":{"AnalysisMode":{"type":"string","enum":["ai","rules"],"description":"Analysis mode. Defaults to `ai` when a model is configured, otherwise `rules`. When AI is requested but isn't available or fails, the rule-based result is used and a warning is recorded.\n"},"AnalysisOptions":{"type":"object","properties":{"modes":{"type":"array","description":"Analysis modes available. `ai` is only available when a model is configured.","items":{"type":"string","enum":["ai","rules"]}},"defaultMode":{"type":"string","enum":["ai","rules"]},"model":{"type":"string","description":"Name of the configured model. Absent when AI analysis isn't configured."}},"example":{"modes":["ai","rules"],"defaultMode":"ai","model":"GOA-Default"}},"BusinessPattern":{"allOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,59}$"},"source":{"type":"string","readOnly":true,"enum":["built-in","customized","custom"],"description":"`built-in` patterns ship with the service, `customized` patterns are built-in patterns overridden by the tenant, and `custom` patterns are created by the tenant.\n"}}},{"$ref":"#/components/schemas/BusinessPatternInput"}],"example":{"id":"grant-application","source":"custom","name":"Grant application","description":"Applicants apply for funding, staff assess eligibility and award grants.","domainLanguage":["grant","applicant","funding","award"],"commonFeatures":["Online application","Eligibility assessment"],"strongSignals":[{"description":"Applicants apply for funding","keywords":["grant","funding"]}],"weakSignals":[],"serviceMappings":[{"service":"form-service","reason":"Collects the application."}],"clarifyingQuestions":["Who assesses the applications?"],"assumptions":[],"knownUnknowns":[]}},"BusinessPatternInput":{"type":"object","description":"Business pattern. Text fields are trimmed; strings in lists are truncated to 500 characters and fields that aren't listed are ignored.\n","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":2000},"domainLanguage":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string"}},"commonFeatures":{"type":"array","maxItems":50,"items":{"type":"string"}},"strongSignals":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Signal"}},"weakSignals":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/Signal"}},"serviceMappings":{"type":"array","minItems":1,"maxItems":30,"items":{"type":"object","properties":{"service":{"type":"string","description":"Service of an ADSP specialist, as returned by `GET /planner/v1/specialists`."},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["service","reason"]}},"clarifyingQuestions":{"type":"array","maxItems":50,"items":{"type":"string"}},"assumptions":{"type":"array","maxItems":50,"items":{"type":"string"}},"knownUnknowns":{"type":"array","maxItems":50,"items":{"type":"string"}}},"required":["name","domainLanguage","strongSignals","serviceMappings"]},"Checkpoint":{"type":"boolean","default":true,"description":"Set false to skip auto-saving a version, for example when more calls will follow in the same action."},"ConsultResult":{"type":"object","properties":{"service":{"type":"string"},"fit":{"type":"string","enum":["recommended","optional","not-indicated"]},"reason":{"type":"string"},"questions":{"type":"array","items":{"type":"string"}},"dependencies":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string"},"satisfied":{"type":"boolean"}}}},"risks":{"type":"array","items":{"type":"string"}},"advice":{"type":"string","description":"Present when the AI specialist contributed guidance."},"supports":{"type":"array","items":{"type":"string"}},"constraints":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","description":"Present when a `proposal` was validated.","properties":{"verdict":{"type":"string","enum":["sound","needs-changes","not-a-fit"]},"findings":{"type":"array","items":{"type":"string"}}}},"solution":{"$ref":"#/components/schemas/Solution"}},"example":{"service":"form-service","fit":"recommended","reason":"Recommended by the leading hypothesis to collect applications.","questions":["Who completes the form","and is authentication required?"],"dependencies":[{"service":"file-service","satisfied":false}],"risks":["Forms that collect attachments need file types configured first."],"solution":{"id":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70","name":"Small business grant","status":"analyzed","version":3}}},"ConversationMessage":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"at":{"type":"string","format":"date-time"}}},"ExtractedText":{"type":"object","properties":{"text":{"type":"string","description":"Text extracted from the file, to use as the problem statement."}},"example":{"text":"Applicants apply for a small business grant. Staff review each application and decide on the award."}},"PatternList":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BusinessPattern"}}},"example":{"results":[{"id":"case-management","source":"built-in","name":"Case management","description":"Staff manage cases through intake, assessment and decision.","domainLanguage":["case","caseworker","intake"],"commonFeatures":["Case intake","Assignment"],"strongSignals":[{"description":"Staff work cases through a lifecycle","keywords":["case","caseworker"]}],"weakSignals":[],"serviceMappings":[{"service":"form-service","reason":"Collects intake information."}],"clarifyingQuestions":["Who works the cases?"],"assumptions":[],"knownUnknowns":[]}]}},"PatternMatch":{"type":"object","properties":{"patternId":{"type":"string"},"patternName":{"type":"string"},"score":{"type":"number","description":"Each matched domain term counts 1 and each strong signal counts 2."},"level":{"type":"string","enum":["high","medium","low"]},"matchedLanguage":{"type":"array","items":{"type":"string"}},"matchedSignals":{"type":"array","items":{"type":"string"}},"explanation":{"type":"string"}}},"PatternMatchResult":{"type":"object","properties":{"matches":{"type":"array","description":"Matches ranked by score, highest first.","items":{"$ref":"#/components/schemas/PatternMatch"}},"questions":{"type":"array","description":"Clarifying questions of the best match when its confidence is low; otherwise empty.","items":{"type":"string"}}},"example":{"matches":[{"patternId":"case-management","patternName":"Case management","score":4,"level":"medium","matchedLanguage":["case","caseworker"],"matchedSignals":["Staff work cases through a lifecycle"],"explanation":"Matched 2 domain terms and 1 strong signal."}],"questions":[]}},"PlannerError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"PlannerTenantId":{"type":"object","readOnly":true,"description":"The tenant ID, serialized as its URN parts.","properties":{"type":{"type":"string"},"namespace":{"type":"string"},"service":{"type":"string"},"api":{"type":"string"},"resource":{"type":"string"}},"example":{"type":"resource","namespace":"platform","service":"tenant-service","api":"v2","resource":"/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"Signal":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"keywords":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string"}}},"required":["description","keywords"]},"Solution":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"tenantId":{"$ref":"#/components/schemas/PlannerTenantId"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"scenario":{"type":"string","enum":["new","prototype","existing-app","reconfigure"]},"status":{"type":"string","enum":["draft","analyzed","in-progress","completed","archived"]},"createdById":{"type":"string","readOnly":true},"createdByName":{"type":"string","readOnly":true},"createdOn":{"type":"string","format":"date-time","readOnly":true},"updatedOn":{"type":"string","format":"date-time","readOnly":true},"version":{"type":"integer","readOnly":true,"description":"Number of the latest saved version."},"state":{"$ref":"#/components/schemas/SolutionState"}},"example":{"id":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70","tenantId":{"type":"resource","namespace":"platform","service":"tenant-service","api":"v2","resource":"/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"name":"Small business grant","description":"Online applications for the small business grant.","scenario":"new","status":"analyzed","createdById":"0d7c3f5e-1b2a-4c6d-8e9f-0a1b2c3d4e5f","createdByName":"Test User","createdOn":"2026-10-01T15:04:05.000Z","updatedOn":"2026-10-01T15:20:00.000Z","version":2,"state":{"problemStatement":"Applicants apply for a small business grant. Staff review each application and decide.","concepts":[{"id":"9c1d2e3f-4a5b-4c6d-8e7f-a1b2c3d4e5f6","type":"actor","name":"Applicant","source":"extracted"}],"decisions":[],"questions":[{"id":"3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7","question":"Who assesses the applications?","raisedBy":"planner","status":"open"}],"patternMatches":[],"hypotheses":[],"specialists":[],"nextSteps":[],"analysis":{"mode":"rules","analyzedOn":"2026-10-01T15:20:00.000Z"}}}},"SolutionDeleteResult":{"type":"object","properties":{"deleted":{"type":"boolean"}},"example":{"deleted":true}},"SolutionExport":{"type":"object","description":"A solution, or one of its saved versions, for download. Components the user rejected in the blueprint are left out of `state.blueprint.components`.\n","properties":{"exportedAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"scenario":{"type":"string"},"status":{"type":"string"},"createdByName":{"type":"string"},"createdOn":{"type":"string","format":"date-time"},"version":{"type":"integer","description":"Number of the exported version, or of the latest saved version when there are unsaved changes."},"versionName":{"type":"string"},"unsavedChanges":{"type":"boolean","description":"True when the export includes changes made since the latest saved version."},"lastUpdated":{"type":"string","format":"date-time"},"updatedOn":{"type":"string","format":"date-time"},"initial":{"type":"boolean","description":"True for the first version."},"changedSections":{"type":"array","description":"Sections changed since the previous version.","items":{"type":"string"}},"blueprintOutOfDate":{"type":"boolean"},"specialistChats":{"type":"array","items":{"type":"object"}},"state":{"$ref":"#/components/schemas/SolutionState"}},"example":{"exportedAt":"2026-10-02T09:00:00.000Z","id":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70","name":"Small business grant","description":"Online applications for the small business grant.","scenario":"new","status":"analyzed","createdByName":"Test User","createdOn":"2026-10-01T15:04:05.000Z","version":2,"versionName":"Version 2","unsavedChanges":false,"lastUpdated":"2026-10-01T15:20:00.000Z","updatedOn":"2026-10-01T15:20:00.000Z","initial":false,"changedSections":["Problem statement","Analysis"],"blueprintOutOfDate":false,"specialistChats":[],"state":{"problemStatement":"Applicants apply for a small business grant. Staff review each application and decide.","concepts":[],"decisions":[],"questions":[],"patternMatches":[],"hypotheses":[],"specialists":[],"nextSteps":[]}}},"SolutionList":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Solution"}},"page":{"type":"object","properties":{"after":{"type":"string"},"next":{"type":"string","description":"Cursor for the next page. Pass it as `after` to read the next page."},"size":{"type":"integer"}}}},"example":{"results":[{"id":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70","tenantId":{"type":"resource","namespace":"platform","service":"tenant-service","api":"v2","resource":"/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"name":"Small business grant","scenario":"new","status":"draft","createdById":"0d7c3f5e-1b2a-4c6d-8e9f-0a1b2c3d4e5f","createdByName":"Test User","createdOn":"2026-10-01T15:04:05.000Z","updatedOn":"2026-10-01T15:04:05.000Z","version":1,"state":{"problemStatement":"Applicants apply for a small business grant.","concepts":[],"decisions":[],"questions":[],"patternMatches":[],"hypotheses":[],"specialists":[],"nextSteps":[]}}],"page":{"next":"MTA=","size":1}}},"SolutionState":{"type":"object","description":"Structured state of the planning work. Most of it is produced by the planner: analysis, discovery, blueprint, pattern matches, hypotheses and next steps.\n","properties":{"problemStatement":{"type":"string"},"problemStatementUpdatedOn":{"type":"string","format":"date-time"},"concepts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["actor","goal","activity","decision","evidence","business-rule","constraint","evaluation-criterion","workflow","outcome","document","event","external-system","assumption","unknown"]},"name":{"type":"string"},"description":{"type":"string"},"source":{"type":"string","enum":["user","extracted","pattern","assumed"]}}}},"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"decision":{"type":"string"},"reason":{"type":"string"},"decidedOn":{"type":"string","format":"date-time"},"decidedBy":{"type":"string"}}}},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"raisedBy":{"type":"string"},"status":{"type":"string","enum":["open","answered"]},"answer":{"type":"string"}}}},"patternMatches":{"type":"array","items":{"$ref":"#/components/schemas/PatternMatch"}},"hypotheses":{"type":"array","items":{"type":"object"}},"specialists":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string"},"status":{"type":"string","enum":["not-started","consulted","in-workspace","completed"]},"updatedOn":{"type":"string","format":"date-time"}}}},"nextSteps":{"type":"array","items":{"type":"object"}},"analysis":{"type":"object","properties":{"mode":{"type":"string","enum":["ai","rules"]},"model":{"type":"string"},"warning":{"type":"string","description":"Set when AI analysis was requested but the rule-based fallback produced the result."},"analyzedOn":{"type":"string","format":"date-time"}}},"conversation":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessage"}},"discovery":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessage"}},"confidence":{"type":"number","minimum":0,"maximum":100},"threshold":{"type":"number"},"factors":{"type":"array","items":{"type":"object"}},"ready":{"type":"boolean"},"mode":{"type":"string","enum":["ai","rules"]},"warning":{"type":"string"},"updatedOn":{"type":"string","format":"date-time"}}},"blueprint":{"type":"object","description":"The project blueprint, set by `POST /planner/v1/solutions/{id}/blueprint`."},"confidence":{"type":"object","properties":{"score":{"type":"number"},"threshold":{"type":"number"},"factors":{"type":"array","items":{"type":"object"}}}}}},"SolutionVersionList":{"type":"object","properties":{"latest":{"type":"integer","description":"Number of the latest saved version."},"unsavedChanges":{"type":"boolean","description":"True when the solution has changed since the latest saved version."},"results":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer"},"name":{"type":"string"},"createdOn":{"type":"string","format":"date-time"},"changedSections":{"type":"array","items":{"type":"string"}}}}}},"example":{"latest":2,"unsavedChanges":false,"results":[{"number":2,"name":"Version 2","createdOn":"2026-10-01T15:20:00.000Z","changedSections":["Problem statement","Analysis"]},{"number":1,"name":"Version 1","createdOn":"2026-10-01T15:04:05.000Z","changedSections":[]}]}},"SolutionVersionSummary":{"type":"object","properties":{"number":{"type":"integer","minimum":1},"name":{"type":"string"},"createdOn":{"type":"string","format":"date-time"}},"example":{"number":2,"name":"Before review","createdOn":"2026-10-01T15:20:00.000Z"}},"Specialist":{"type":"object","properties":{"service":{"type":"string"},"displayName":{"type":"string"},"purpose":{"type":"string"},"workspacePath":{"type":"string","description":"Path of the service's workspace in tenant admin."},"questions":{"type":"array","items":{"type":"string"}},"dependsOn":{"type":"array","items":{"type":"string"}},"risks":{"type":"array","items":{"type":"string"}},"order":{"type":"integer"}}},"SpecialistChat":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"service":{"type":"string"},"solutionId":{"type":"string","format":"uuid"},"title":{"type":"string"},"createdByName":{"type":"string"},"createdOn":{"type":"string","format":"date-time"},"updatedOn":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/StoredChatMessage"}}},"example":{"id":"b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b","service":"form-service","solutionId":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70","title":"Do applicants need to sign in?","createdByName":"Test User","createdOn":"2026-10-01T15:04:05.000Z","updatedOn":"2026-10-01T15:05:00.000Z","messages":[{"role":"user","content":"Do applicants need to sign in?","at":"2026-10-01T15:04:05.000Z","intent":"ask"},{"role":"assistant","content":"Applicants can complete the form anonymously, but drafts need a signed-in user.","at":"2026-10-01T15:04:06.000Z","intent":"ask","mode":"ai","model":"GOA-Default"}]}},"SpecialistChatExport":{"allOf":[{"type":"object","properties":{"exportedAt":{"type":"string","format":"date-time"}}},{"$ref":"#/components/schemas/SpecialistChat"}],"example":{"exportedAt":"2026-10-02T09:00:00.000Z","id":"b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b","service":"form-service","title":"Do applicants need to sign in?","createdByName":"Test User","createdOn":"2026-10-01T15:04:05.000Z","updatedOn":"2026-10-01T15:05:00.000Z","messages":[{"role":"user","content":"Do applicants need to sign in?","at":"2026-10-01T15:04:05.000Z","intent":"ask"}]}},"SpecialistChatReply":{"type":"object","properties":{"chatId":{"type":"string","format":"uuid","description":"ID of the saved chat. Pass it as `chatId` to continue the conversation."},"service":{"type":"string"},"mode":{"type":"string","enum":["ai","rules"]},"model":{"type":"string"},"warning":{"type":"string","description":"Set when AI was requested but a rule-based reply was given."},"reply":{"type":"string"},"suggestions":{"type":"array","items":{"type":"string"}},"samples":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"}}}},"validation":{"type":"object","properties":{"verdict":{"type":"string"},"findings":{"type":"array","items":{"type":"string"}}}},"followUps":{"type":"array","items":{"type":"string"}},"solution":{"allOf":[{"$ref":"#/components/schemas/Solution"}],"description":"The updated solution, when the exchange changed the solution's discovery confidence."}},"example":{"chatId":"b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b","service":"form-service","mode":"rules","reply":"Here is what this service is for and what to settle first.\n\nForm service: Form definitions, drafts, submissions, and review dispositions.","suggestions":["Forms that collect attachments need file types configured first."],"samples":[],"followUps":["Who completes the form","and is authentication required?"]}},"SpecialistChatSummaryList":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"service":{"type":"string"},"solutionId":{"type":"string","format":"uuid"},"title":{"type":"string"},"createdOn":{"type":"string","format":"date-time"},"updatedOn":{"type":"string","format":"date-time"},"messageCount":{"type":"integer"}}}}},"example":{"results":[{"id":"b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b","service":"form-service","solutionId":"5f0a1c52-7d0e-4c1b-9a8e-3b6f2d1e4a70","title":"Do applicants need to sign in?","createdOn":"2026-10-01T15:04:05.000Z","updatedOn":"2026-10-01T15:05:00.000Z","messageCount":2}]}},"SpecialistChatsExport":{"type":"object","properties":{"exportedAt":{"type":"string","format":"date-time"},"chats":{"type":"array","items":{"$ref":"#/components/schemas/SpecialistChat"}}},"example":{"exportedAt":"2026-10-02T09:00:00.000Z","chats":[{"id":"b7e2f6a1-4c3d-4e8f-9a1b-2c3d4e5f6a7b","service":"form-service","title":"Do applicants need to sign in?","createdByName":"Test User","createdOn":"2026-10-01T15:04:05.000Z","updatedOn":"2026-10-01T15:05:00.000Z","messages":[{"role":"user","content":"Do applicants need to sign in?","at":"2026-10-01T15:04:05.000Z","intent":"ask"}]}]}},"SpecialistList":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Specialist"}}},"example":{"results":[{"service":"form-service","displayName":"Form service","purpose":"Form definitions, drafts, submissions, and review dispositions.","workspacePath":"/admin/services/form","questions":["Who completes the form","and is authentication required?"],"dependsOn":["file-service"],"risks":["Forms that collect attachments need file types configured first."],"order":3}]}},"StoredChatMessage":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"at":{"type":"string","format":"date-time"},"intent":{"type":"string"},"mode":{"type":"string","enum":["ai","rules"]},"model":{"type":"string"},"warning":{"type":"string"},"suggestions":{"type":"array","items":{"type":"string"}},"followUps":{"type":"array","items":{"type":"string"}}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Solution","description":"Managing solutions and the planner workflow"},{"name":"Pattern","description":"Business patterns known to the planner"},{"name":"Specialist","description":"Service specialists the planner consults"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Push service","version":"0.0.0","description":"The push service is a gateway for push mode connections to projections of domain events. Server side events and WebSockets are supported."},"paths":{"/stream/v1/streams":{"get":{"tags":["Stream"],"description":"Retrieves the streams that the caller can subscribe to, keyed by stream ID. The result combines the tenant's streams with the streams in the core (platform) configuration; when both have a stream with the same ID, the core stream is used. Core streams listed for a tenant only include that tenant's events.\n\nAny caller can list streams, including anonymous callers, but the result only includes streams the caller can subscribe to: public streams (`publicSubscribe`), and streams for which the caller has the `stream-listener` role or one of the stream's `subscriberRoles`. Those roles must be held in the stream's tenant, or by a core user.\n\nThe tenant is the `tenant` parameter if it is set, otherwise the tenant of the caller's token. Without either, the request responds 400.\n","parameters":[{"$ref":"#/components/parameters/PushStreamsTenant"}],"responses":{"200":{"description":"Streams that the caller can subscribe to, keyed by stream ID.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Stream"}},"example":{"application-health":{"id":"application-health","name":"Application health","description":"Events indicating the health of my applications.","publicSubscribe":false,"subscriberRoles":["urn:ads:my-tenant:my-app:health-reader"],"events":[{"namespace":"status-service","name":"health-check-started"}]}}}}},"400":{"$ref":"#/components/responses/PushBadRequest"}}}},"/stream/v1/streams/{stream}":{"get":{"tags":["Stream"],"description":"Subscribes to a stream using server-sent events. The response stays open, and each domain event that matches the stream and the `criteria` parameter is sent as a `data:` line holding the JSON stream item. Messages use the default `message` event type.\n\nThe caller must be allowed to subscribe to the stream: the stream is public (`publicSubscribe`), or the caller has the `stream-listener` role or one of the stream's `subscriberRoles`, held in the stream's tenant or by a core user. Anonymous callers can only subscribe to public streams.\n\nThe tenant is the tenant named in the `tenant` parameter, otherwise the tenant of the caller's token. Anonymous and tenant callers without either receive 400. A core user without a tenant subscribes to a cross-tenant stream from the core configuration, which needs the `stream-listener` role or one of the stream's `subscriberRoles`, and includes matching events from every tenant.\n\nThe access token is read from the `Authorization` header. Browser `EventSource` cannot set headers, so use an `EventSource` polyfill that can, or use socket.io (see the push service guide).\n","parameters":[{"in":"path","required":true,"name":"stream","description":"ID of the stream to subscribe to.","schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"application-health"},{"$ref":"#/components/parameters/PushStreamTenant"},{"in":"query","name":"criteria","required":false,"description":"JSON encoded criteria. Only stream items that match every criterion are sent. Must be valid JSON.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamEventCriteria"},"example":{"context":{"applicationId":"64b1f2e3a8c9b1d2e3f4a5b6"}}}}}],"responses":{"200":{"description":"Subscribed. The response is a stream of server-sent events, one per stream item.","content":{"text/event-stream":{"schema":{"type":"string","description":"Server-sent events. Each event is a `data:` line with a JSON stream item (see the StreamItem schema), followed by a blank line.\n"},"example":"data: {\"tenantId\":\"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7\",\"namespace\":\"status-service\",\"name\":\"health-check-started\",\"timestamp\":\"2026-10-01T15:04:05.000Z\",\"correlationId\":\"64b1f2e3a8c9b1d2e3f4a5b6\",\"context\":{\"applicationId\":\"64b1f2e3a8c9b1d2e3f4a5b6\"},\"payload\":{\"application\":{\"id\":\"64b1f2e3a8c9b1d2e3f4a5b6\",\"name\":\"My application\"}}}\n"}}},"400":{"$ref":"#/components/responses/PushBadRequest"},"404":{"$ref":"#/components/responses/PushNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"PushStreamTenant":{"name":"tenant","description":"Name of the tenant that the stream belongs to, in kebab case (for example `my-tenant` for the tenant named \"My Tenant\"). When it matches a tenant, it is used for every caller. When it is not set or matches no tenant, the tenant of the caller's token is used. Required for anonymous callers. A core (platform) caller who leaves it out connects to a cross-tenant stream configured in the core configuration.\n","in":"query","required":false,"schema":{"type":"string"},"example":"my-tenant"},"PushStreamsTenant":{"name":"tenant","description":"ID of the tenant to list streams for: the last segment of the tenant URN, for example `61f2e3a8c9b1d2e3f4a5b6c7` for `urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7`. When it is set, it is used for every caller. When it is not set, the tenant of the caller's token is used. Required for anonymous and core (platform) callers.\n","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-zA-Z0-9]+$"},"example":"61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"PushBadRequest":{"description":"No tenant context. The request has no tenant and the caller's token is not for a tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushError"},"example":{"errorMessage":"No tenant specified for request."}}}},"PushNotFound":{"description":"The stream is not configured for the tenant, or in the core configuration. Streams of another tenant are only found when that tenant is named in the `tenant` parameter.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushError"},"example":{"errorMessage":"stream with ID 'application-updates' could not be found."}}}}},"schemas":{"PushError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"Stream":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/StreamEvent"}},"subscriberRoles":{"type":"array","description":"Roles that allow a user of the stream's tenant to subscribe, in addition to the `stream-listener` role.\n","items":{"type":"string"}},"publicSubscribe":{"type":"boolean","description":"Whether anyone, including anonymous callers, can subscribe."}},"required":["id","name","events","subscriberRoles"],"example":{"id":"application-health","name":"Application health","description":"Events indicating the health of my applications.","publicSubscribe":false,"subscriberRoles":["urn:ads:my-tenant:my-app:health-reader"],"events":[{"namespace":"status-service","name":"health-check-started"},{"namespace":"status-service","name":"application-status-changed","map":{"application":"payload.application.name","status":"payload.newStatus"}}]}},"StreamEvent":{"type":"object","properties":{"namespace":{"type":"string","description":"Namespace of the domain event to include."},"name":{"type":"string","description":"Name of the domain event to include."},"map":{"type":"object","description":"Optional projection of the event. Each key is a property of the stream item, and each value is a path into the domain event (for example `payload.application.name`). When it is set, the stream item includes `tenantId`, `namespace`, `name`, `correlationId`, `context`, and the mapped properties only.\n","additionalProperties":{"type":"string"}},"criteria":{"$ref":"#/components/schemas/StreamEventCriteria"}},"required":["namespace","name"],"example":{"namespace":"status-service","name":"health-check-started","map":{"application":"payload.application.name"},"criteria":{"context":{"applicationId":"64b1f2e3a8c9b1d2e3f4a5b6"}}}},"StreamEventCriteria":{"type":"object","description":"Domain events are included only when they match every criterion that is set.","properties":{"correlationId":{"type":"string","description":"Correlation ID that the event must have."},"context":{"type":"object","description":"Context values that the event must have.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]}}},"example":{"correlationId":"application-1234","context":{"applicationId":"64b1f2e3a8c9b1d2e3f4a5b6"}}},"StreamItem":{"type":"object","description":"A domain event included in the stream. It is the full domain event, or the projection defined by the stream event's `map`. `tenantId` is the tenant URN.\n","properties":{"tenantId":{"type":"string"},"namespace":{"type":"string"},"name":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"correlationId":{"type":"string"},"context":{"type":"object"},"payload":{"type":"object"}},"additionalProperties":true,"required":["namespace","name"],"example":{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","namespace":"status-service","name":"health-check-started","timestamp":"2026-10-01T15:04:05.000Z","correlationId":"64b1f2e3a8c9b1d2e3f4a5b6","context":{"applicationId":"64b1f2e3a8c9b1d2e3f4a5b6"},"payload":{"application":{"id":"64b1f2e3a8c9b1d2e3f4a5b6","name":"My application","url":"https://my-application.alberta.ca"}}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Stream","description":"API to connect to streams."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Status service","version":"0.0.0","description":"The status service provides the capability to monitor the health of applications and services, and to\npublish _status_ information about them. Along with the Tenant Admin Webapp, it allows you to\n* manage which applications and services will be monitored,\n* control application monitoring,\n* access an application's published status,\n* manage public notices regarding the application's status.\n\nPlease use the [Tenant Admin Webapp](https://adsp.alberta.ca) to manage the applications and services\nthat you wish to be monitored. For more information on how the _Status Service_ works, please see the\n[Status Service tutorial](https://govalta.github.io/adsp-monorepo/tutorials/status-service/Introduction.html).\n"},"paths":{"/notice/v1/notices":{"get":{"tags":["Notices"],"description":"Retrieves notices, newest first. Anonymous requests are accepted.\n- Anonymous requests read published notices; set `name` to read only the notices of that tenant (the name must\n be the name of an existing tenant).\n\n- Authenticated tenant users read the published notices of the tenant of their token; `name` is ignored.\n- Users with the status-admin role read all notices of the tenant of their token, or the notices in `mode`.\n","security":[{},{"accessToken":[]}],"parameters":[{"name":"top","description":"Number of results to read.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":50,"example":10}},{"name":"after","description":"Number of results to skip, as returned in the _next_ query string of a previous page.","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"example":10}},{"name":"mode","description":"Mode of notices to read. Only used for users with the status-admin role; `active` reads all notices except archived ones.\n","in":"query","required":false,"schema":{"type":"string","enum":["active","draft","published","archived"]}},{"name":"name","description":"Name of the tenant to read published notices for (case insensitive). Only used for anonymous requests.","in":"query","required":false,"schema":{"type":"string"},"example":"my-tenant"}],"responses":{"200":{"description":"Notices successfully retrieved.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"description":"A list of notices that match the query","type":"array","items":{"$ref":"#/components/schemas/Notice"}},"page":{"$ref":"#/components/schemas/Page"}}},"example":{"results":[{"id":"6730c4f1a2b3c4d5e6f70812","message":"My Application will be down for weekly maintenance during the following hours.","tennantServRef":[{"id":"my-application","name":"My Application"}],"isAllApplications":false,"startDate":"2026-11-15T02:00:00.000Z","endDate":"2026-11-15T04:00:00.000Z","mode":"published","created":"2026-11-10T16:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61e9adcc9423490012a9ae46","tenantName":"My Tenant"}],"page":{"after":0,"size":1,"next":null,"total":1}}}}}}},"post":{"tags":["Notices"],"description":"Creates a notice in draft mode for the tenant of the token. Requires the status-admin role.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message","tennantServRef","startDate","endDate"],"properties":{"message":{"type":"string"},"tennantServRef":{"description":"Applications the notice applies to. Send an empty array with isAllApplications set to true for all applications.","type":"array","items":{"$ref":"#/components/schemas/NoticeApplicationRef"}},"isAllApplications":{"type":"boolean","default":false},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"}}},"example":{"message":"My Application will be down for weekly maintenance during the following hours.","tennantServRef":[{"id":"my-application","name":"My Application"}],"isAllApplications":false,"startDate":"2026-11-15T02:00:00.000Z","endDate":"2026-11-15T04:00:00.000Z"}}}},"responses":{"201":{"description":"Notice successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notice"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"}}}},"/notice/v1/notices/{id}":{"parameters":[{"$ref":"#/components/parameters/StatusNoticeId"}],"get":{"tags":["Notices"],"description":"Retrieves a notice of the tenant of the token. Requires an authenticated tenant user; published notices can be read by any user of the tenant, and other notices require the status-admin role.\n","responses":{"200":{"description":"Notice successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notice"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}},"patch":{"tags":["Notices"],"description":"Updates a notice of the tenant of the token. Requires the status-admin role. All fields of a draft notice can be updated, and a draft notice can be published but not archived. Only the mode of a published notice can be updated, to archive it or return it to draft. Archived notices cannot be updated. Publishing a notice sends the application-notice-published event.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"tennantServRef":{"type":"array","items":{"$ref":"#/components/schemas/NoticeApplicationRef"}},"isAllApplications":{"type":"boolean"},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"},"mode":{"type":"string","enum":["draft","published","archived"]}}},"examples":{"edit":{"summary":"Edit a draft notice","value":{"message":"My Application will be down for maintenance during the following hours.","endDate":"2026-11-15T05:00:00.000Z"}},"publish":{"summary":"Publish a draft notice","value":{"mode":"published"}},"archive":{"summary":"Archive a published notice","value":{"mode":"archived"}}}}}},"responses":{"200":{"description":"Notice successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notice"}}}},"400":{"description":"The mode is not valid, or the change is not allowed for the current mode of the notice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusError"},"example":{"errorMessage":"Value not valid for Update notice: Archived notice cannot be updated."}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}},"delete":{"tags":["Notices"],"description":"Deletes a draft notice of the tenant of the token. Requires the status-admin role. Published and archived notices cannot be deleted and respond 401.\n","responses":{"200":{"description":"Notice successfully deleted. The response is the deleted notice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notice"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/public_status/v1/applications/{tenant}":{"get":{"tags":["Application Status"],"description":"Retrieves the applications of a tenant and their published statuses, sorted by name. Public; anonymous requests are accepted and any bearer token is ignored. The tenant is identified by name in the path.\n","security":[{}],"parameters":[{"name":"tenant","description":"Name of the tenant to retrieve applications for (case insensitive).","in":"path","required":true,"schema":{"type":"string"},"example":"my-tenant"}],"responses":{"200":{"description":"Successfully retrieved statuses.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Public-application"}}}}},"404":{"description":"Tenant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusError"},"example":{"errorMessage":"tenant with ID 'my-tenant' could not be found."}}}}}}},"/status/v1/applications":{"get":{"tags":["Application Monitoring"],"description":"Retrieves the applications of the tenant, with their statuses. Requires an authenticated tenant user; no specific role is required. The tenant is the tenant of the token; tokens without a tenant context respond 401.\n","responses":{"200":{"description":"Applications retrieved successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Application"}}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"}}},"post":{"tags":["Application Monitoring"],"description":"Adds an application to the tenant for monitoring. The application key is generated from the name (in kebab case) if it is not provided. Monitoring is not enabled until requested.\n\nRequires an authenticated tenant user; no specific role is required. The application is added to the tenant of the token.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApplicationInput"},{"type":"object","properties":{"appKey":{"type":"string","description":"Key of the application. Generated from the name if not set.","example":"my-application"},"status":{"type":"string","description":"Initial published status of the application.","enum":["operational","reported-issues","maintenance","outage"]}}}]},"example":{"name":"My Application","description":"Online application for a benefit program.","endpoint":{"url":"https://my-application.alberta.ca/health"},"monitorOnly":false,"status":"operational"}}}},"responses":{"201":{"description":"Application added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"},"example":{"appKey":"my-application","name":"My Application","description":"Online application for a benefit program.","monitorOnly":false,"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61e9adcc9423490012a9ae46","metadata":"","enabled":false,"statusTimestamp":null,"status":"operational","internalStatus":"stopped","endpoint":{"status":"offline","url":"https://my-application.alberta.ca/health"}}}}},"400":{"$ref":"#/components/responses/StatusBadRequest"},"401":{"$ref":"#/components/responses/StatusUnauthorized"}}}},"/status/v1/applications/endpoint-status-entries":{"get":{"tags":["Application Monitoring"],"description":"Retrieves the raw results of the health check _pings_ recorded in the last `ageInMinutes` minutes. Requires an authenticated tenant user; no specific role is required.\n","parameters":[{"name":"ageInMinutes","description":"Number of minutes to read results for.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":31,"example":20}}],"responses":{"200":{"description":"Data retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PingData"}}}}}}}},"/status/v1/applications/{appKey}":{"parameters":[{"$ref":"#/components/parameters/StatusAppKey"}],"put":{"tags":["Application Monitoring"],"description":"Replaces the configuration of an application. Send every field to keep; fields left out are removed. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApplicationInput"},{"type":"object","properties":{"autoChangeStatus":{"type":"boolean","description":"If true, health checks change the status from operational to reported-issues after failing for 5 minutes, and back to operational after succeeding for 5 minutes.\n"}}}]},"example":{"name":"My Application","description":"Online application for a benefit program.","endpoint":{"url":"https://my-application.alberta.ca/health"},"monitorOnly":false,"autoChangeStatus":true}}}},"responses":{"200":{"description":"Application updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}},"delete":{"tags":["Application Monitoring"],"description":"Deletes an application with its status and health check results, and stops monitoring it if monitoring is enabled. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","responses":{"204":{"description":"Application deleted."},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/status/v1/applications/{appKey}/disable":{"parameters":[{"$ref":"#/components/parameters/StatusAppKey"}],"patch":{"tags":["Application Monitoring"],"description":"Turns off monitoring of the application. Health checks stop when the service next reloads its health checks (every 5 minutes); use the toggle operation to stop them immediately. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","responses":{"200":{"description":"Monitoring has been disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/status/v1/applications/{appKey}/enable":{"parameters":[{"$ref":"#/components/parameters/StatusAppKey"}],"patch":{"tags":["Application Monitoring"],"description":"Turns on monitoring of the application. Health checks start when the service next reloads its health checks (every 5 minutes); use the toggle operation to start them immediately. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","responses":{"200":{"description":"Monitoring has been enabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/status/v1/applications/{appKey}/endpoint-status-entries":{"parameters":[{"$ref":"#/components/parameters/StatusAppKey"}],"get":{"tags":["Application Monitoring"],"description":"Retrieves the raw results of the health check _pings_ of the application, newest first. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","parameters":[{"name":"topValue","description":"Number of results to read.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":200,"example":20}}],"responses":{"200":{"description":"Data retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PingData"}}}}},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/status/v1/applications/{appKey}/status":{"parameters":[{"$ref":"#/components/parameters/StatusAppKey"}],"patch":{"tags":["Application Status"],"description":"Sets the published status of the application, and sends the application-status-changed event. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"description":"The published status to set.","type":"string","enum":["operational","reported-issues","maintenance","outage"]}}},"example":{"status":"maintenance"}}}},"responses":{"200":{"description":"Successfully updated status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/status/v1/applications/{appKey}/toggle":{"parameters":[{"$ref":"#/components/parameters/StatusAppKey"}],"patch":{"tags":["Application Monitoring"],"description":"Toggles monitoring of the application, from enabled to disabled or vice versa, and sends the health-check-started or health-check-stopped event that starts or stops the health checks. Requires an authenticated tenant user; no specific role is required. The application must belong to the tenant of the token.\n","responses":{"200":{"description":"Monitoring has been toggled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}},"/status/v1/webhook/{id}/test/{eventName}":{"get":{"tags":["Application Monitoring"],"description":"Sends a test monitored-service-down or monitored-service-up event to a webhook of a monitored application. The webhook is read from the push service configuration of the tenant. The response is sent after a 2 second delay. Requires an authenticated tenant user; no specific role is required. The webhook and its application must belong to the tenant of the token.\n","parameters":[{"name":"id","description":"ID of the webhook.","in":"path","required":true,"schema":{"type":"string"},"example":"my-application-webhook"},{"name":"eventName","description":"Event to send. monitored-service-down sends a service down event; any other value sends a service up event.\n","in":"path","required":true,"schema":{"type":"string"},"example":"monitored-service-down"}],"responses":{"200":{"description":"Test event sent. The response is a text summary of the event, including the application and webhook.","content":{"application/json":{"schema":{"type":"string"},"example":"event is sent - app: {\"appKey\":\"my-application\", ...}, user: {...}, webhook: {...}"}}},"401":{"$ref":"#/components/responses/StatusUnauthorized"},"404":{"$ref":"#/components/responses/StatusNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"StatusAppKey":{"name":"appKey","description":"Key of the application, as returned in `appKey` when the application was added.","in":"path","required":true,"schema":{"type":"string"},"example":"my-application"},"StatusNoticeId":{"name":"id","description":"ID of the notice.","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"example":"6730c4f1a2b3c4d5e6f70812"}},"schemas":{"Application":{"type":"object","properties":{"appKey":{"description":"A unique ID generated when the application is added to the Status Service for monitoring.","example":"my-application","type":"string"},"name":{"description":"The name of the application being monitored. The name must be unique for your Tenant.","example":"My Application","type":"string"},"description":{"description":"An optional, brief, description of the application being monitored.","type":"string","example":"Online application for a benefit program."},"status":{"description":"The published status of the application, set via the API or through the Tenant Admin Webapp. An empty string means no status has been set.\n","type":"string","enum":["operational","reported-issues","maintenance","outage",""],"example":"operational"},"monitorOnly":{"description":"If true, the application is not displayed on the public status page.","type":"boolean","example":false},"autoChangeStatus":{"description":"If true, health checks change the status from operational to reported-issues after failing for 5 minutes, and back to operational after succeeding for 5 minutes.\n","type":"boolean","example":false},"tenantId":{"description":"URN identifying the tenant to which the application belongs.","type":"string","example":"urn:ads:platform:tenant-service:v2:/tenants/61e9adcc9423490012a9ae46"},"metadata":{"description":"Additional status information, if any.","example":""},"enabled":{"description":"Indicates whether or not monitoring (health checks) for the application has been turned on.","type":"boolean","example":true},"statusTimestamp":{"description":"Time the status was last set, in milliseconds since the epoch, or null if never set.","type":"number","nullable":true,"readOnly":true,"example":1794326400000},"internalStatus":{"description":"Health check state of the application.","type":"string","enum":["stopped","healthy","unhealthy","pending"],"readOnly":true,"example":"healthy"},"endpoint":{"type":"object","properties":{"url":{"description":"URL of the application endpoint that health checks request.","type":"string","example":"https://my-application.alberta.ca/health"},"status":{"description":"Result of the latest health check.","type":"string","enum":["online","offline","n/a","pending"],"readOnly":true,"example":"online"}}}},"example":{"appKey":"my-application","name":"My Application","description":"Online application for a benefit program.","monitorOnly":false,"autoChangeStatus":false,"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61e9adcc9423490012a9ae46","metadata":"","enabled":true,"statusTimestamp":1794326400000,"status":"operational","internalStatus":"healthy","endpoint":{"status":"online","url":"https://my-application.alberta.ca/health"}}},"ApplicationInput":{"type":"object","required":["name","endpoint"],"properties":{"name":{"type":"string","description":"Name of the application. Must be unique for the tenant.","example":"My Application"},"description":{"type":"string","example":"Online application for a benefit program."},"endpoint":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"URL of the application endpoint that health checks request.","example":"https://my-application.alberta.ca/health"}}},"monitorOnly":{"type":"boolean","description":"If true, the application is not displayed on the public status page.","example":false}}},"Notice":{"description":"Detailed information to be posted about an application's status. The notice may include a message, a time period to which the notice applies, and the application status for the period.","type":"object","properties":{"id":{"description":"ID of the notice.","type":"string","readOnly":true,"example":"6730c4f1a2b3c4d5e6f70812"},"message":{"description":"The message portion the notice.","type":"string","example":"My Application will be down for weekly maintenance during the following hours."},"tennantServRef":{"description":"The tennantServRef (sic) identifies which applications the notice applies to. Use isAllApplications for a notice that applies to all applications of the tenant.\n","type":"array","items":{"$ref":"#/components/schemas/NoticeApplicationRef"}},"isAllApplications":{"description":"Indicates the notice applies to all applications of the tenant.","type":"boolean","example":false},"startDate":{"description":"The start of the time period to which the notice applies.","type":"string","format":"date-time","example":"2026-11-15T02:00:00.000Z"},"endDate":{"description":"The end of the time period to which the notice applies.","type":"string","format":"date-time","example":"2026-11-15T04:00:00.000Z"},"mode":{"description":"A notice is created in draft mode, can be published, and a published notice can be archived. Only published notices are displayed on the public status page.\n","type":"string","enum":["draft","published","archived"],"readOnly":true,"example":"draft"},"created":{"description":"Time the notice was created.","type":"string","format":"date-time","readOnly":true,"example":"2026-11-10T16:00:00.000Z"},"tenantId":{"description":"URN identifying the tenant of the notice.","type":"string","readOnly":true,"example":"urn:ads:platform:tenant-service:v2:/tenants/61e9adcc9423490012a9ae46"},"tenantName":{"description":"Name of the tenant of the notice.","type":"string","readOnly":true,"example":"My Tenant"}},"example":{"id":"6730c4f1a2b3c4d5e6f70812","message":"My Application will be down for weekly maintenance during the following hours.","tennantServRef":[{"id":"my-application","name":"My Application"}],"isAllApplications":false,"startDate":"2026-11-15T02:00:00.000Z","endDate":"2026-11-15T04:00:00.000Z","mode":"draft","created":"2026-11-10T16:00:00.000Z","tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61e9adcc9423490012a9ae46","tenantName":"My Tenant"}},"NoticeApplicationRef":{"type":"object","properties":{"id":{"description":"The application's appKey (or ID).","type":"string","example":"my-application"},"name":{"description":"The name of the Application.","type":"string","example":"My Application"}}},"Page":{"description":"Page descriptor, used when paging through a list of items.","type":"object","properties":{"after":{"description":"Number of items skipped before this page.","type":"number","example":0},"size":{"description":"The number of list items fetched.","type":"number","example":10},"next":{"description":"Query string for the next page (for example `after=10&top=10`), or null if this is the last page.\n","type":"string","nullable":true,"example":"after=10&top=10"},"total":{"description":"The total number of items in the list.","type":"number","example":231}},"example":{"after":0,"size":10,"next":"after=10&top=10","total":231}},"PingData":{"type":"object","properties":{"url":{"description":"The URL pinged.","type":"string","example":"https://my-application.alberta.ca/health"},"ok":{"description":"The success of the ping; set to false if the ping resulted in a 400 or 500 error.","type":"boolean","example":true},"timestamp":{"description":"The time of the ping, in milliseconds since the epoch.","type":"number","example":1794326400000},"responseTime":{"description":"The response time of the ping, in ms.","type":"number","example":178},"status":{"description":"The HTTP status code of the response, or a description of the error if there was no response.","oneOf":[{"type":"number"},{"type":"string"}],"example":200},"applicationId":{"description":"The application key, AKA application ID.","type":"string","example":"my-application"},"appKey":{"description":"The application key; same value as applicationId.","type":"string","example":"my-application"}},"example":{"url":"https://my-application.alberta.ca/health","ok":true,"timestamp":1794326400000,"responseTime":178,"status":200,"applicationId":"my-application","appKey":"my-application"}},"Public-application":{"type":"object","properties":{"id":{"description":"A unique ID used to identify an application; the application key.","example":"my-application","type":"string"},"name":{"description":"The name of the application being monitored. The name must be unique for your Tenant.","example":"My Application","type":"string"},"description":{"description":"An optional, brief, description of the application being monitored.","type":"string","example":"Online application for a benefit program."},"status":{"description":"The published status of the application, set via the API or through the Tenant Admin Webapp. An empty string means no status has been set.\n","type":"string","enum":["operational","reported-issues","maintenance","outage",""],"example":"operational"},"monitorOnly":{"description":"If true, the application is monitored but not meant to be displayed on the public status page. Clients displaying statuses should filter these out.\n","type":"boolean","example":false},"lastUpdated":{"description":"Timestamp indicating when the status was last updated, or null if never set.","type":"string","format":"date-time","nullable":true,"example":"2026-11-10T16:00:00.000Z"}},"example":{"id":"my-application","name":"My Application","description":"Online application for a benefit program.","status":"operational","monitorOnly":false,"lastUpdated":"2026-11-10T16:00:00.000Z"}},"StatusError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Status application with ID 'my-application' could not be found."}}},"responses":{"StatusBadRequest":{"description":"Request is invalid, for example it would create a duplicate application or an invalid notice mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusError"},"example":{"errorMessage":"Value not valid for status-service: Duplicate Application Name My Application"}}}},"StatusNotFound":{"description":"The resource was not found in the tenant of the request. Resources of other tenants also respond 404.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusError"},"example":{"errorMessage":"Status application with ID 'my-application' could not be found."}}}},"StatusUnauthorized":{"description":"Request does not include a valid bearer token, the token has no tenant context, or the user does not have the role required for the operation. Anonymous requests receive a plain `Unauthorized` text body; the other cases receive an `errorMessage`. Role checks in this API respond with 401 rather than 403.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusError"},"example":{"errorMessage":"missing tenant id"}}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Application Monitoring","description":"To control application _monitoring_. Note: You can manage which applications are monitored through the [Tenant Admin Webapp](https://adsp.alberta.ca)."},{"name":"Application Status","description":"To manage an application's published _status_"},{"name":"Notices","description":"To access and manage application _notices_. Note: You can also manage notices through the [Tenant Admin Webapp](https://adsp.alberta.ca)."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Task service","version":"0.0.0","description":"The Task Service gives applications a means for defining and managing tasks, and managing work assignments.\nA task is a _unit of work_ that is assigned to an individual for completion by a certain date. Exactly what the unit of work is\ndepends on the feature the application is trying to implement, but can be such things as:\n- response required,\n- signature required,\n- actions to be completed,\n- etc.\n\nYou can combine tasks into a _queue_ of work units that represents:\n- a specific job to be completed by one or more individuals,\n- an individual's daily workload,\n- reminders for a user,\n- etc.\n\nTasks and queues reside within _namespaces_, like a domain. A namespace might represent an application,\na specific workflow, or even an end-user role. A well chosen namespace name can help ensure you're working\non the same tasks across an application or applications.\n"},"paths":{"/task/v1/queues":{"get":{"tags":["Queue"],"description":"Retrieves the queues configured for the tenant. Available to any authenticated user of the tenant; no task service role is required. Core users must set the tenantId parameter.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Queue"}}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"}}}},"/task/v1/queues/{namespace}/{name}":{"get":{"tags":["Queue"],"description":"Retrieves a specified queue of the tenant. Available to any authenticated user of the tenant; no task service role is required. Core users must set the tenantId parameter.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Queue"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"404":{"$ref":"#/components/responses/QueueNotFound"}}}},"/task/v1/queues/{namespace}/{name}/assigners":{"get":{"tags":["Queue"],"description":"Retrieves the users of the tenant's Keycloak realm that hold one of the assigner roles of the queue. No task service role is required, but the request is made to the Keycloak admin API with the caller's token, so the user must hold the realm-management roles to view users (view-users) and, for client roles, clients (view-clients). Responds 403 if Keycloak denies the request. Roles that don't exist in the realm are skipped.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QueueUser"}}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueueNotFound"}}}},"/task/v1/queues/{namespace}/{name}/metrics":{"get":{"tags":["Queue"],"description":"Retrieves task counts for a specified queue of the tenant, and optionally duration and rate metrics from the value service. Requires the task-admin or task-reader role, or one of the worker or assigner roles of the queue. Core users with one of those roles can retrieve metrics using the tenantId parameter.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"},{"name":"notEnded","description":"Set to true to only include tasks that are not completed or cancelled in the counts.","in":"query","required":false,"schema":{"type":"boolean"},"example":true},{"name":"includeEventMetrics","description":"Set to true to include the queue, completion, and rate metrics.","in":"query","required":false,"schema":{"type":"boolean"},"example":true}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueMetrics"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueueNotFound"}}}},"/task/v1/queues/{namespace}/{name}/tasks":{"get":{"tags":["Queue"],"description":"Retrieves the tasks in a queue that are not completed or cancelled, ordered with the highest priority first and, within each priority, oldest first. Requires the task-admin or task-reader role, or one of the worker or assigner roles of the queue. Core users with one of those roles can retrieve tasks using the tenantId parameter.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"},{"$ref":"#/components/parameters/TaskTop"},{"$ref":"#/components/parameters/TaskAfter"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResults"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueueNotFound"}}},"post":{"tags":["Queue"],"description":"Creates a task in a queue of the tenant, with status Pending. Requires the task-admin or task-writer role. Core users with one of those roles can create tasks using the tenantId parameter. Also creates a comment topic for the task in the comment service.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTask"}}}},"responses":{"200":{"description":"Task successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueueNotFound"}}}},"/task/v1/queues/{namespace}/{name}/tasks/{id}":{"get":{"tags":["Queue"],"description":"Retrieves a task in a specified queue. Requires the task-admin or task-reader role, or one of the worker or assigner roles of the queue. Core users with one of those roles can retrieve the task using the tenantId parameter. Tasks of other tenants or other queues respond 404. Responds 400 without a tenant context.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueuedTaskNotFound"}}},"patch":{"tags":["Queue"],"description":"Updates a task in a specified queue. Requires the task-admin role, or the task-writer role together with a role that grants access to the task (task-reader, or a worker or assigner role of the queue), in the tenant of the task; core users can't update tasks. Tasks of other tenants or other queues respond 404.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"},{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueuedTaskNotFound"}}},"post":{"tags":["Queue"],"description":"Executes an operation on a task in a specified queue. The roles are the same as for POST /task/v1/tasks/{id}: the user must be able to access the task (the task-admin or task-reader role, or a worker or assigner role of the queue); assign requires the task-admin role or an assigner role, except that a worker can assign the task to themselves; set-priority requires the task-admin or task-writer role or an assigner role; start and complete require a worker role, and the task must be unassigned or assigned to the user; cancel is allowed for any user who can access the task. Tasks of other tenants or other queues respond 404. Responds 400 for an unrecognized operation, or when the task's status doesn't allow the operation.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"},{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOperation"},"examples":{"assign":{"$ref":"#/components/examples/AssignTaskExample"},"unassign":{"$ref":"#/components/examples/UnassignTaskExample"},"set-priority":{"$ref":"#/components/examples/SetTaskPriorityExample"},"start":{"$ref":"#/components/examples/StartTaskExample"},"complete":{"$ref":"#/components/examples/CompleteTaskExample"},"cancel":{"$ref":"#/components/examples/CancelTaskExample"}}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueuedTaskNotFound"}}}},"/task/v1/queues/{namespace}/{name}/tasks/{id}/data":{"patch":{"tags":["Queue"],"description":"Replaces the data of a task in a specified queue. The task must be In Progress. Requires a worker role of the queue in the tenant of the task, and the task must be unassigned or assigned to the user. Tasks of other tenants or other queues respond 404.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"},{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskData"}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueuedTaskNotFound"}}}},"/task/v1/queues/{namespace}/{name}/workers":{"get":{"tags":["Queue"],"description":"Retrieves the users of the tenant's Keycloak realm that hold one of the worker roles of the queue. No task service role is required, but the request is made to the Keycloak admin API with the caller's token, so the user must hold the realm-management roles to view users (view-users) and, for client roles, clients (view-clients). Responds 403 if Keycloak denies the request. Roles that don't exist in the realm are skipped.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/QueueNamespace"},{"$ref":"#/components/parameters/QueueName"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QueueUser"}}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/QueueNotFound"}}}},"/task/v1/tasks":{"get":{"tags":["Task"],"description":"Retrieves tasks of the tenant across queues, ordered with the highest priority first and, within each priority, oldest first. Requires the task-admin or task-reader role in the tenant. Core users with the export-service export-job role (urn:ads:platform:export-service:export-job) can also retrieve tasks, using the tenantId parameter. Responds 400 without a tenant context.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/TaskTop"},{"$ref":"#/components/parameters/TaskAfter"},{"name":"criteria","description":"JSON-encoded criteria to filter the tasks by. Must be valid JSON. Supported properties are queue (namespace and name), definition (namespace and name), context (tasks whose context contains these values), and notEnded (true to exclude completed and cancelled tasks).\n","in":"query","required":false,"schema":{"type":"string"},"example":"{\"queue\":{\"namespace\":\"support\",\"name\":\"intake-processing\"},\"notEnded\":true}"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResults"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"}}}},"/task/v1/tasks/{id}":{"get":{"tags":["Task"],"description":"Retrieves a specified task. Requires the task-admin or task-reader role, or one of the worker or assigner roles of the task's queue. Core users with one of those roles can retrieve the task using the tenantId parameter, as can the directory-service resource-resolver role (urn:ads:platform:directory-service:resource-resolver). Tasks of other tenants respond 404. Responds 400 without a tenant context.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/TaskNotFound"}}},"patch":{"tags":["Task"],"description":"Updates a specified task. Requires the task-admin role, or the task-writer role together with a role that grants access to the task (task-reader, or a worker or assigner role of the queue), in the tenant of the task; core users can't update tasks. Tasks of other tenants respond 404.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/TaskNotFound"}}},"post":{"tags":["Task"],"description":"Executes a task operation. The user must be able to access the task (the task-admin or task-reader role, or a worker or assigner role of the queue). Further roles depend on the operation, and are held in the tenant of the task: assign requires the task-admin role or an assigner role of the queue, except that a user with a worker role can assign the task to themselves; set-priority requires the task-admin or task-writer role or an assigner role; start and complete require a worker role of the queue, and the task must be unassigned or assigned to the user; cancel is allowed for any user who can access the task, that is with the task-admin or task-reader role or a worker or assigner role of the queue (core users with those roles included). Tasks of other tenants respond 404. Responds 400 for an unrecognized operation, or when the task's status doesn't allow the operation.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOperation"},"examples":{"assign":{"$ref":"#/components/examples/AssignTaskExample"},"unassign":{"$ref":"#/components/examples/UnassignTaskExample"},"set-priority":{"$ref":"#/components/examples/SetTaskPriorityExample"},"start":{"$ref":"#/components/examples/StartTaskExample"},"complete":{"$ref":"#/components/examples/CompleteTaskExample"},"cancel":{"$ref":"#/components/examples/CancelTaskExample"}}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/TaskNotFound"}}},"delete":{"tags":["Task"],"description":"Deletes a task. Requires the task-admin role in the tenant of the task; core users can't delete tasks. Tasks of other tenants respond 404.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskDeleteResult"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/TaskNotFound"}}}},"/task/v1/tasks/{id}/data":{"patch":{"tags":["Task"],"description":"Replaces the data of a specified task. The task must be In Progress. Requires a worker role of the task's queue in the tenant of the task, and the task must be unassigned or assigned to the user. Tasks of other tenants respond 404.\n","parameters":[{"$ref":"#/components/parameters/TaskTenantId"},{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskData"}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/TaskBadRequest"},"401":{"$ref":"#/components/responses/TaskUnauthorized"},"403":{"$ref":"#/components/responses/TaskForbidden"},"404":{"$ref":"#/components/responses/TaskNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"QueueName":{"name":"name","description":"Name of the queue.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"intake-processing"},"QueueNamespace":{"name":"namespace","description":"Namespace of the queue.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"support"},"TaskAfter":{"name":"after","description":"Cursor of the page to retrieve. Use the `page.next` value of the previous response to page sequentially through the results.\n","in":"query","required":false,"schema":{"type":"string"},"example":"MTA="},"TaskId":{"name":"id","description":"ID of the task.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"f3a3bc74-494e-4bb5-b5f3-d29a34edd275"},"TaskTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users; tenant users always act on the tenant of their token and this parameter is ignored. Core users must set it, since tasks and queues are scoped to a tenant.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"TaskTop":{"name":"top","description":"Maximum number of tasks to return in the page.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000,"default":10},"example":10}},"responses":{"QueueNotFound":{"description":"Queue not found in the configuration of the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskError"},"example":{"errorMessage":"queue with ID 'support:intake-processing' could not be found."}}}},"QueuedTaskNotFound":{"description":"Queue not found, or task not found in the queue of the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskError"},"example":{"errorMessage":"task with ID 'f3a3bc74-494e-4bb5-b5f3-d29a34edd275' could not be found."}}}},"TaskBadRequest":{"description":"Request is invalid. For example, a path, query, or body parameter failed validation, there is no tenant context, or the operation is not valid for the task's status.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskError"},"example":{"errorMessage":"Validation failed with error(s): id (params) - Invalid value"}}}},"TaskForbidden":{"description":"User does not have a role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskError"},"example":{"errorMessage":"User Test User (ID: 3f0c7a2e-1b4d-4c8e-9a6f-2d5b8e1c7a90) not permitted to access task."}}}},"TaskNotFound":{"description":"Task not found in the tenant (or, for a queue path, not found in that queue).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskError"},"example":{"errorMessage":"task with ID 'f3a3bc74-494e-4bb5-b5f3-d29a34edd275' could not be found."}}}},"TaskUnauthorized":{"description":"Request does not include a valid bearer token."}},"schemas":{"AssignTask":{"type":"object","description":"Assigns the task to a user, or unassigns it when assignTo is omitted or null. Completed or cancelled tasks cannot be assigned.\n","properties":{"operation":{"type":"string","enum":["assign"]},"assignTo":{"type":"object","nullable":true,"properties":{"id":{"type":"string","example":"ed2243ed-948a-4f84-a785-c9cf2d5f355e"},"name":{"type":"string","example":"Test User"},"email":{"type":"string","example":"test.user@gov.ab.ca"}}}},"required":["operation"]},"CancelTask":{"type":"object","description":"Cancels a Pending or In Progress task.","properties":{"operation":{"type":"string","enum":["cancel"]},"reason":{"type":"string","description":"Indicates why the task was cancelled. Included in the task-cancelled event."}},"required":["operation"]},"CompleteTask":{"type":"object","description":"Completes an In Progress task.","properties":{"operation":{"type":"string","enum":["complete"]}},"required":["operation"]},"NewTask":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"The name of the task."},"description":{"type":"string","description":"A short summary of the task to be performed."},"recordId":{"type":"string","description":"An optional, application defined ID for cross-referencing purposes."},"context":{"type":"object","description":"A JSON object used to provide an application-defined context for the task. Defaults to {}.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"data":{"type":"object","description":"An optional, application-defined JSON object to further define the task. Defaults to {}."},"definition":{"type":"object","description":"Optional application-defined task definition the task is created from.","properties":{"namespace":{"type":"string"},"name":{"type":"string"}}},"priority":{"type":"string","description":"The task priority. Defaults to Normal.","enum":["Normal","High","Urgent"]}},"required":["name"],"example":{"name":"process-application-123","description":"Process application 123","recordId":"f669be59-bd38-4ca4-8749-19248060fc63","context":{"application":"intake"},"priority":"High"}},"Queue":{"type":"object","properties":{"namespace":{"type":"string","description":"The namespace in which the queue resides.","example":"support"},"name":{"type":"string","description":"The name of the queue.","example":"intake-processing"},"displayName":{"type":"string","nullable":true,"description":"Display name of the queue.","example":"Intake processing"},"context":{"type":"object","description":"An application-defined JSON object to describe the context for the queue.","example":{},"additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"assignerRoles":{"type":"array","description":"Roles that allow a user to assign tasks in the queue to others, and to set task priority.","items":{"type":"string"},"example":["intake-supervisor"]},"workerRoles":{"type":"array","description":"Roles that allow a user to assign themselves tasks in the queue, and to work on them.","items":{"type":"string"},"example":["intake-assessor"]}},"example":{"namespace":"support","name":"intake-processing","displayName":"Intake processing","context":{},"assignerRoles":["intake-supervisor"],"workerRoles":["intake-assessor","urn:ads:example:intake-app:assessor"]}},"QueueDurationMetric":{"type":"object","nullable":true,"properties":{"avg":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"}}},"QueueMetrics":{"type":"object","properties":{"namespace":{"type":"string","description":"The namespace in which the queue resides."},"name":{"type":"string","description":"The name of the queue."},"status":{"type":"object","description":"Number of tasks by status.","additionalProperties":{"type":"number"}},"priority":{"type":"object","description":"Number of tasks by priority.","additionalProperties":{"type":"number"}},"assignedTo":{"type":"object","description":"Number of tasks by assigned user, keyed by user ID.","additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}}}},"queue":{"allOf":[{"$ref":"#/components/schemas/QueueDurationMetric"}],"description":"Weekly time in seconds tasks wait between created and started. Only set when includeEventMetrics is true.\n"},"completion":{"allOf":[{"$ref":"#/components/schemas/QueueDurationMetric"}],"description":"Weekly time in seconds tasks take between started and completed. Only set when includeEventMetrics is true.\n"},"rate":{"type":"object","nullable":true,"description":"Number of tasks created, completed, and cancelled in the last 7 days. Only set when includeEventMetrics is true.","properties":{"since":{"type":"string","format":"date-time"},"created":{"type":"integer"},"completed":{"type":"integer"},"cancelled":{"type":"integer"}}}},"example":{"namespace":"support","name":"intake-processing","status":{"Pending":12,"In Progress":4,"Stopped":0,"Cancelled":1,"Completed":30},"priority":{"Normal":40,"High":6,"Urgent":1},"assignedTo":{"ed2243ed-948a-4f84-a785-c9cf2d5f355e":{"id":"ed2243ed-948a-4f84-a785-c9cf2d5f355e","name":"Test User","count":4}},"queue":{"avg":5400,"min":120,"max":86400},"completion":{"avg":1800,"min":60,"max":7200},"rate":{"since":"2026-02-23T15:30:00.000Z","created":20,"completed":15,"cancelled":1}}},"QueueUser":{"type":"object","properties":{"id":{"type":"string","description":"The user's ID."},"name":{"type":"string","description":"The user's first and last name, or username if the name isn't set."},"email":{"type":"string","description":"The user's email address."}},"example":{"id":"ed2243ed-948a-4f84-a785-c9cf2d5f355e","name":"Test User","email":"test.user@gov.ab.ca"}},"SetTaskPriority":{"type":"object","description":"Used when setting a task's priority.","properties":{"operation":{"type":"string","enum":["set-priority"]},"priority":{"type":"string","enum":["Normal","High","Urgent"]}},"required":["operation","priority"]},"StartTask":{"type":"object","description":"Starts a Pending task, changing its status to In Progress.","properties":{"operation":{"type":"string","enum":["start"]}},"required":["operation"]},"Task":{"type":"object","description":"A task represents an action that a user must perform within a specified period of time.","properties":{"urn":{"type":"string","readOnly":true,"description":"URN of the task resource.","example":"urn:ads:platform:task-service:v1:/tasks/f3a3bc74-494e-4bb5-b5f3-d29a34edd275"},"id":{"type":"string","format":"uuid","readOnly":true,"description":"Used to uniquely identify the task in the system. Generated when the task is created, use this ID in subsequent API calls.\n","example":"f3a3bc74-494e-4bb5-b5f3-d29a34edd275"},"name":{"type":"string","description":"The name of the task.","example":"IRC-approval"},"description":{"type":"string","description":"A brief description of the task to be performed.","example":"Please sign off on the completed IRC"},"queue":{"type":"object","readOnly":true,"description":"The queue to which the task has been submitted.","properties":{"namespace":{"type":"string","description":"The namespace in which the queue resides.","example":"IRC-application"},"name":{"type":"string","description":"The name of the queue.","example":"IRC-approvals"}},"required":["namespace","name"]},"definition":{"type":"object","nullable":true,"description":"Optional application-defined task definition the task was created from.","properties":{"namespace":{"type":"string"},"name":{"type":"string"}}},"recordId":{"type":"string","description":"An optional value for additional application defined context, such as the ID of a related record.","example":"irc-document-number-42"},"context":{"type":"object","description":"A JSON object used to provide an application-defined context for the task. Defaults to {}.","example":{"application":"IRC"},"additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"data":{"type":"object","description":"An optional, JSON object containing application-defined data to further define the task.","example":{}},"priority":{"type":"string","description":"Tasks can be prioritized in a queue. Higher priority tasks are pushed to the front.","enum":["Normal","High","Urgent"]},"status":{"type":"string","readOnly":true,"description":"Status of the task in its lifecycle. Changed by the start, complete, and cancel operations.","enum":["Pending","In Progress","Stopped","Completed","Cancelled"]},"assignment":{"$ref":"#/components/schemas/TaskAssignment"},"createdOn":{"type":"string","format":"date-time","readOnly":true,"description":"Task creation date"},"startedOn":{"type":"string","format":"date-time","nullable":true,"readOnly":true,"description":"Task start date"},"endedOn":{"type":"string","format":"date-time","nullable":true,"readOnly":true,"description":"Task completion or cancellation date"}},"example":{"urn":"urn:ads:platform:task-service:v1:/tasks/f3a3bc74-494e-4bb5-b5f3-d29a34edd275","id":"f3a3bc74-494e-4bb5-b5f3-d29a34edd275","name":"process-application-123","description":"Process application 123","queue":{"namespace":"support","name":"intake-processing"},"definition":null,"recordId":"f669be59-bd38-4ca4-8749-19248060fc63","context":{"application":"intake"},"data":{},"priority":"High","status":"In Progress","assignment":{"assignedOn":"2026-03-02T16:05:00.000Z","assignedTo":{"id":"ed2243ed-948a-4f84-a785-c9cf2d5f355e","name":"Test User","email":"test.user@gov.ab.ca"},"assignedBy":{"id":"3f0c7a2e-1b4d-4c8e-9a6f-2d5b8e1c7a90","name":"Test Supervisor"}},"createdOn":"2026-03-02T15:30:00.000Z","startedOn":"2026-03-02T16:10:00.000Z","endedOn":null}},"TaskAssignment":{"type":"object","nullable":true,"readOnly":true,"description":"Tasks are assigned to users for completion. The assignment identifies who the task is assigned to, and who assigned it. assignedTo is null when the task was unassigned.\n","properties":{"assignedTo":{"type":"object","nullable":true,"description":"Identifies the user to which the task has been assigned by ID, name, and email address.","properties":{"id":{"type":"string","example":"ed2243ed-948a-4f84-a785-c9cf2d5f355e"},"name":{"type":"string","example":"Test User"},"email":{"type":"string","example":"test.user@gov.ab.ca"}}},"assignedBy":{"type":"object","description":"Identifies the user that assigned the task by ID, and name.","properties":{"id":{"type":"string","example":"3f0c7a2e-1b4d-4c8e-9a6f-2d5b8e1c7a90"},"name":{"type":"string","example":"Test Supervisor"}}},"assignedOn":{"type":"string","format":"date-time","description":"Date the task was assigned"}}},"TaskData":{"type":"object","description":"Application-defined data to set on the task. Replaces the existing data.","example":{"decision":"approved","notes":"All documents received."}},"TaskDeleteResult":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the task was deleted."}},"example":{"deleted":true}},"TaskError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"TaskOperation":{"oneOf":[{"$ref":"#/components/schemas/AssignTask"},{"$ref":"#/components/schemas/SetTaskPriority"},{"$ref":"#/components/schemas/StartTask"},{"$ref":"#/components/schemas/CompleteTask"},{"$ref":"#/components/schemas/CancelTask"}],"discriminator":{"propertyName":"operation","mapping":{"assign":"#/components/schemas/AssignTask","set-priority":"#/components/schemas/SetTaskPriority","start":"#/components/schemas/StartTask","complete":"#/components/schemas/CompleteTask","cancel":"#/components/schemas/CancelTask"}}},"TaskResults":{"type":"object","description":"A page of tasks.","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"page":{"type":"object","properties":{"after":{"type":"string","description":"Cursor representing the set of data returned."},"next":{"type":"string","description":"Cursor representing the next set of data to be returned. Not set on the last page."},"size":{"type":"number","description":"The number of tasks returned by the query."}}}},"example":{"results":[{"urn":"urn:ads:platform:task-service:v1:/tasks/f3a3bc74-494e-4bb5-b5f3-d29a34edd275","id":"f3a3bc74-494e-4bb5-b5f3-d29a34edd275","name":"process-application-123","description":"Process application 123","queue":{"namespace":"support","name":"intake-processing"},"definition":null,"recordId":"f669be59-bd38-4ca4-8749-19248060fc63","context":{"application":"intake"},"data":{},"priority":"Normal","status":"Pending","assignment":null,"createdOn":"2026-03-02T15:30:00.000Z","startedOn":null,"endedOn":null}],"page":{"after":"MTA=","next":"MjA=","size":10}}},"TaskUpdate":{"type":"object","description":"Fields to update. Fields that are not included are left unchanged.","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"New name for the task."},"description":{"type":"string","description":"New description for the task."},"context":{"type":"object","description":"New task context. Replaces the existing context.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"data":{"type":"object","description":"Application-defined JSON object to further define the task. Replaces the existing data."},"priority":{"type":"integer","enum":[1,2,3],"description":"New priority for the task as a number, where 1 is Normal, 2 is High, and 3 is Urgent."}},"example":{"name":"process-application-123","description":"Process application 123 (resubmitted)","context":{"application":"intake"},"priority":2}}},"examples":{"AssignTaskExample":{"summary":"Assign the task to a user","value":{"operation":"assign","assignTo":{"id":"ed2243ed-948a-4f84-a785-c9cf2d5f355e","name":"Test User","email":"test.user@gov.ab.ca"}}},"CancelTaskExample":{"summary":"Cancel the task","value":{"operation":"cancel","reason":"Application was withdrawn by the applicant."}},"CompleteTaskExample":{"summary":"Complete the task","value":{"operation":"complete"}},"SetTaskPriorityExample":{"summary":"Set the priority of the task","value":{"operation":"set-priority","priority":"Urgent"}},"StartTaskExample":{"summary":"Start the task","value":{"operation":"start"}},"UnassignTaskExample":{"summary":"Unassign the task","value":{"operation":"assign","assignTo":null}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Queue","description":"Managing Task Queues"},{"name":"Task","description":"Managing Tasks"}]}
|