@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":"Comment service","version":"0.0.0","description":"Service that allows users to comment on topics."},"paths":{"/comment/v1/comments":{"get":{"tags":["Comment"],"description":"Searches comments across the topics of the tenant, newest first. Core users must set tenantId. With `criteria.typeIdEquals`, requires read access to the topic type: its admin, commenter, or reader roles (or comment-admin) in the tenant, or the export-service export-job role (`urn:ads:platform:export-service:export-job`) in the tenant; an unknown type responds 404. Without it, requires the comment-admin or export-job role in the tenant. Core roles don't grant access.\n","parameters":[{"$ref":"#/components/parameters/CommentTenantId"},{"name":"top","description":"Maximum number of comments to return. Defaults to 10. Must be a positive integer.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":10},"example":10},{"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="},{"name":"criteria","description":"Criteria for the comments to retrieve, as URL-encoded JSON. Must be valid JSON. The text criteria are PostgreSQL full text searches of a single word or phrase.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"typeIdEquals":{"type":"string","description":"Only comments on topics of the topic type."},"topicIdEquals":{"type":"integer"},"titleLike":{"type":"string"},"contentLike":{"type":"string"},"titleOrContentLike":{"type":"string"},"idGreaterThan":{"type":"integer"}}},"example":{"typeIdEquals":"case-notes","titleOrContentLike":"address"}}}}],"responses":{"200":{"description":"Comments retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"page":{"$ref":"#/components/schemas/CommentResultsPage"}}},"example":{"results":[{"topicId":42,"id":1203,"title":"Follow up call","content":"Called the applicant to confirm the mailing address.","context":{"step":"address-verification"},"createdBy":{"id":"7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d","name":"Test User"},"createdOn":"2026-11-02T16:20:00.000Z","lastUpdatedBy":{"id":"7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d","name":"Test User"},"lastUpdatedOn":"2026-11-02T16:20:00.000Z"}],"page":{"after":"MTA=","size":1}}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}}},"/comment/v1/topic-types":{"get":{"tags":["Topic"],"description":"Retrieves the topic types available to the tenant. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. The response separates the tenant's own types (`tenant`) from the platform types (`core`), each keyed by type ID. Topics can use either; a tenant type with the ID of a platform type replaces it. Core users that don't set tenantId receive only the platform types.\n","parameters":[{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Topic types retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","description":"Topic types configured by the tenant, keyed by ID.","additionalProperties":{"$ref":"#/components/schemas/TopicType"}},"core":{"type":"object","description":"Platform topic types, keyed by ID.","additionalProperties":{"$ref":"#/components/schemas/TopicType"}}}},"example":{"tenant":{"case-notes":{"id":"case-notes","name":"Case notes","adminRoles":["case-supervisor"],"readerRoles":["case-auditor"],"commenterRoles":["case-worker"],"securityClassification":"protected b"}},"core":{"form-questions":{"id":"form-questions","name":"Form questions","adminRoles":[],"readerRoles":[],"commenterRoles":[],"securityClassification":"protected a"}}}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"}}},"post":{"tags":["Topic"],"description":"Creates a topic type in the tenant's comment service configuration. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. The new type has no admin roles; set them with an update. The service responds 409 if the tenant or platform already has a type with the ID, or a type with a different ID has the same name.\n","parameters":[{"$ref":"#/components/parameters/CommentTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID of the topic type.","minLength":1,"maxLength":50,"pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"name":{"type":"string","description":"Name of the topic type.","minLength":1,"maxLength":50},"readerRoles":{"type":"array","description":"Roles that can read topics of the type.","items":{"type":"string"}},"readRoles":{"type":"array","deprecated":true,"description":"Alternative name for readerRoles, used when readerRoles is not set.","items":{"type":"string"}},"writeRoles":{"type":"array","description":"Roles that can comment on topics of the type. Saved as the type's commenterRoles.","items":{"type":"string"}}},"required":["id","name"]},"example":{"id":"case-notes","name":"Case notes","readerRoles":["case-auditor"],"writeRoles":["case-worker"]}}}},"responses":{"200":{"description":"Topic type created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicType"},"example":{"id":"case-notes","name":"Case notes","adminRoles":[],"readerRoles":["case-auditor"],"commenterRoles":["case-worker"]}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"409":{"description":"A topic type with the ID or name already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentError"},"example":{"errorMessage":"Topic type 'Case notes' already exists."}}}}}}},"/comment/v1/topic-types/{topicTypeId}":{"get":{"tags":["Topic"],"description":"Retrieves a topic type configured by the tenant. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. Only the tenant's own types are found; platform types respond 404, so use the topic types list to read them.\n","parameters":[{"$ref":"#/components/parameters/TopicTypeId"},{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Topic type retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicType"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"patch":{"tags":["Topic"],"description":"Updates a topic type configured by the tenant. Properties not in the request keep their values. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. Platform types respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicTypeId"},{"$ref":"#/components/parameters/CommentTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the topic type.","minLength":1,"maxLength":50},"adminRoles":{"type":"array","description":"Roles that can administer topics of the type.","items":{"type":"string"}},"readerRoles":{"type":"array","description":"Roles that can read topics of the type.","items":{"type":"string"}},"commenterRoles":{"type":"array","description":"Roles that can comment on topics of the type.","items":{"type":"string"}},"securityClassification":{"type":"string","description":"Security classification for new topics of the type.","enum":["public","protected a","protected b","protected c"]}}},"example":{"adminRoles":["case-supervisor"],"commenterRoles":["case-worker"],"securityClassification":"protected b"}}}},"responses":{"200":{"description":"Topic type updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicType"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"delete":{"tags":["Topic"],"description":"Deletes a topic type configured by the tenant. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. The service responds 409 while any topic of the type exists; delete those topics first. Platform types respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicTypeId"},{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Topic type deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"id":{"type":"string"}}},"example":{"deleted":true,"id":"case-notes"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"},"409":{"description":"Topics of the type exist and must be deleted first.","content":{"application/json":{"schema":{"type":"object","properties":{"errorMessage":{"type":"string"},"topics":{"type":"integer","description":"Number of topics of the type."}}},"example":{"errorMessage":"Topic type 'case-notes' cannot be deleted because 3 topic(s) are associated with it.","topics":3}}}}}}},"/comment/v1/topics":{"get":{"tags":["Topic"],"description":"Retrieves topics of the tenant, in order of ID. Available to any authenticated user, but results only include the topics the user can read: users with the type's admin, commenter, or reader roles (or comment-admin) in the tenant, users listed in the topic's commenters, and users with the comment-admin or topic-setter role in the tenant or as a core role. Users with the export-service export-job role (`urn:ads:platform:export-service:export-job`) receive all matching topics. A page can therefore hold fewer than `top` results while `page.next` is set. Core users must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/CommentTenantId"},{"$ref":"#/components/parameters/CommentTop"},{"$ref":"#/components/parameters/CommentAfter"},{"name":"criteria","description":"Criteria for the topics to retrieve, as URL-encoded JSON. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"typeIdEquals":{"type":"string"},"resourceIdEquals":{"type":"string","description":"ID or URN of the entity the topics are about."},"requiresAttention":{"type":"boolean","description":"When true, only topics that require attention. False is the same as not setting it."}}},"example":{"typeIdEquals":"case-notes","resourceIdEquals":"urn:ads:demo:case-service:v1:/cases/case-123"}}}}],"responses":{"200":{"description":"Topics retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Topic"}},"page":{"$ref":"#/components/schemas/CommentResultsPage"}}},"example":{"results":[{"type":{"id":"case-notes","name":"Case notes","adminRoles":["case-supervisor"],"readerRoles":["case-auditor"],"commenterRoles":["case-worker"],"securityClassification":"protected b"},"id":42,"urn":"urn:ads:platform:comment-service:v1:/topics/42","resourceId":"urn:ads:demo:case-service:v1:/cases/case-123","name":"Comments on case-123","description":"Notes about the case.","commenters":[],"securityClassification":"protected b","requiresAttention":false}],"page":{"next":"MTA=","size":10}}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"}}},"post":{"tags":["Topic"],"description":"Creates a topic in the tenant. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. The topic type can be one of the tenant's types or a platform type. The topic's security classification is taken from its type.\n","parameters":[{"$ref":"#/components/parameters/CommentTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"typeId":{"type":"string","description":"ID of the topic type of the topic.","minLength":1,"maxLength":50},"name":{"type":"string","description":"Name of the topic.","minLength":1,"maxLength":50},"description":{"type":"string","description":"Description of the topic."},"commenters":{"type":"array","items":{"type":"string"},"description":"IDs of additional users who can read and comment on the topic."},"resourceId":{"type":"string","description":"ID or URN of the entity the topic is about.","minLength":1,"maxLength":1200}},"required":["name","typeId"]},"example":{"typeId":"case-notes","name":"Comments on case-123","description":"Notes about the case.","resourceId":"urn:ads:demo:case-service:v1:/cases/case-123","commenters":["3f2b1c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"]}}}},"responses":{"200":{"description":"Topic created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Topic"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}}},"/comment/v1/topics/{topicId}":{"get":{"tags":["Topic"],"description":"Retrieves a topic of the tenant. Requires read access to the topic: the topic type's admin, commenter, or reader roles (or comment-admin) in the tenant, being listed in the topic's commenters, or the comment-admin or topic-setter role in the tenant or as a core role. The directory service resource-resolver role (`urn:ads:platform:directory-service:resource-resolver`) can also retrieve it. Core users must set tenantId. Topics of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Topic retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Topic"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"patch":{"tags":["Topic"],"description":"Updates a topic of the tenant. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. Topics of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the topic.","minLength":1,"maxLength":50},"description":{"type":"string","description":"Description of the topic."},"commenters":{"type":"array","items":{"type":"string"},"description":"IDs of additional users who can read and comment on the topic. Replaces the existing list."}}},"example":{"name":"Comments on case-123","commenters":["3f2b1c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"]}}}},"responses":{"200":{"description":"Topic updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Topic"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"delete":{"tags":["Topic"],"description":"Deletes a topic of the tenant and its comments. Requires the comment-admin or topic-setter role, held in the tenant or as a core (platform) role. Core users must set tenantId. Topics of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}}},"/comment/v1/topics/{topicId}/comments":{"get":{"tags":["Topic"],"description":"Retrieves comments of a topic, newest first. Requires read access to the topic: the topic type's admin, commenter, or reader roles (or comment-admin) in the tenant, being listed in the topic's commenters, or the comment-admin or topic-setter role in the tenant or as a core role. Core users must set tenantId. Topics of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentTenantId"},{"$ref":"#/components/parameters/CommentTop"},{"$ref":"#/components/parameters/CommentAfter"},{"name":"criteria","description":"Criteria for the comments to retrieve, as URL-encoded JSON. Must be valid JSON. The text criteria are PostgreSQL full text searches of a single word or phrase.\n","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"titleLike":{"type":"string"},"contentLike":{"type":"string"},"titleOrContentLike":{"type":"string"},"idGreaterThan":{"type":"integer","description":"Only comments with a greater ID, for example to get comments posted since the last read."}}},"example":{"idGreaterThan":1200}}}}],"responses":{"200":{"description":"Comments retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"page":{"$ref":"#/components/schemas/CommentResultsPage"}}},"example":{"results":[{"topicId":42,"id":1203,"title":"Follow up call","content":"Called the applicant to confirm the mailing address.","context":{"step":"address-verification"},"createdBy":{"id":"7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d","name":"Test User"},"createdOn":"2026-11-02T16:20:00.000Z","lastUpdatedBy":{"id":"7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d","name":"Test User"},"lastUpdatedOn":"2026-11-02T16:20:00.000Z"}],"page":{"after":"MTA=","size":1}}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"post":{"tags":["Topic"],"description":"Posts a comment on a topic. Requires comment access to the topic: the topic type's admin or commenter roles (or comment-admin) in the tenant, or being listed in the topic's commenters. Core users must set tenantId. Topics of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","nullable":true,"description":"Title of the comment.","minLength":1,"maxLength":255},"content":{"type":"string","description":"Content of the comment.","minLength":1},"context":{"type":"object","description":"Arbitrary JSON context data associated with the comment.","additionalProperties":true},"requiresAttention":{"type":"boolean","nullable":true,"description":"Sets (true) or clears (false) the topic's requiresAttention flag."}},"required":["content"]},"example":{"title":"Follow up call","content":"Called the applicant to confirm the mailing address.","context":{"step":"address-verification"},"requiresAttention":true}}}},"responses":{"200":{"description":"Comment created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}}},"/comment/v1/topics/{topicId}/comments/{commentId}":{"get":{"tags":["Topic"],"description":"Retrieves a comment of a topic. Requires read access to the topic: the topic type's admin, commenter, or reader roles (or comment-admin) in the tenant, being listed in the topic's commenters, or the comment-admin or topic-setter role in the tenant or as a core role. Core users must set tenantId. Topics and comments of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentId"},{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Comment retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"patch":{"tags":["Topic"],"description":"Updates a comment of a topic. Requires the topic type's admin roles (or comment-admin) in the tenant, or comment access to the topic for the author of the comment. Core users must set tenantId. Topics and comments of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentId"},{"$ref":"#/components/parameters/CommentTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","nullable":true,"description":"Title of the comment. A null value keeps the existing title.","minLength":1,"maxLength":255},"content":{"type":"string","description":"Content of the comment.","minLength":1},"context":{"type":"object","description":"Arbitrary JSON context data. When supplied, it replaces the existing context.","additionalProperties":true}}},"example":{"content":"Called the applicant to confirm the mailing and residential addresses."}}}},"responses":{"200":{"description":"Comment updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}},"delete":{"tags":["Topic"],"description":"Deletes a comment of a topic. Requires the topic type's admin roles (or comment-admin) in the tenant, or comment access to the topic for the author of the comment. Core users must set tenantId. Topics and comments of another tenant respond 404.\n","parameters":[{"$ref":"#/components/parameters/TopicId"},{"$ref":"#/components/parameters/CommentId"},{"$ref":"#/components/parameters/CommentTenantId"}],"responses":{"200":{"description":"Comment deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/CommentBadRequest"},"401":{"$ref":"#/components/responses/CommentUnauthorized"},"403":{"$ref":"#/components/responses/CommentForbidden"},"404":{"$ref":"#/components/responses/CommentNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"CommentAfter":{"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="},"CommentId":{"name":"commentId","description":"ID of the comment.","in":"path","required":true,"schema":{"type":"integer"},"example":1203},"CommentTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users and service accounts; tenant users always act on the tenant of their token and this parameter is ignored. Core users must set it, since topic types, topics, and comments all belong to a tenant. A value that is not a tenant URN responds 400.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"CommentTop":{"name":"top","description":"Maximum number of results to return. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000,"default":10},"example":10},"TopicId":{"name":"topicId","description":"ID of the topic.","in":"path","required":true,"schema":{"type":"integer"},"example":42},"TopicTypeId":{"name":"topicTypeId","description":"ID of the topic type.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"case-notes"}},"responses":{"CommentBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation, the request body is not valid JSON, or the tenantId query parameter is not a tenant URN.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentError"},"example":{"errorMessage":"Validation failed with error(s): topicId (params) - Invalid value"}}}},"CommentForbidden":{"description":"User does not have a role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentError"},"example":{"errorMessage":"User Test User (ID: 7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d) not permitted to post comment."}}}},"CommentNotFound":{"description":"Topic type, topic, or comment not found in the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentError"},"example":{"errorMessage":"topic with ID '42' could not be found."}}}},"CommentUnauthorized":{"description":"Request does not include a valid bearer token.","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}}},"schemas":{"Comment":{"type":"object","properties":{"topicId":{"type":"integer","readOnly":true},"id":{"type":"integer","readOnly":true},"title":{"type":"string","nullable":true},"content":{"type":"string"},"context":{"type":"object","description":"Arbitrary JSON context data associated with the comment.","additionalProperties":true},"createdBy":{"allOf":[{"$ref":"#/components/schemas/CommentUser"}],"readOnly":true},"createdOn":{"type":"string","format":"date-time","readOnly":true},"lastUpdatedBy":{"allOf":[{"$ref":"#/components/schemas/CommentUser"}],"readOnly":true},"lastUpdatedOn":{"type":"string","format":"date-time","readOnly":true}},"example":{"topicId":42,"id":1203,"title":"Follow up call","content":"Called the applicant to confirm the mailing address.","context":{"step":"address-verification"},"createdBy":{"id":"7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d","name":"Test User"},"createdOn":"2026-11-02T16:20:00.000Z","lastUpdatedBy":{"id":"7d3c2a1b-4e5f-4a6b-8c9d-0e1f2a3b4c5d","name":"Test User"},"lastUpdatedOn":"2026-11-02T16:20:00.000Z"}},"CommentError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"CommentResultsPage":{"type":"object","description":"Paging information of a result set.","properties":{"after":{"type":"string","description":"Cursor of the page that was returned."},"next":{"type":"string","description":"Cursor of the next page. Not set when there are no more results."},"size":{"type":"integer","description":"Number of results returned."}},"example":{"after":"MTA=","next":"MjA=","size":10}},"CommentUser":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true,"description":"Name of the user. Null when the comment is returned to a topic commenter who is not its author."}}},"Topic":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/TopicType"},"id":{"type":"integer","readOnly":true},"urn":{"type":"string","readOnly":true,"description":"URN of the topic, for example for use as the resource ID of other ADSP resources."},"resourceId":{"type":"string","description":"ID or URN of the entity the topic is about."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"commenters":{"type":"array","description":"IDs of additional users who can read and comment on the topic, for example the person a case is about. Names of other users are removed from comments returned to these users.\n","items":{"type":"string"}},"securityClassification":{"type":"string","readOnly":true,"nullable":true,"description":"Security classification of the topic, set from its topic type when the topic is created.","enum":["public","protected a","protected b","protected c"]},"requiresAttention":{"type":"boolean","readOnly":true,"description":"Set or cleared by the requiresAttention flag of a new comment."}},"example":{"type":{"id":"case-notes","name":"Case notes","adminRoles":["case-supervisor"],"readerRoles":["case-auditor"],"commenterRoles":["case-worker"],"securityClassification":"protected b"},"id":42,"urn":"urn:ads:platform:comment-service:v1:/topics/42","resourceId":"urn:ads:demo:case-service:v1:/cases/case-123","name":"Comments on case-123","description":"Notes about the case.","commenters":["3f2b1c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"],"securityClassification":"protected b","requiresAttention":false}},"TopicType":{"type":"object","description":"Topic type, which sets the roles permitted to administer, comment on, and read topics of the type. Roles are held in the topic's tenant; the comment-admin role always grants administrator access.\n","properties":{"id":{"type":"string"},"name":{"type":"string"},"adminRoles":{"type":"array","description":"Roles that can read and comment on topics of the type, and update or delete any comment on them.","items":{"type":"string"}},"readerRoles":{"type":"array","description":"Roles that can read topics of the type and their comments.","items":{"type":"string"}},"commenterRoles":{"type":"array","description":"Roles that can read topics of the type, post comments, and update or delete their own comments.","items":{"type":"string"}},"securityClassification":{"type":"string","nullable":true,"enum":["public","protected a","protected b","protected c"]}},"example":{"id":"case-notes","name":"Case notes","adminRoles":["case-supervisor"],"readerRoles":["case-auditor"],"commenterRoles":["case-worker"],"securityClassification":"protected b"}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Topic","description":"API to manage topic types, topics, and the comments on a topic."},{"name":"Comment","description":"API to search comments across topics."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Configuration service","version":"2.0.0","description":"The configuration service provides persistence for configuration with write schema validation."},"paths":{"/configuration/v2/configuration/{namespace}":{"parameters":[{"$ref":"#/components/parameters/ConfigurationNamespace"}],"get":{"tags":["Configuration"],"description":"Find configuration in a namespace, sorted by name, with the latest revision of each. Requires the configuration-admin role in the tenant, or the configured-service or export-service export-job role in the tenant or as a core user. Unlike the other read operations, the configuration-reader role is not sufficient, and core users with only the configuration-admin role are not allowed. Tenant users find the configuration of their tenant; core users find the configuration of the tenant given by `tenantId`, or core (platform) configuration without it.\n","parameters":[{"name":"top","description":"Number of results to return in the page, e.g. the top N results. Defaults to 10.","example":10,"in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"after","description":"Cursor for retrieving additional pages. Use the `next` value returned by the previous call; other values are not supported.\n","example":"Mw==","in":"query","required":false,"schema":{"type":"string"}},{"name":"includeActive","description":"Flag indicating if the active revision of each configuration is included.","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"registeredId","description":"Filter to configuration with a `registeredId` property of this value.","in":"query","required":false,"schema":{"type":"string"}},{"name":"criteria","description":"JSON object of criteria. `nameContains` filters by name (case insensitive), and `createDateAfter` and `createDateBefore` filter by the created date of the latest revision. Any other string, number, or boolean property filters on the configuration property of the same name; strings are matched case insensitively as a partial match. Set `useOr` to true to match any rather than all configuration property criteria.\n","example":"{\"nameContains\":\"intake\"}","in":"query","required":false,"schema":{"type":"string","format":"json"}},{"$ref":"#/components/parameters/ConfigurationTenantId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Configuration"},{"type":"object","properties":{"active":{"$ref":"#/components/schemas/ConfigurationRevision"}}}]}},"page":{"$ref":"#/components/schemas/ConfigurationPage"}}},"example":{"results":[{"urn":"urn:ads:platform:configuration-service:v2:/configuration/form-service/intake-application","namespace":"form-service","name":"intake-application","latest":{"revision":1,"configuration":{"id":"intake-application","name":"Intake application"},"created":"2026-09-01T17:00:00.000Z","lastUpdated":"2026-09-24T17:00:00.000Z"}}],"page":{"next":"MQ==","size":1}}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"}}}},"/configuration/v2/configuration/{namespace}/{name}":{"parameters":[{"$ref":"#/components/parameters/ConfigurationNamespace"},{"$ref":"#/components/parameters/ConfigurationName"},{"$ref":"#/components/parameters/ConfigurationTenantId"}],"get":{"tags":["Configuration"],"description":"Retrieves configuration, with its latest and active revisions. Requires the configuration-reader, configuration-admin, configured-service, directory-service resource-resolver, or export-service export-job role, in the tenant or as a core user. Tenant users read the configuration of their tenant, or core (platform) configuration with `core`. Core users read the configuration of the tenant given by `tenantId`, or core configuration without it. Responds with the configuration and no `latest` if it has not been saved.\n","parameters":[{"$ref":"#/components/parameters/ConfigurationCore"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Configuration"},{"type":"object","properties":{"active":{"$ref":"#/components/schemas/ConfigurationRevision"}}}]},"example":{"urn":"urn:ads:platform:configuration-service:v2:/configuration/platform/event-service","namespace":"platform","name":"event-service","latest":{"revision":2,"configuration":{"application-events":{"name":"application-events","definitions":{}}},"created":"2026-09-01T17:00:00.000Z","lastUpdated":"2026-09-24T17:00:00.000Z"},"active":{"revision":1,"configuration":{"application-events":{"name":"application-events","definitions":{}}},"created":"2026-08-01T17:00:00.000Z","lastUpdated":"2026-08-15T17:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"}}},"patch":{"tags":["Configuration"],"description":"Updates the latest configuration revision. Requires the configuration-admin or configured-service role, in the tenant or as a core user. Tenant users update the configuration of their tenant; core users update the configuration of the tenant given by `tenantId`, or core (platform) configuration without it. The resulting configuration is validated against the configuration definition schema, if there is one. Updates do not create a new revision; use the CREATE-REVISION operation to snapshot the latest revision.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ReplaceOperation"},{"$ref":"#/components/schemas/UpdateOperation"},{"$ref":"#/components/schemas/DeleteOperation"}],"discriminator":{"propertyName":"operation","mapping":{"REPLACE":"#/components/schemas/ReplaceOperation","UPDATE":"#/components/schemas/UpdateOperation","DELETE":"#/components/schemas/DeleteOperation"}}},"examples":{"update":{"summary":"Merge an update","value":{"operation":"UPDATE","update":{"application-events":{"name":"application-events","definitions":{}}}}},"replace":{"summary":"Replace the configuration","value":{"operation":"REPLACE","configuration":{"application-events":{"name":"application-events","definitions":{}}}}},"delete":{"summary":"Remove a property","value":{"operation":"DELETE","property":"application-events"}}}}}},"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Configuration"}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"}}},"post":{"tags":["Configuration"],"description":"Creates a new revision of configuration, or sets the active revision. Requires the configuration-admin role, in the tenant or as a core user; the configured-service role is not sufficient. Tenant users act on the configuration of their tenant; core users act on the configuration of the tenant given by `tenantId`, or core (platform) configuration without it.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CreateRevisionOperation"},{"$ref":"#/components/schemas/SetActiveRevisionOperation"}],"discriminator":{"propertyName":"operation","mapping":{"CREATE-REVISION":"#/components/schemas/CreateRevisionOperation","SET-ACTIVE-REVISION":"#/components/schemas/SetActiveRevisionOperation"}}},"examples":{"create-revision":{"summary":"Create a revision","value":{"operation":"CREATE-REVISION"}},"set-active-revision":{"summary":"Set the active revision","value":{"operation":"SET-ACTIVE-REVISION","revision":2}}}}}},"responses":{"200":{"description":"Request completed successfully. CREATE-REVISION responds with the configuration and its new latest revision; SET-ACTIVE-REVISION responds with the active revision number.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Configuration"},{"type":"object","properties":{"namespace":{"type":"string"},"name":{"type":"string"},"active":{"type":"number"}}}]},"examples":{"create-revision":{"summary":"Revision created","value":{"urn":"urn:ads:platform:configuration-service:v2:/configuration/platform/event-service","namespace":"platform","name":"event-service","latest":{"revision":3,"configuration":{"application-events":{"name":"application-events","definitions":{}}},"created":"2026-09-25T17:00:00.000Z","lastUpdated":"2026-09-25T17:00:00.000Z"}}},"set-active-revision":{"summary":"Active revision set","value":{"namespace":"platform","name":"event-service","active":2}}}}}},"400":{"description":"Request is invalid, or the selected revision does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigurationError"},"examples":{"validation":{"summary":"Request validation failed","value":{"errorMessage":"Validation failed with error(s): operation (body) - Invalid value"}},"revision":{"summary":"Revision does not exist","value":{"errorMessage":"Specified revision 9 to set as active cannot be found."}}}}}},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"}}},"delete":{"tags":["Configuration"],"description":"Deletes configuration and all its revisions. Requires the configuration-admin role, in the tenant or as a core user. Tenant users delete the configuration of their tenant; core users delete the configuration of the tenant given by `tenantId`, or core (platform) configuration without it. Responds with `deleted` false if there was nothing to delete.\n","responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"}}}},"/configuration/v2/configuration/{namespace}/{name}/active":{"parameters":[{"$ref":"#/components/parameters/ConfigurationNamespace"},{"$ref":"#/components/parameters/ConfigurationName"},{"$ref":"#/components/parameters/ConfigurationAnonymousTenant"},{"$ref":"#/components/parameters/ConfigurationTenantId"}],"get":{"tags":["Configuration"],"description":"Retrieves the active revision of configuration. Requires the same roles as retrieving configuration, and acts on the same tenant. Anonymous requests (without a bearer token) are allowed if the configuration definition has anonymousRead set, in which case the `tenant` query parameter identifies the tenant and requests are rate limited. Responds with an empty body if there is no active revision and orLatest is not set.\n","security":[{},{"accessToken":[]}],"parameters":[{"name":"orLatest","description":"Flag indicating if the latest revision should be returned if there is no active revision.","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigurationRevision"}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"},"429":{"$ref":"#/components/responses/ConfigurationTooManyRequests"}}}},"/configuration/v2/configuration/{namespace}/{name}/latest":{"get":{"tags":["Configuration"],"description":"Retrieves the configuration of the latest revision. Requires the same roles as retrieving configuration, and acts on the same tenant; tenant users can read core (platform) configuration with `core`. Anonymous requests (without a bearer token) are allowed if the configuration definition has anonymousRead set, in which case the `tenant` query parameter identifies the tenant and requests are rate limited. Responds with an empty object if there is no configuration.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/ConfigurationNamespace"},{"$ref":"#/components/parameters/ConfigurationName"},{"$ref":"#/components/parameters/ConfigurationCore"},{"$ref":"#/components/parameters/ConfigurationAnonymousTenant"},{"$ref":"#/components/parameters/ConfigurationTenantId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object"},"example":{"application-events":{"name":"application-events","definitions":{}}}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"},"429":{"$ref":"#/components/responses/ConfigurationTooManyRequests"}}}},"/configuration/v2/configuration/{namespace}/{name}/revisions":{"get":{"tags":["Configuration"],"description":"Retrieves the revisions of configuration, newest first. Requires the same roles as retrieving configuration, in the tenant or as a core user. Tenant users read the revisions of their tenant's configuration; core users read the revisions of the tenant given by `tenantId`, or of core (platform) configuration without it.\n","parameters":[{"$ref":"#/components/parameters/ConfigurationNamespace"},{"$ref":"#/components/parameters/ConfigurationName"},{"name":"top","description":"Number of revisions to return in a page. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for retrieving additional pages. Use the `next` value returned by the previous call.","example":"MTA=","in":"query","required":false,"schema":{"type":"string"}},{"name":"criteria","description":"JSON object of criteria. `revision` filters to one revision number. Any other property filters on the configuration property of the same name; strings are matched case insensitively as a partial match.\n","example":"{\"revision\":2}","in":"query","required":false,"schema":{"type":"string","format":"json"}},{"$ref":"#/components/parameters/ConfigurationTenantId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/ConfigurationRevision"}},"page":{"$ref":"#/components/schemas/ConfigurationPage"}}},"example":{"results":[{"revision":2,"configuration":{"application-events":{"name":"application-events","definitions":{}}},"created":"2026-09-01T17:00:00.000Z","lastUpdated":"2026-09-24T17:00:00.000Z"},{"revision":1,"configuration":{},"created":"2026-08-01T17:00:00.000Z","lastUpdated":"2026-08-15T17:00:00.000Z"}],"page":{"next":"Mg==","size":2}}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"}}}},"/configuration/v2/configuration/{namespace}/{name}/revisions/{revision}":{"get":{"tags":["Configuration"],"description":"Retrieves the configuration of a specific revision. Requires the same roles as retrieving configuration, and acts on the same tenant as retrieving revisions.\n","parameters":[{"$ref":"#/components/parameters/ConfigurationNamespace"},{"$ref":"#/components/parameters/ConfigurationName"},{"name":"revision","description":"Revision number to retrieve.","in":"path","required":true,"schema":{"type":"integer","minimum":0},"example":1},{"$ref":"#/components/parameters/ConfigurationTenantId"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object"},"example":{"application-events":{"name":"application-events","definitions":{}}}}}},"400":{"$ref":"#/components/responses/ConfigurationBadRequest"},"401":{"$ref":"#/components/responses/ConfigurationUnauthorized"},"403":{"$ref":"#/components/responses/ConfigurationForbidden"},"404":{"description":"Revision cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigurationError"},"example":{"errorMessage":"revision with ID '9' could not be found."}}}}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"ConfigurationAnonymousTenant":{"name":"tenant","description":"URN of the tenant to read configuration for, for anonymous requests, since there is no token to determine the tenant from. Anonymous requests without it read core (platform) configuration. Ignored for authenticated requests.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"ConfigurationCore":{"name":"core","description":"Flag indicating if the core (platform) instead of tenant configuration should be retrieved. The flag is set when the parameter is present, regardless of its value. Tenant users with a reader role can read core configuration this way.\n","in":"query","required":false,"allowEmptyValue":true,"schema":{"type":"boolean"}},"ConfigurationName":{"name":"name","description":"Name of the configuration. Letters, numbers, dashes, underscores, and spaces only.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"event-service"},"ConfigurationNamespace":{"name":"namespace","description":"Namespace of the configuration. Letters, numbers, dashes, underscores, and spaces only.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"platform"},"ConfigurationTenantId":{"name":"tenantId","description":"URN of the tenant to act on. Only used for core (platform) users, and for anonymous requests where `tenant` is not set; tenant users always act on the tenant of their token. Core users who leave it out act on core (platform) configuration.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"ConfigurationBadRequest":{"description":"Request is invalid, for example a path or query parameter failed validation, the operation is not recognized, a tenant ID is not a valid URN, or the configuration does not match the configuration definition schema.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigurationError"},"examples":{"validation":{"summary":"Request validation failed","value":{"errorMessage":"Validation failed with error(s): operation (body) - Invalid value"}},"operation":{"summary":"Operation is missing a required property","value":{"errorMessage":"Update request must include 'update' property."}},"schema":{"summary":"Configuration does not match the definition schema","value":{"errorMessage":"Value not valid for configuration 'platform:event-service': /definitions must be object"}}}}}},"ConfigurationForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigurationError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to modify configuration."}}}},"ConfigurationTooManyRequests":{"description":"Too many anonymous requests. Anonymous requests are limited to 200 per IP address in 5 minutes.","content":{"text/html":{"schema":{"type":"string"},"example":"Too many requests, please try again later."}}},"ConfigurationUnauthorized":{"description":"Request does not include a valid bearer token, or the configuration does not allow anonymous access.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigurationError"},"example":{"errorMessage":"Anonymous access to configuration not allowed."}}}}},"schemas":{"Configuration":{"type":"object","properties":{"urn":{"type":"string","readOnly":true},"namespace":{"type":"string"},"name":{"type":"string"},"latest":{"$ref":"#/components/schemas/ConfigurationRevision"}},"example":{"urn":"urn:ads:platform:configuration-service:v2:/configuration/platform/event-service","namespace":"platform","name":"event-service","latest":{"revision":2,"configuration":{"application-events":{"name":"application-events","definitions":{}}},"created":"2026-09-01T17:00:00.000Z","lastUpdated":"2026-09-24T17:00:00.000Z"}}},"ConfigurationError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Anonymous access to configuration not allowed."}},"ConfigurationPage":{"type":"object","properties":{"after":{"description":"The cursor used to generate the current page. Don't use it as the `after` parameter of the next call, as it repeats the page just returned.\n","type":"string"},"next":{"description":"Cursor for requesting the next page. Not set when no more results are available.","type":"string"},"size":{"description":"The number of results returned.","type":"number"}},"example":{"after":"Mw==","next":"Ng==","size":3}},"ConfigurationRevision":{"type":"object","properties":{"revision":{"type":"number","readOnly":true},"configuration":{"type":"object"},"created":{"type":"string","format":"date-time","readOnly":true},"lastUpdated":{"type":"string","format":"date-time","readOnly":true}},"example":{"revision":2,"configuration":{"application-events":{"name":"application-events","definitions":{}}},"created":"2026-09-01T17:00:00.000Z","lastUpdated":"2026-09-24T17:00:00.000Z"}},"CreateRevisionOperation":{"type":"object","description":"Creates a new latest revision with a copy of the configuration of the current latest revision.","properties":{"operation":{"type":"string","enum":["CREATE-REVISION"]}},"required":["operation"]},"DeleteOperation":{"type":"object","description":"Removes a property, specified as a path such as a.b, from the latest revision.","properties":{"operation":{"type":"string","enum":["DELETE"]},"property":{"type":"string"}},"required":["operation","property"]},"ReplaceOperation":{"type":"object","description":"Replaces the configuration of the latest revision.","properties":{"operation":{"type":"string","enum":["REPLACE"]},"configuration":{"type":"object"}},"required":["operation","configuration"]},"SetActiveRevisionOperation":{"type":"object","description":"Sets the active revision.","properties":{"operation":{"type":"string","enum":["SET-ACTIVE-REVISION"]},"revision":{"type":"number","minimum":0,"description":"Revision number to set as active. The revision must exist."},"setActiveRevision":{"type":"number","deprecated":true,"description":"Deprecated; use revision instead."}},"required":["operation"]},"UpdateOperation":{"type":"object","description":"Merges the update into the latest revision. Top level object properties are merged one level deep; other values are replaced.\n","properties":{"operation":{"type":"string","enum":["UPDATE"]},"update":{"type":"object"}},"required":["operation","update"]}}},"security":[{"accessToken":[]}],"tags":[{"name":"Configuration","description":"API to store and read configuration."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Directory service","version":"0.0.0","description":"Service that provides a register of services and APIs for service discovery."},"paths":{"/directory/v2/namespaces":{"post":{"tags":["Directory"],"description":"Creates the directory namespace of the current user's tenant, with no entries. The namespace name is the tenant name in kebab case. Requires the directory-admin role in the user's tenant. The request has no body and the response has no body. Requires a tenant user or service account; core (platform) users have no tenant to create a namespace for.\n","responses":{"201":{"description":"Namespace created."},"400":{"description":"The namespace of the tenant already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"Value not valid for Create new namespace: namespace test-tenant exists"}}}},"403":{"description":"User does not have the directory-admin role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"User Test User (ID: 7c3e1a52-1f0b-4bd3-9a41-2b8f6c5d9e10) not permitted to create namespace."}}}}}}},"/directory/v2/namespaces/{namespace}/entries":{"get":{"tags":["Directory"],"description":"Retrieves all entries (services and APIs) of the namespace. Anonymous access is allowed; no role is required. Responds with an empty array when the namespace has no entries.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"}],"responses":{"200":{"description":"Entries of the namespace.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryEntry"}}}}},"400":{"$ref":"#/components/responses/DirectoryBadRequest"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"}}}},"/directory/v2/namespaces/{namespace}/services":{"post":{"tags":["Directory"],"description":"Adds a service entry to the namespace. Requires the directory-admin role in the tenant of the namespace; core users and users of other tenants are not permitted. Creates the namespace if it does not exist.\n","parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"string","description":"Name of the service."},"url":{"type":"string","description":"URL of the service."}},"required":["service","url"]},"example":{"service":"form-service","url":"https://form-service.test.gov.ab.ca"}}}},"responses":{"201":{"description":"Service entry added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryService"},"example":{"service":"form-service","host":"https://form-service.test.gov.ab.ca"}}}},"403":{"$ref":"#/components/responses/DirectoryForbidden"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"},"409":{"$ref":"#/components/responses/DirectoryConflict"}}}},"/directory/v2/namespaces/{namespace}/services/{service}":{"get":{"tags":["Directory"],"description":"Retrieves the service entry with the metadata of the service. The directory requests the metadata from the service URL, and caches it for 5 minutes. Anonymous access is allowed; no role is required.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"name":"service","description":"Name of the service, for example `form-service`.","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"form-service"}],"responses":{"200":{"description":"Service entry with its metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string","readOnly":true},"service":{"type":"string"},"host":{"type":"string"},"metadata":{"$ref":"#/components/schemas/ServiceMetadata"}}},"example":{"_id":"64f1c2a3b4c5d6e7f8a9b0c1","service":"form-service","host":"https://form-service.test.gov.ab.ca","metadata":{"name":"Form service","description":"Service for submitting forms.","_links":{"self":{"href":"https://form-service.test.gov.ab.ca/"},"health":{"href":"https://form-service.test.gov.ab.ca/health"},"api":{"href":"https://form-service.test.gov.ab.ca/form/v1"}}}}}}},"400":{"description":"A path parameter failed validation, or the service is not in the namespace. When the namespace has no directory, the response is the plain text `Bad Request`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"Value not valid for Update service: Cannot find service: form-service"}}}},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"},"424":{"description":"The metadata could not be retrieved from the service URL, or it is not a JSON object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"Failed to fetch data from remote server"}}}}}},"patch":{"tags":["Directory"],"description":"Updates the URL of the service entry. Requires the directory-admin role in the tenant of the namespace; core users and users of other tenants are not permitted. Responds 201 with no body on success.\n","parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"New URL of the service."}},"required":["url"]},"example":{"url":"https://form-service.test.gov.ab.ca"}}}},"responses":{"201":{"description":"Service entry updated."},"400":{"description":"The service is not in the namespace.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string"}}},"example":{"errors":"form-service does not exist in test-tenant"}}}},"403":{"$ref":"#/components/responses/DirectoryForbidden"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"}}},"delete":{"tags":["Directory"],"description":"Deletes the service entry. API entries of the service are not deleted. Requires the directory-admin role in the tenant of the namespace; core users and users of other tenants are not permitted. Responds 200 with no JSON body on success.\n","parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"}],"responses":{"200":{"description":"Service entry deleted."},"400":{"description":"The namespace has no directory, or the service is not in the namespace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"Value not valid for Delete namespace service: Cannot find form-service"}}}},"403":{"$ref":"#/components/responses/DirectoryForbidden"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"}}}},"/directory/v2/namespaces/{namespace}/services/{service}/apis":{"get":{"tags":["Directory"],"description":"Retrieves the entry of the service and the entries of its APIs. Anonymous access is allowed; no role is required. Characters other than letters, spaces, and hyphens are removed from the service name before matching.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"}],"responses":{"200":{"description":"Service entry and its API entries.","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"allOf":[{"$ref":"#/components/schemas/DirectoryEntry"}],"nullable":true,"description":"Entry of the service, or null if only API entries are registered."},"apis":{"type":"array","description":"Entries of the service APIs.","items":{"$ref":"#/components/schemas/DirectoryEntry"}}}},"example":{"service":{"urn":"urn:ads:test-tenant:form-service","url":"https://form-service.test.gov.ab.ca","service":"form-service","namespace":"test-tenant"},"apis":[{"urn":"urn:ads:test-tenant:form-service:v1","url":"https://form-service.test.gov.ab.ca/form/v1","service":"form-service:v1","namespace":"test-tenant"}]}}}},"400":{"$ref":"#/components/responses/DirectoryBadRequest"},"404":{"description":"No tenant has the name of the namespace, or the namespace has no entry for the service or its APIs. The second case responds with the plain text `Not Found`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"directory namespace with ID 'test-tenant' could not be found."}}}}}},"post":{"tags":["Directory"],"description":"Adds an API entry for the service, named `{service}:{api}`. The service entry does not need to exist. Requires the directory-admin role in the tenant of the namespace; core users and users of other tenants are not permitted. Creates the namespace if it does not exist.\n","parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"api":{"type":"string","description":"Name of the API, usually its version."},"url":{"type":"string","description":"URL of the API."}},"required":["api","url"]},"example":{"api":"v1","url":"https://form-service.test.gov.ab.ca/form/v1"}}}},"responses":{"201":{"description":"API entry added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryService"}}}},"403":{"$ref":"#/components/responses/DirectoryForbidden"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"},"409":{"$ref":"#/components/responses/DirectoryConflict"}}}},"/directory/v2/namespaces/{namespace}/services/{service}/apis/{api}":{"get":{"tags":["Directory"],"description":"Retrieves the entry of the service API. Anonymous access is allowed; no role is required.\n","security":[{},{"accessToken":[]}],"parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"},{"$ref":"#/components/parameters/DirectoryApiName"}],"responses":{"200":{"description":"Entry of the service API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryEntry"}}}},"400":{"$ref":"#/components/responses/DirectoryBadRequest"},"404":{"description":"No tenant has the name of the namespace, or the API is not in the namespace. The second case responds with the plain text `Not Found`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"directory namespace with ID 'test-tenant' could not be found."}}}}}},"patch":{"tags":["Directory"],"description":"Updates the URL of the service API entry. Requires the directory-admin role in the tenant of the namespace; core users and users of other tenants are not permitted. Responds 201 with no body on success.\n","parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"},{"$ref":"#/components/parameters/DirectoryApiName"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"New URL of the API."}},"required":["url"]},"example":{"url":"https://form-service.test.gov.ab.ca/form/v1"}}}},"responses":{"201":{"description":"API entry updated."},"400":{"description":"The API is not in the namespace.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string"}}},"example":{"errors":"form-service:v1 does not exist in test-tenant"}}}},"403":{"$ref":"#/components/responses/DirectoryForbidden"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"}}},"delete":{"tags":["Directory"],"description":"Deletes the service API entry. Requires the directory-admin role in the tenant of the namespace; core users and users of other tenants are not permitted. Responds 200 with no JSON body on success.\n","parameters":[{"$ref":"#/components/parameters/DirectoryNamespace"},{"$ref":"#/components/parameters/DirectoryServiceName"},{"$ref":"#/components/parameters/DirectoryApiName"}],"responses":{"200":{"description":"API entry deleted."},"400":{"description":"The namespace has no directory, or the API is not in the namespace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"Value not valid for Delete namespace service: Cannot find form-service:v1"}}}},"403":{"$ref":"#/components/responses/DirectoryForbidden"},"404":{"$ref":"#/components/responses/DirectoryNamespaceNotFound"}}}},"/resource/v1/resources":{"get":{"tags":["Resource"],"description":"Retrieves the resources of the tenant. Requires the resource-browser or resource-tagger role in the tenant. Set criteria to an array of resource URNs to retrieve those resources in one request; URNs that are not found are left out, and paging parameters are ignored.\n","parameters":[{"$ref":"#/components/parameters/ResourceTop"},{"$ref":"#/components/parameters/ResourceAfter"},{"name":"includeTags","description":"Embed up to 10 tags of each resource.","in":"query","required":false,"schema":{"type":"boolean"},"example":true},{"name":"criteria","description":"Criteria for the resources to return, as JSON: either an object, or an array of resource URNs. Responds 400 if an array element is not a valid URN.\n","in":"query","required":false,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"typeEquals":{"type":"string"}}},{"type":"array","items":{"type":"string"}}]},"example":["urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c"]}}}],"responses":{"200":{"description":"Page of resources.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}},"page":{"$ref":"#/components/schemas/ResourcePage"}}},"example":{"results":[{"urn":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c","name":"application-attachment.pdf","type":"file","_links":{"represents":{"href":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c"},"collection":{"href":"urn:ads:platform:directory-service:resource-v1:/resources"}},"_embedded":{}}],"page":{"next":"MTA=","size":1}}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}}},"/resource/v1/resources/{resource}":{"parameters":[{"$ref":"#/components/parameters/ResourceUrnPath"}],"get":{"tags":["Resource"],"description":"Retrieves a resource of the tenant. Requires the resource-browser or resource-tagger role in the tenant.\n","responses":{"200":{"description":"The resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"},"404":{"$ref":"#/components/responses/ResourceNotFound"}}},"delete":{"tags":["Resource"],"description":"Deletes a resource of the tenant and its tag associations. The represented resource is not affected. Requires the directory-admin role in the tenant. Responds with `deleted: false` if the resource does not exist.\n","responses":{"200":{"description":"Result of the delete.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResult"}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}}},"/resource/v1/resources/{resource}/tags":{"get":{"tags":["Resource"],"description":"Retrieves the tags of a resource of the tenant. Requires the resource-browser or resource-tagger role in the tenant.\n","parameters":[{"$ref":"#/components/parameters/ResourceUrnPath"},{"$ref":"#/components/parameters/ResourceTop"},{"$ref":"#/components/parameters/ResourceAfter"}],"responses":{"200":{"description":"Page of tags.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"page":{"$ref":"#/components/schemas/ResourcePage"}}},"example":{"results":[{"urn":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications","label":"Priority applications","value":"priority-applications","_links":{"self":{"href":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications"},"resources":{"href":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications/resources"},"collection":{"href":"urn:ads:platform:directory-service:resource-v1:/tags"}}}],"page":{"next":"MTA=","size":1}}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}}},"/resource/v1/tags":{"get":{"tags":["Resource"],"description":"Retrieves the tags of the tenant. Requires the resource-browser or resource-tagger role in the tenant.\n","parameters":[{"$ref":"#/components/parameters/ResourceTop"},{"$ref":"#/components/parameters/ResourceAfter"},{"name":"resource","description":"URN of a resource; retrieves only the tags of that resource.","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2000},"example":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c"}],"responses":{"200":{"description":"Page of tags.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"page":{"$ref":"#/components/schemas/ResourcePage"}}},"example":{"results":[{"urn":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications","label":"Priority applications","value":"priority-applications","_links":{"self":{"href":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications"},"resources":{"href":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications/resources"},"collection":{"href":"urn:ads:platform:directory-service:resource-v1:/tags"}}}],"page":{"next":"MTA=","size":1}}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}},"post":{"tags":["Resource"],"description":"Tags or untags a resource of the tenant. Requires the resource-tagger role in the tenant. Tagging creates the tag and the resource if they don't exist. The resource URN must be under an API registered in the directory.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TagResourceOperation"},{"$ref":"#/components/schemas/UntagResourceOperation"}],"discriminator":{"propertyName":"operation","mapping":{"tag-resource":"#/components/schemas/TagResourceOperation","untag-resource":"#/components/schemas/UntagResourceOperation"}}},"examples":{"tag":{"summary":"Tag a resource","value":{"operation":"tag-resource","tag":{"label":"Priority applications"},"resource":{"urn":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c","name":"application-attachment.pdf"}}},"untag":{"summary":"Untag a resource","value":{"operation":"untag-resource","tag":{"value":"priority-applications"},"resource":{"urn":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c"}}}}}}},"responses":{"200":{"description":"Result of the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagOperationResult"},"example":{"tagged":true,"tag":{"urn":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications","label":"Priority applications","value":"priority-applications"},"resource":{"urn":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c","name":"application-attachment.pdf"}}}}},"400":{"description":"Request is invalid: a body parameter failed validation, the tag has no label or value, the resource URN is not a resource URN, or the URN's API is not registered in the directory.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceError"},"example":{"errorMessage":"Resource URL cannot be resolved. Associated API must be registered in the directory."}}}},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}}},"/resource/v1/tags/{tag}":{"parameters":[{"$ref":"#/components/parameters/ResourceTagValue"}],"get":{"tags":["Resource"],"description":"Retrieves a tag of the tenant. Requires the resource-browser, resource-tagger, or resource-resolver role. Core users with one of these roles are also permitted, and act on the tenant given by the tenantId parameter.\n","parameters":[{"$ref":"#/components/parameters/ResourceTenantId"}],"responses":{"200":{"description":"The tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"},"404":{"$ref":"#/components/responses/ResourceNotFound"}}},"delete":{"tags":["Resource"],"description":"Deletes a tag of the tenant and its associations with resources. Requires the directory-admin role in the tenant. Responds with `deleted: false` if the tag does not exist.\n","responses":{"200":{"description":"Result of the delete.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResult"}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}}},"/resource/v1/tags/{tag}/resources":{"get":{"tags":["Resource"],"description":"Retrieves the resources of the tenant that have the tag. Requires the resource-browser or resource-tagger role in the tenant. With includeRepresents, the directory also retrieves each represented resource from its API using the caller's token, and passes any other query parameters through to that request.\n","parameters":[{"$ref":"#/components/parameters/ResourceTagValue"},{"$ref":"#/components/parameters/ResourceTop"},{"$ref":"#/components/parameters/ResourceAfter"},{"name":"includeRepresents","description":"Embed the represented resource of each result, for resources that match a resource type.","in":"query","required":false,"schema":{"type":"boolean"},"example":true},{"name":"criteria","description":"Criteria for the resources to return, as JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"typeEquals":{"type":"string"}}},"example":{"typeEquals":"file"}}}}],"responses":{"200":{"description":"Page of tagged resources.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}},"page":{"$ref":"#/components/schemas/ResourcePage"}}},"example":{"results":[{"urn":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c","name":"application-attachment.pdf","type":"file","_links":{"represents":{"href":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c"},"collection":{"href":"urn:ads:platform:directory-service:resource-v1:/resources"}},"_embedded":{}}],"page":{"next":"MTA=","size":1}}}}},"400":{"$ref":"#/components/responses/ResourceBadRequest"},"401":{"$ref":"#/components/responses/ResourceUnauthorized"},"403":{"$ref":"#/components/responses/ResourceForbidden"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"DirectoryApiName":{"name":"api","description":"Name of the service API, usually its version, for example `v1`.","in":"path","required":true,"schema":{"type":"string"},"example":"v1"},"DirectoryNamespace":{"name":"namespace","description":"Namespace of the directory, which is the name of a tenant in kebab case (for example `test-tenant` for the tenant named Test Tenant). The namespace must match the name of a tenant; hyphens are read as spaces and the match ignores case. Read operations respond 400 when the namespace is empty or longer than 50 characters.\n","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"test-tenant"},"DirectoryServiceName":{"name":"service","description":"Name of the service, for example `form-service`.","in":"path","required":true,"schema":{"type":"string"},"example":"form-service"},"ResourceAfter":{"name":"after","description":"Cursor for the page of results to retrieve, from the `next` value of the previous page.","in":"query","required":false,"schema":{"type":"string"},"example":"MTA="},"ResourceTagValue":{"name":"tag","description":"Value of the tag.","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-z-]{1,100}$"},"example":"priority-applications"},"ResourceTenantId":{"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. Without it, core users read platform (core) tags.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"},"ResourceTop":{"name":"top","description":"Number of results to retrieve. Defaults to 10.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500},"example":10},"ResourceUrnPath":{"name":"resource","description":"URN of the resource, URL encoded. Responds 400 if the value does not begin with `urn:ads:` or has an empty element.\n","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":2000},"example":"urn%3Aads%3Aplatform%3Afile-service%3Av1%3A%2Ffiles%2Fff118afa-f74e-44ac-8866-7ebd5a43cb4c"}},"responses":{"DirectoryBadRequest":{"description":"Request is invalid, for example a path parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"Validation failed with error(s): namespace (params) - Invalid value"}}}},"DirectoryConflict":{"description":"An entry with the name already exists in the namespace. The response has no body."},"DirectoryForbidden":{"description":"User does not have the directory-admin role in the tenant of the namespace. Anonymous requests, core users, and users of other tenants also receive this response.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"User Test User (ID: 7c3e1a52-1f0b-4bd3-9a41-2b8f6c5d9e10) not permitted to updated directory."}}}},"DirectoryNamespaceNotFound":{"description":"No tenant has the name of the namespace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryError"},"example":{"errorMessage":"directory namespace with ID 'test-tenant' could not be found."}}}},"ResourceBadRequest":{"description":"Request is invalid, for example a path, query, or body parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceError"},"example":{"errorMessage":"Validation failed with error(s): top (query) - Invalid value"}}}},"ResourceForbidden":{"description":"User does not have a role required for the operation in the tenant. Core users without a tenant also receive this response.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceError"},"example":{"errorMessage":"User Test User (ID: 7c3e1a52-1f0b-4bd3-9a41-2b8f6c5d9e10) not permitted to get tags."}}}},"ResourceNotFound":{"description":"The tag or resource is not found in the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceError"},"example":{"errorMessage":"tag with ID 'priority-applications' could not be found."}}}},"ResourceUnauthorized":{"description":"Request does not include a valid bearer token. The response is the plain text `Unauthorized`."}},"schemas":{"DeleteResult":{"type":"object","properties":{"deleted":{"type":"boolean","description":"False if there was nothing to delete."}},"example":{"deleted":true}},"DirectoryEntry":{"title":"Directory entry","type":"object","properties":{"urn":{"type":"string","description":"ADSP URN of the service or API."},"url":{"type":"string","description":"URL of the service or API."},"service":{"type":"string","description":"Name of the entry: the service name for a service entry, or `{service}:{api}` for an API entry.\n"},"namespace":{"type":"string","description":"Namespace of the directory entry."}},"example":{"urn":"urn:ads:test-tenant:form-service:v1","url":"https://form-service.test.gov.ab.ca/form/v1","service":"form-service:v1","namespace":"test-tenant"}},"DirectoryError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"DirectoryService":{"title":"Directory service entry","description":"Entry as stored in the directory.","type":"object","properties":{"service":{"type":"string","description":"Name of the entry; `{service}:{api}` for an API entry."},"host":{"type":"string","description":"URL of the service or API."}},"example":{"service":"form-service:v1","host":"https://form-service.test.gov.ab.ca/form/v1"}},"Link":{"type":"object","properties":{"href":{"type":"string"},"title":{"type":"string"}}},"Resource":{"type":"object","properties":{"urn":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","description":"Resource type that matched the resource URN, if any."},"_links":{"type":"object","readOnly":true,"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}}}},"_embedded":{"type":"object","readOnly":true,"description":"The represented resource (when `includeRepresents` is set) and the tags of the resource (when `includeTags` is set).\n","properties":{"represents":{"type":"object"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}}}},"example":{"urn":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c","name":"application-attachment.pdf","type":"file","_links":{"self":{"href":"urn:ads:platform:directory-service:resource-v1:/resources/urn%3Aads%3Aplatform%3Afile-service%3Av1%3A%2Ffiles%2Fff118afa-f74e-44ac-8866-7ebd5a43cb4c"},"represents":{"href":"urn:ads:platform:file-service:v1:/files/ff118afa-f74e-44ac-8866-7ebd5a43cb4c"},"tags":{"href":"urn:ads:platform:directory-service:resource-v1:/resources/urn%3Aads%3Aplatform%3Afile-service%3Av1%3A%2Ffiles%2Fff118afa-f74e-44ac-8866-7ebd5a43cb4c/tags"},"collection":{"href":"urn:ads:platform:directory-service:resource-v1:/resources"}},"_embedded":{}}},"ResourceError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"ResourcePage":{"type":"object","properties":{"next":{"description":"Cursor for requesting the next page, if any. Not set when no more results are available.","type":"string"},"size":{"description":"The number of results returned.","type":"number"},"after":{"description":"The cursor used to generate the current page. Don't use this as the `after` parameter in subsequent calls, as it repeats the page just returned.\n","type":"string"}},"example":{"next":"MTA=","size":1}},"ResourceSpecification":{"type":"object","properties":{"urn":{"type":"string","description":"URN of the resource, in the form `urn:ads:{namespace}:{service}:{api}:{resource}`. The API must be registered in the directory.\n","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":250},"description":{"type":"string","minLength":1,"maxLength":2000}},"required":["urn"]},"ServiceMetadata":{"title":"Service metadata","type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"_links":{"type":"object","properties":{"self":{"$ref":"#/components/schemas/Link"},"api":{"oneOf":[{"$ref":"#/components/schemas/Link"},{"type":"array","items":{"$ref":"#/components/schemas/Link"}}]},"docs":{"$ref":"#/components/schemas/Link"},"health":{"$ref":"#/components/schemas/Link"}},"additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/Link"},{"type":"array","items":{"$ref":"#/components/schemas/Link"}}]}}},"example":{"name":"Form service","description":"Service for submitting forms.","_links":{"self":{"href":"https://form-service.test.gov.ab.ca/"},"health":{"href":"https://form-service.test.gov.ab.ca/health"},"api":{"href":"https://form-service.test.gov.ab.ca/form/v1"},"docs":{"href":"https://form-service.test.gov.ab.ca/swagger/docs/v1"}}}},"Tag":{"type":"object","properties":{"urn":{"type":"string","readOnly":true},"label":{"type":"string"},"value":{"type":"string"},"_links":{"type":"object","readOnly":true,"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}}}}},"example":{"urn":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications","label":"Priority applications","value":"priority-applications","_links":{"self":{"href":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications"},"resources":{"href":"urn:ads:platform:directory-service:resource-v1:/tags/priority-applications/resources"},"collection":{"href":"urn:ads:platform:directory-service:resource-v1:/tags"}}}},"TagOperationResult":{"type":"object","properties":{"tagged":{"type":"boolean","description":"Set for tag-resource; false if the resource already had the tag."},"untagged":{"type":"boolean","description":"Set for untag-resource; false if the resource did not have the tag."},"tag":{"$ref":"#/components/schemas/Tag"},"resource":{"$ref":"#/components/schemas/Resource"}}},"TagResourceOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["tag-resource"]},"tag":{"$ref":"#/components/schemas/TagSpecification"},"resource":{"$ref":"#/components/schemas/ResourceSpecification"}},"required":["operation","tag","resource"]},"TagSpecification":{"type":"object","description":"Tag to apply or remove. Either label or value must be set; the value defaults to the label in kebab case.","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"value":{"type":"string","pattern":"^[0-9a-z-]{1,100}$"}}},"UntagResourceOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["untag-resource"]},"tag":{"$ref":"#/components/schemas/TagSpecification"},"resource":{"$ref":"#/components/schemas/ResourceSpecification"}},"required":["operation","tag","resource"]}}},"security":[{"accessToken":[]}],"tags":[{"name":"Directory","description":"Register of service and API entries in tenant namespaces, for service discovery."},{"name":"Resource","description":"Tags and tagged resources under APIs registered in the directory."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Event service","version":"1.0.0","description":"There are two main uses for the Event Service by GOA applications;\n1. For triggering notifications via the ADSP Notification Service.\nSee [the tutorials](https://govalta.github.io/adsp-monorepo/tutorials/notification-service/notification-service.html)\nfor a full description of how to use events with the Notification Service.\n2. For recording occurrences of specific domain events in a log. When an event is logged, the payload is also recorded as\na JSON object, giving the application full control over its content.\n\nDomain events are defined by developers in the [Tenant Admin Webapp](https://adsp-uat.alberta.ca), and then triggered\nby the API described below.\n"},"paths":{"/event/v1/definitions":{"get":{"tags":["Event Definition"],"description":"Retrieves the event definitions of the tenant and the core (platform) definitions, as a flat array with tenant definitions first. Requires the event-admin role or the configuration service configuration-reader role (`urn:ads:platform:configuration-service:configuration-reader`).\n\nTenant users read the definitions of their own tenant. Core users with either role set the `tenantId` query parameter to include a tenant's definitions; without it, only core definitions are returned.\n","parameters":[{"$ref":"#/components/parameters/EventTenantId"}],"responses":{"200":{"description":"Event definitions successfully retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventDefinition"}}}}},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"description":"User does not have the event-admin or configuration-reader role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to find event definitions."}}}}}},"post":{"tags":["Event Definition"],"description":"Creates an event definition in the tenant, merging it into its namespace. Requires the event-admin role. Tenant users create definitions in their own tenant; core users with the role must set the `tenantId` query parameter, and without it the request responds 400. Core (platform) definitions are not writable via this endpoint.\n\nThe payload schema must be a valid JSON schema. Changes are applied through the configuration service, so they may take a few minutes to apply to sent events.\n","parameters":[{"$ref":"#/components/parameters/EventTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"namespace":{"type":"string","description":"Namespace of the event definition.","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"name":{"type":"string","description":"Name of the event definition.","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"}},"required":["namespace","name"]},{"$ref":"#/components/schemas/EventDefinitionRequest"}]},"example":{"namespace":"application-events","name":"user-registration","description":"A new user registered.","payloadSchema":{"type":"object","properties":{"userId":{"type":"string"}},"required":["userId"]}}}}},"responses":{"200":{"description":"Event definition successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDefinition"}}}},"400":{"description":"Request is invalid, for example namespace or name does not match the pattern, the payload schema is not a valid JSON schema, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Event definition 'application-events:user-registration' has an invalid JSON schema: schema is invalid: data/type must be equal to one of the allowed values, data/type must be array, data/type must match a schema in anyOf"}}}},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"$ref":"#/components/responses/EventForbidden"},"409":{"$ref":"#/components/responses/EventDefinitionConflict"}}}},"/event/v1/definitions/{namespace}/{name}":{"get":{"tags":["Event Definition"],"description":"Retrieves a single event definition. A tenant definition takes precedence over a core definition with the same namespace and name. Requires the event-admin role or the configuration service configuration-reader role (`urn:ads:platform:configuration-service:configuration-reader`).\n\nTenant users read definitions of their own tenant and core definitions. Core users with either role set the `tenantId` query parameter to read a tenant's definitions; without it, only core definitions are found.\n","parameters":[{"$ref":"#/components/parameters/EventDefinitionNamespace"},{"$ref":"#/components/parameters/EventDefinitionName"},{"$ref":"#/components/parameters/EventTenantId"}],"responses":{"200":{"description":"Event definition successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDefinition"}}}},"400":{"description":"Namespace or name does not match the pattern.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Validation failed with error(s): namespace (params) - Invalid value"}}}},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"description":"User does not have the event-admin or configuration-reader role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to find event definition."}}}},"404":{"$ref":"#/components/responses/EventDefinitionNotFound"}}},"patch":{"tags":["Event Definition"],"description":"Replaces the description and payload schema of a tenant event definition. Requires the event-admin role. Tenant users update definitions in their own tenant; core users with the role must set the `tenantId` query parameter, and without it the request responds 400. Core (platform) definitions are not writable via this endpoint, and respond 404.\n","parameters":[{"$ref":"#/components/parameters/EventDefinitionNamespace"},{"$ref":"#/components/parameters/EventDefinitionName"},{"$ref":"#/components/parameters/EventTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDefinitionRequest"},"example":{"description":"A new user registered.","payloadSchema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"}},"required":["userId"]}}}}},"responses":{"200":{"description":"Event definition successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDefinition"}}}},"400":{"description":"Request is invalid, for example namespace or name does not match the pattern, the payload schema is not a valid JSON schema, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Validation failed with error(s): payloadSchema (body) - Invalid value"}}}},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"$ref":"#/components/responses/EventForbidden"},"404":{"$ref":"#/components/responses/EventDefinitionNotFound"}}},"delete":{"tags":["Event Definition"],"description":"Deletes an event definition from the tenant. Requires the event-admin role. Tenant users delete definitions in their own tenant; core users with the role must set the `tenantId` query parameter, and without it the request responds 400. Core (platform) definitions are not deletable via this endpoint, and respond 404. The namespace itself is removed when its last definition is deleted.\n","parameters":[{"$ref":"#/components/parameters/EventDefinitionNamespace"},{"$ref":"#/components/parameters/EventDefinitionName"},{"$ref":"#/components/parameters/EventTenantId"}],"responses":{"200":{"description":"Event definition successfully deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDefinitionDeleted"}}}},"400":{"$ref":"#/components/responses/EventBadRequest"},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"$ref":"#/components/responses/EventForbidden"},"404":{"$ref":"#/components/responses/EventDefinitionNotFound"}}}},"/event/v1/events":{"post":{"tags":["Event"],"description":"Send an event. Requires the event-sender role.\n\nTenant users and tenant service accounts always send the event in the tenant of their token; a `tenantId` in the body is ignored. Core (platform) service accounts send an event on behalf of a tenant by setting the `tenantId` query parameter or the `tenantId` body property. A core user without either responds 400.\n\nIf there is an event definition (tenant or core) for the namespace and name, the payload is validated against the definition's payload schema. If there is no matching definition, the event is treated as an ad hoc event: it is still sent and logged, but the payload is not validated.\n\nSent events are written to the event log in the value service, routed to subscribers such as the notification service, and streamed by the push service; see the [event service guide](https://govalta.github.io/adsp-monorepo/services/event-service.html).\n","parameters":[{"$ref":"#/components/parameters/EventTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"namespace":{"type":"string","description":"The namespace of the event.","minLength":1,"maxLength":50,"example":"application-events"},"name":{"type":"string","description":"The name of the event.","minLength":1,"maxLength":50,"example":"user-registration"},"correlationId":{"type":"string","nullable":true,"description":"An optional reference to an object that can be used by the event receiver for matching purposes.","example":"Bobs-user-id"},"context":{"type":"object","nullable":true,"additionalProperties":true,"description":"An optional object that can be used by the event receiver for matching purposes."},"timestamp":{"type":"string","description":"The time the event was triggered, in ISO 8601 format.","format":"date-time"},"payload":{"type":"object","description":"An object with values matching the payload schema of the event definition, if there is one.\n"},"tenantId":{"type":"string","description":"Tenant URN to send the event for. Only used for core (platform) users, when the `tenantId` query parameter is not set.\n"}},"required":["namespace","name","timestamp","payload"]},"examples":{"tenant":{"summary":"Tenant service account sends an event in its own tenant","value":{"namespace":"application-events","name":"user-registration","correlationId":"Bobs-user-id","context":{"applicationId":"application-1234"},"timestamp":"2026-09-24T17:00:00.000Z","payload":{"userId":"Bobs-user-id","registeredOn":"2026-09-24"}}},"core":{"summary":"Core service account sends an event on behalf of a tenant","value":{"tenantId":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7","namespace":"form-service","name":"form-submitted","correlationId":"urn:ads:platform:form-service:v1:/forms/9f1c2d3e-4b5a-4c6d-8e7f-0a1b2c3d4e5f","timestamp":"2026-09-24T17:00:00.000Z","payload":{"form":{"id":"9f1c2d3e-4b5a-4c6d-8e7f-0a1b2c3d4e5f"}}}}}}}},"responses":{"200":{"description":"Event successfully sent.","content":{"text/plain":{"schema":{"type":"string"},"example":"OK"}}},"400":{"description":"Event is invalid, for example namespace or name is missing or too long, the timestamp is not in ISO 8601 format, the payload does not match the event definition schema, the body `tenantId` is not a valid URN, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Validation failed with error(s): timestamp (body) - Invalid value"}}}},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"description":"User does not have the event-sender role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to send event."}}}}}}},"/event/v1/events/count":{"get":{"tags":["Event"],"description":"Count logged events matching the supplied criteria. Requires the event-reader role or the value service value-reader role (`urn:ads:platform:value-service:value-reader`), and a tenant context. Tenant users count the events of their own tenant; core users with either role set the `tenantId` query parameter, and without it the request responds 400.\n\nNamespace and event name are each optional and independent of one another; other supplied criteria (timestamp range, correlation ID, context) are combined with namespace and name when determining the count.\n\nThe event log is stored in the value service, but consumers of this API do not need to call the value service directly.\n","parameters":[{"$ref":"#/components/parameters/EventTenantId"},{"name":"namespace","description":"Namespace of the logged events to count.","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"application-events"},{"name":"name","description":"Name of the logged events to count.","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":50},"example":"user-registration"},{"name":"timestampMin","description":"Inclusive minimum value of the event timestamp.","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-09-01T00:00:00.000Z"},{"name":"timestampMax","description":"Inclusive maximum value of the event timestamp.","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"example":"2026-10-01T00:00:00.000Z"},{"name":"correlationId","description":"Correlation ID associated with the events.","in":"query","required":false,"schema":{"type":"string"},"example":"Bobs-user-id"},{"name":"context","description":"JSON object of context values the events must match. The namespace and name parameters take precedence over matching keys.\n","in":"query","required":false,"schema":{"type":"string"},"example":"{\"applicationId\":\"application-1234\"}"}],"responses":{"200":{"description":"Events successfully counted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCount"}}}},"400":{"description":"Request is invalid, for example namespace or name is empty or too long, a timestamp is not in ISO 8601 format, context is not a JSON object, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Validation failed with error(s): timestampMin (query) - Invalid value"}}}},"401":{"$ref":"#/components/responses/EventUnauthorized"},"403":{"description":"User does not have the event-reader or value-reader role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to count events."}}}}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"EventDefinitionName":{"name":"name","description":"Name of the event definition.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"user-registration"},"EventDefinitionNamespace":{"name":"namespace","description":"Namespace of the event definition.","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9-_ ]{1,50}$"},"example":"application-events"},"EventTenantId":{"name":"tenantId","description":"ID of the tenant to act on, as a tenant URN. Only used for core (platform) users; tenant users always act on the tenant of their token and this parameter is ignored.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"EventBadRequest":{"description":"Request is invalid, for example a query, path, or body parameter failed validation, or there is no tenant context.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Validation failed with error(s): timestamp (body) - Invalid value"}}}},"EventDefinitionConflict":{"description":"An event definition with the same namespace and name already exists in the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"Event definition 'application-events:user-registration' already exists."}}}},"EventDefinitionNotFound":{"description":"Event definition not found. Definitions of other tenants are never visible, so their IDs also respond 404.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"event definition with ID 'application-events:user-registration' could not be found."}}}},"EventForbidden":{"description":"User does not have the role required for the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to send event."}}}},"EventUnauthorized":{"description":"Request does not include a valid bearer token.","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}}},"schemas":{"EventCount":{"type":"object","properties":{"count":{"type":"integer","description":"Number of logged events matching the supplied criteria."}},"example":{"count":1024}},"EventDefinition":{"type":"object","properties":{"namespace":{"type":"string","description":"The namespace of the event definition."},"name":{"type":"string","description":"The name of the event definition."},"description":{"type":"string","nullable":true},"payloadSchema":{"type":"object","description":"JSON schema used to validate the payload of events sent with this namespace and name."},"interval":{"type":"object","description":"Set by platform services only. Identifies an earlier event with the same correlation ID; the event log records the duration between the two events as a metric.\n","properties":{"namespace":{"type":"string"},"name":{"type":"string"},"metric":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"context":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"log":{"type":"object","description":"Set by platform services only. Controls whether events are written to the event log.","properties":{"skip":{"type":"boolean"}}},"isCore":{"type":"boolean","readOnly":true,"description":"True if the definition is a core (platform) definition rather than tenant specific."}},"example":{"namespace":"application-events","name":"user-registration","description":"A new user registered.","payloadSchema":{"type":"object","properties":{"userId":{"type":"string"}},"required":["userId"]},"isCore":false}},"EventDefinitionDeleted":{"type":"object","properties":{"deleted":{"type":"boolean"}},"example":{"deleted":true}},"EventDefinitionRequest":{"type":"object","properties":{"description":{"type":"string","nullable":true,"description":"Description of the event. The configuration service requires the property, so send null when there is no description.\n"},"payloadSchema":{"type":"object","description":"JSON schema (draft-07) that the payload of events with this namespace and name must match."}},"required":["description","payloadSchema"],"description":"Description and payload schema of an event definition. Other properties, such as `interval` and `log`, are not supported for tenant definitions.\n"},"EventError":{"type":"object","properties":{"errorMessage":{"type":"string"}},"example":{"errorMessage":"Validation failed with error(s): timestamp (body) - Invalid value"}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Event","description":"API to send domain events."},{"name":"Event Definition","description":"API to manage the tenant event definitions used to validate event payloads."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Export service","version":"0.0.0","description":"Export service provides exports of resources to files using jobs."},"paths":{"/export/v1/jobs":{"post":{"tags":["Export"],"description":"Queue a new, asynchronous job to export an API resource to a file. The response is the queued job; poll `GET /export/v1/jobs/{jobId}`, or subscribe to the `export-updates` push service stream, for the result.\n\nRequires the exporter role, or one of the exporter roles configured for the resource's service or API in the `sources` of the export service configuration. The role is checked in the tenant of the request; core users with the role must set `tenantId`. The job is created in that tenant and the export file is uploaded to it.\n","parameters":[{"$ref":"#/components/parameters/ExportTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CsvExportRequest"},{"$ref":"#/components/schemas/JsonExportRequest"}],"discriminator":{"propertyName":"format","mapping":{"csv":"#/components/schemas/CsvExportRequest","json":"#/components/schemas/JsonExportRequest"}}},"examples":{"csv":{"summary":"Export forms to CSV","value":{"resourceId":"urn:ads:platform:form-service:v1:/forms","format":"csv","filename":"Forms-2026-10-01","fileType":"form-export","params":{"includeData":true,"criteria":"{\"definitionIdEquals\":\"income-support-application\"}"},"resultsPath":"results","formatOptions":{"columns":["id","status",{"key":"data.firstName","header":"First name"}]}}},"json":{"summary":"Export tasks to JSON","value":{"resourceId":"urn:ads:platform:task-service:v1:/queues/benefits/intake/tasks","format":"json","filename":"Tasks-2026-10-01","formatOptions":{"pretty":true,"fields":["id","name","status"]}}}}}}},"responses":{"200":{"description":"Job successfully created and queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"urn":"urn:ads:platform:export-service:v1:/jobs/a66ccc16-28fc-44fb-a499-d12df0262b8b","id":"a66ccc16-28fc-44fb-a499-d12df0262b8b","status":"queued","result":null}}}},"400":{"description":"Request is invalid. For example, `format` is not csv or json, `resourceId` is not an ADSP URN, or the `fileType` does not exist in the tenant.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportError"},"examples":{"validation":{"summary":"Body parameter failed validation","value":{"errorMessage":"Validation failed with error(s): format (body) - Invalid value"}},"fileType":{"summary":"File type does not exist","value":{"errorMessage":"Specified target file type 'task-export-file' cannot be found."}}}}}},"401":{"$ref":"#/components/responses/ExportUnauthorized"},"403":{"$ref":"#/components/responses/ExportForbidden"}}}},"/export/v1/jobs/{jobId}":{"get":{"tags":["Export"],"description":"Retrieve the status of an export job and, once it is completed, the export file. Jobs are kept for 24 hours after they are created or last updated.\n\nThe user who created the job can always retrieve it. Other users require the exporter role in the tenant of their token. Core users can retrieve only the jobs they created.\n","operationId":"getJob","parameters":[{"name":"jobId","description":"ID of job to retrieve.","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"a66ccc16-28fc-44fb-a499-d12df0262b8b"}],"responses":{"200":{"description":"Job successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"$ref":"#/components/responses/ExportBadRequest"},"401":{"$ref":"#/components/responses/ExportUnauthorized"},"403":{"description":"The user did not create the job and does not have the exporter role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportError"},"example":{"errorMessage":"User Test User (ID: 3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d) not permitted to get export job."}}}},"404":{"$ref":"#/components/responses/ExportNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"ExportTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Required 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.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"ExportBadRequest":{"description":"Request is invalid, for example a path or body parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportError"},"example":{"errorMessage":"Validation failed with error(s): format (body) - Invalid value"}}}},"ExportForbidden":{"description":"The user does not have a role permitted to perform the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportError"},"example":{"errorMessage":"User Test User (ID: 3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d) not permitted to create export job."}}}},"ExportNotFound":{"description":"The export job does not exist, or it has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportError"},"example":{"errorMessage":"export job with ID 'a66ccc16-28fc-44fb-a499-d12df0262b8b' could not be found."}}}},"ExportUnauthorized":{"description":"Request does not include a valid bearer token.","content":{"text/plain":{"schema":{"type":"string"},"example":"Unauthorized"}}}},"schemas":{"CsvExportRequest":{"allOf":[{"$ref":"#/components/schemas/ExportRequest"},{"type":"object","properties":{"formatOptions":{"description":"CSV Export format options. Records are flattened, so nested properties are referenced with dot notation (for example `data.firstName`). If columns are not set, the columns are taken from the first record.\n","type":"object","properties":{"columns":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"object","properties":{"key":{"type":"string"},"header":{"type":"string"}},"required":["key"]}]},"example":["id","name",{"key":"data.firstName","header":"First name"}]}}}}}]},"ExportError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"ExportRequest":{"type":"object","properties":{"resourceId":{"type":"string","description":"URN of the API resource to export, for example a collection endpoint of another ADSP service. The export service resolves the URN to a URL using the directory service, and reads it with its own service account (the export-job role).\n","example":"urn:ads:platform:task-service:v1:/tasks"},"params":{"type":"object","description":"Query parameters for the API request of results to export. The export service also sets `tenantId`, `top` (200) and `after` to read each page.\n","example":{"criteria":"{\"statusEquals\":\"Pending\"}"}},"resultsPath":{"type":"string","minLength":1,"maxLength":150,"default":"results","description":"Path (lodash path syntax) to the array of results in the API response. If the path doesn't resolve to an array, an array response is exported as is, and any other response is exported as a single record.\n","example":"results"},"fileType":{"type":"string","nullable":true,"minLength":1,"maxLength":50,"default":"export-file","description":"ID of the [file service](https://api.adsp.alberta.ca/platform/?urls.primaryName=File%20service) file type to which the export file is uploaded. The file type must exist in the tenant. Defaults to the export service `export-file` type, which can be read by users with the exporter role.\n","example":"task-export-file"},"format":{"description":"Export format for the data.","type":"string","enum":["csv","json"],"example":"csv"},"filename":{"description":"Name of the export file. Any file extension is replaced with the extension of the format.\n","type":"string","nullable":true,"minLength":1,"maxLength":100,"default":"exported","example":"Exports-2022-02-19"}},"required":["resourceId","format"]},"Job":{"type":"object","properties":{"id":{"description":"Id of the Job spawned to export. Required when polling to get the status of the Job.","type":"string","format":"uuid","readOnly":true,"example":"a66ccc16-28fc-44fb-a499-d12df0262b8b"},"status":{"type":"string","enum":["queued","completed","failed"],"readOnly":true,"description":"Indicates the status of the export Job."},"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:export-service:v1:/jobs/a66ccc16-28fc-44fb-a499-d12df0262b8b"},"result":{"type":"object","nullable":true,"readOnly":true,"description":"The export file. Null until the job is completed.","properties":{"urn":{"type":"string","description":"Logical URN to use for downloading the export file. 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/51091c0d-15ce-4e93-81ab-1c6e546c667c"},"id":{"description":"A `fileId` to be used with the [File Service](https://api.adsp.alberta.ca/platform/?urls.primaryName=File%20service) for downloading the export file.","type":"string","example":"51091c0d-15ce-4e93-81ab-1c6e546c667c"},"filename":{"type":"string","description":"The name of the export file.","example":"Exports-2022-02-19.csv"}}}},"example":{"urn":"urn:ads:platform:export-service:v1:/jobs/a66ccc16-28fc-44fb-a499-d12df0262b8b","id":"a66ccc16-28fc-44fb-a499-d12df0262b8b","status":"completed","result":{"urn":"urn:ads:platform:file-service:v1:/files/51091c0d-15ce-4e93-81ab-1c6e546c667c","id":"51091c0d-15ce-4e93-81ab-1c6e546c667c","filename":"Exports-2022-02-19.csv"}}},"JsonExportRequest":{"allOf":[{"$ref":"#/components/schemas/ExportRequest"},{"type":"object","properties":{"formatOptions":{"description":"JSON Export format options.","type":"object","properties":{"pretty":{"description":"Flag indicating if the output json should be formatted to be easier to read.","type":"boolean"},"fields":{"description":"Properties (lodash path syntax) of each record to include. All properties are included if not set.","type":"array","items":{"type":"string"},"example":["id","name","data.firstName"]}}}}}]}}},"security":[{"accessToken":[]}],"tags":[{"name":"Export","description":"APIs for managing export jobs."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"Feedback service","version":"0.0.0","description":"Feedback service allows users to submit feedback regarding a service interaction."},"paths":{"/feedback/v1/feedback":{"post":{"tags":["Feedback"],"description":"Send feedback for a site of a tenant. Feedback is queued, has personally identifiable information removed from its text, and is then written to the value service.\n\nAuthenticated users act on the tenant of their token and require the feedback-provider role. Anonymous requests (without a bearer token) set the tenant in the body, are only accepted for sites configured with allowAnonymous, and are rate limited to 5 requests per 5 minutes.\n","security":[{},{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"string","nullable":true,"minLength":1,"maxLength":100,"description":"Name or ID (URN) of the tenant. Required for anonymous requests; ignored when the request has a tenant context from the bearer token.\n"},"context":{"type":"object","properties":{"site":{"type":"string","minLength":1,"maxLength":100,"description":"URL of the site, matching a site in the tenant's feedback configuration."},"view":{"type":"string","minLength":1,"maxLength":500,"description":"Path of the view. If the site configures views, it must be one of them."},"correlationId":{"type":"string","nullable":true,"minLength":1,"maxLength":500,"description":"ID to correlate the feedback with, for example an application number."}},"required":["site","view"]},"rating":{"type":"string","enum":["terrible","bad","neutral","good","delightful"]},"comment":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"technicalIssue":{"type":"string","nullable":true,"minLength":1,"maxLength":2000}},"required":["context","rating"]},"examples":{"anonymous":{"summary":"Anonymous feedback on a site that allows it","value":{"tenant":"My Tenant","context":{"site":"https://my-application.alberta.ca","view":"/apply"},"rating":"good","comment":"The form was easy to complete."}},"authenticated":{"summary":"Feedback from a user with the feedback-provider role","value":{"context":{"site":"https://my-application.alberta.ca","view":"/apply","correlationId":"application-1234"},"rating":"bad","technicalIssue":"The page took a long time to load."}}}}}},"responses":{"200":{"description":"Feedback received and queued for processing.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean"}}},"example":{"sent":true}}}},"400":{"description":"Request is invalid: a body parameter failed validation, there is no tenant context, the site isn't configured for the tenant, or the view isn't one of the site's views.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"},"example":{"errorMessage":"Site configuration for feedback context not found."}}}},"401":{"description":"Request is anonymous, and the site does not allow anonymous feedback.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"},"example":{"errorMessage":"Site https://my-application.alberta.ca requires user context for feedback."}}}},"403":{"description":"Authenticated user does not have the feedback-provider role in the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to provide feedback."}}}},"429":{"description":"Too many anonymous requests from the client; limited to 5 requests per 5 minutes."}}},"get":{"tags":["Feedback"],"description":"Retrieves feedback submitted for the tenant, newest first. Requires the feedback-reader role. Core users with the role can read the feedback of a tenant by setting tenantId, or of all tenants by leaving it out.\n","parameters":[{"$ref":"#/components/parameters/FeedbackTenantId"},{"name":"site","description":"Site for which to retrieve feedback entries.","in":"query","required":false,"schema":{"type":"string","example":"https://adsp.alberta.ca"}},{"name":"start","description":"Return only feedback entered on or after this timestamp.","in":"query","required":false,"schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00.000Z"}},{"name":"end","description":"Return only feedback entered on or before this timestamp.","in":"query","required":false,"schema":{"type":"string","format":"date-time","example":"2023-01-31T00:00:00.000Z"}},{"name":"top","description":"Number of entries to return. Defaults to 10.","in":"query","required":false,"schema":{"type":"number","example":50}},{"name":"after","description":"Cursor for retrieving additional pages, from page.next of the previous response.","in":"query","required":false,"schema":{"type":"string","example":"MTA="}}],"responses":{"200":{"description":"Feedback successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackResponse"}}}},"400":{"description":"tenantId is not a valid tenant URN.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"}}}},"401":{"$ref":"#/components/responses/FeedbackUnauthorized"}}}},"/feedback/v1/feedback/summary":{"get":{"tags":["Feedback"],"description":"Summarizes the feedback of the tenant for a site and optional time period. Available to any authenticated user in the tenant. Core users must set tenantId.\n","parameters":[{"$ref":"#/components/parameters/FeedbackTenantId"},{"name":"site","description":"Site for which to summarize feedback entries.","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"example":"https://adsp.alberta.ca"}},{"name":"start","description":"Include feedback entered on or after this timestamp.","in":"query","required":false,"schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00.000Z"}},{"name":"end","description":"Include feedback entered on or before this timestamp.","in":"query","required":false,"schema":{"type":"string","format":"date-time","example":"2023-01-31T00:00:00.000Z"}}],"responses":{"200":{"description":"Feedback summary successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackSummary"}}}},"400":{"$ref":"#/components/responses/FeedbackBadRequest"}}}},"/feedback/v1/script/adspFeedback.js":{"get":{"tags":["Feedback"],"description":"Retrieves the feedback widget script, which injects a feedback widget that uses this API. Anonymous access is allowed. The response is cacheable for 10 days.\n","security":[{}],"responses":{"200":{"description":"Script successfully retrieved.","content":{"text/javascript":{}}}}}},"/feedback/v1/script/integrity":{"get":{"tags":["Feedback"],"description":"Retrieves the digest of the feedback widget script, for Subresource Integrity (SRI). Anonymous access is allowed.\n","security":[{}],"responses":{"200":{"description":"Script digest successfully retrieved.","content":{"application/json":{"schema":{"type":"object","properties":{"integrity":{"type":"string"}}},"example":{"integrity":"sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="}}}}}}},"/feedback/v1/sites":{"get":{"tags":["Feedback"],"description":"Lists the URLs of configured feedback sites, or counts them, across all tenants or for one tenant. Intended for core users with the feedback-reader role, for example to report platform usage.\n","parameters":[{"name":"tenant","description":"Name of the tenant to list sites for. Lists the sites of all tenants if not set.","in":"query","required":false,"schema":{"type":"string","example":"my-tenant"}},{"name":"count","description":"If true, return the number of sites instead of their URLs. The count is returned as a number when tenant is set, and as an object with a count property when it isn't.\n","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Sites, or the number of sites.","content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"number"},{"type":"object","properties":{"count":{"type":"number"}}}]},"examples":{"sites":{"summary":"Site URLs","value":["https://my-application.alberta.ca","https://other-application.alberta.ca"]},"tenantCount":{"summary":"Number of sites of a tenant (count=true and tenant set)","value":2},"allCount":{"summary":"Number of sites of all tenants (count=true)","value":{"count":42}}}}}},"400":{"description":"The tenant was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"},"example":{"errorMessage":"Tenant 'my-tenant' not found."}}}},"401":{"$ref":"#/components/responses/FeedbackUnauthorized"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"FeedbackTenantId":{"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.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"FeedbackBadRequest":{"description":"Request is invalid, for example a query or body parameter failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"},"example":{"errorMessage":"Validation failed with error(s): rating (body) - Invalid value"}}}},"FeedbackUnauthorized":{"description":"Request does not include a valid bearer token, or the user does not have the role required for the operation. Role checks in this API respond with 401 rather than 403.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackError"},"example":{"errorMessage":"User not authorized to read feedback"}}}}},"schemas":{"FeedbackEntry":{"type":"object","properties":{"tenant":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"correlationId":{"type":"string"},"context":{"type":"object","properties":{"site":{"type":"string","example":"https://adsp.alberta.ca"},"view":{"type":"string"},"digest":{"type":"string","description":"SHA-256 digest of the feedback content, used to detect duplicate submissions."},"includesComment":{"type":"boolean"},"includesTechnicalIssue":{"type":"boolean"}},"required":["site"]},"value":{"type":"object","properties":{"rating":{"type":"string","enum":["terrible","bad","neutral","good","delightful"]},"comment":{"type":"string","nullable":true,"description":"Comment, with personally identifiable information removed."},"ratingValue":{"type":"number","description":"Rating as a number, from 1 (terrible) to 5 (delightful).","example":4},"technicalIssue":{"type":"string","nullable":true,"description":"Technical issue, with personally identifiable information removed."}},"required":["rating","ratingValue"]}},"required":["timestamp","context","value"],"example":{"timestamp":"2026-10-01T15:04:05.000Z","correlationId":"application-1234","context":{"site":"https://my-application.alberta.ca","view":"/apply","digest":"3f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea","includesComment":true,"includesTechnicalIssue":false},"value":{"rating":"good","ratingValue":4,"comment":"The form was easy to complete.","technicalIssue":null}}},"FeedbackError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"FeedbackResponse":{"type":"object","properties":{"feedback":{"type":"array","items":{"$ref":"#/components/schemas/FeedbackEntry"}},"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":"number"}}}},"example":{"feedback":[{"timestamp":"2026-10-01T15:04:05.000Z","correlationId":"application-1234","context":{"site":"https://my-application.alberta.ca","view":"/apply","digest":"3f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea","includesComment":true,"includesTechnicalIssue":false},"value":{"rating":"good","ratingValue":4,"comment":"The form was easy to complete.","technicalIssue":null}}],"page":{"next":"MTA=","size":1}}},"FeedbackSummary":{"type":"object","properties":{"totalResponses":{"type":"number","example":247},"averageRating":{"type":"number","nullable":true,"description":"Average rating value from 1 to 5, or null if there are no responses.","example":3.8},"responsesWithComments":{"type":"number","example":38},"responsesWithIssues":{"type":"number","example":21}},"required":["totalResponses","averageRating","responsesWithComments","responsesWithIssues"],"example":{"totalResponses":247,"averageRating":3.8,"responsesWithComments":38,"responsesWithIssues":21}}}},"security":[{"accessToken":[]}],"tags":[{"name":"Feedback","description":"API to send feedback."}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.0","info":{"title":"File service","version":"1.0.0","description":"ADSP's _File Service_ is one that you can use for storing and managing file-based data.\nFrom uploading end-user documentation to storing content for presentation, the service gives you massively scalable,\nsecure, storage for your data. Based on Microsoft's Azure Blob Storage and, coupled with our\n[File Type collections](https://govalta.github.io/adsp-monorepo/tutorials/file-service/file-types.html), the file service gives you full control\nover who has access to your data, and who doesn't.\n\nThe service provides APIs that allow you to:\n\n- Upload files to Azure Blob cloud Storage\n- Scan files for viruses and other malware\n- Grant file access permissions\n- Associate meta-data with a file, such as its unique ID, who uploaded it, whether or not it was infected, etc.\n- Search for files\n- Download files as streams\n\nFor more information see the [File Service tutorial](https://govalta.github.io/adsp-monorepo/tutorials/file-service/introduction.html)."},"paths":{"/file/v1/files":{"post":{"tags":["File"],"description":"Uploads a file to the tenant of the file type. Requires an authenticated user with one of the file type's updateRoles, or the file-service-admin role; otherwise the request responds 401. Core users set tenantId to upload to a tenant file type; platform file types cannot be uploaded to without a tenant context.\n\nSend the request as multipart/form-data with exactly one file part named `file`, up to 3 GB, and at most 10 other fields. The metadata fields (type, recordId, filename, mimeType) must come before the file part in the multipart body, since the file is streamed to storage as it is received. They can also be provided as query parameters; body fields take precedence.\n\nThe MIME type and extension are detected from the file content when possible. When the file type sets allowedFileTypes, a file with any other extension is rejected with 400. The file is scanned for malware after the upload completes, so the response shows scanned as false.\n\nExample: `curl -H \"Authorization: Bearer $TOKEN\" -F type=supporting-documents -F filename=proof-of-income.pdf -F file=@proof-of-income.pdf https://file-service.adsp.alberta.ca/file/v1/files`\n","parameters":[{"$ref":"#/components/parameters/FileTenantId"},{"name":"type","description":"ID of the file type. Alternative to the type field of the multipart body.","example":"supporting-documents","in":"query","required":false,"schema":{"type":"string"}},{"name":"recordId","description":"Record ID of the file. Alternative to the recordId field of the multipart body.","example":"864f975b-8d57-450b-b581-72ff42299bdf","in":"query","required":false,"schema":{"type":"string"}},{"name":"filename","description":"Name of the file. Alternative to the filename field of the multipart body.","example":"proof-of-income.pdf","in":"query","required":false,"schema":{"type":"string"}},{"name":"mimeType","description":"Default MIME type of the file. Alternative to the mimeType field of the multipart body.","example":"application/pdf","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"type":{"description":"ID of the File Type collection the file is associated with. Required here or as a query parameter.","example":"supporting-documents","type":"string"},"recordId":{"description":"An optional, application-supplied ID, for use in cross-referencing the file.","example":"864f975b-8d57-450b-b581-72ff42299bdf","type":"string"},"filename":{"description":"The application-supplied name of the file. Defaults to the name of the uploaded file. Must be a valid filename, for example without path separators.\n","example":"proof-of-income.pdf","type":"string"},"mimeType":{"description":"Default MIME type of the file, used when the type cannot be detected from the content. Defaults to application/octet-stream.\n","example":"application/octet-stream","type":"string"},"file":{"description":"File contents, up to 3 GB.","type":"string","format":"binary"}},"required":["file"]},"encoding":{"file":{"contentType":"application/octet-stream"}}}}},"responses":{"200":{"description":"File successfully uploaded. The file is scanned for malware after upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"},"example":{"urn":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274","id":"ced3fbdd-7597-455e-84c6-1d0b3d03a274","filename":"proof-of-income.pdf","size":112845,"typeName":"Supporting Documents","recordId":"864f975b-8d57-450b-b581-72ff42299bdf","mimeType":"application/pdf","created":"2026-09-24T17:00:00.000Z","createdBy":{"id":"21fabd96-34f7-4b0f-a8b6-9f80b9a9ab0d","name":"Test User"},"lastAccessed":"2026-09-24T17:00:00.000Z","scanned":false,"infected":false,"securityClassification":"protected a","_links":{"self":{"href":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274"},"download":{"href":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274/download"}}}}}},"400":{"description":"Invalid request, for example no file uploaded, no file type specified, an invalid filename, an extension not in the type's allowedFileTypes, no tenant context, or an invalid tenantId.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"Type of file not specified."}}}},"401":{"$ref":"#/components/responses/FileUnauthorized"},"404":{"$ref":"#/components/responses/FileNotFound"}}},"get":{"tags":["File"],"description":"Retrieves files of the tenant. Requires an authenticated user. Only files the user can access are included: files the user uploaded, files of types with anonymousRead or where the user has one of the readRoles, or every file for users with the file-service-admin role. Files marked for deletion are excluded.\n\nRequires a tenant context: core users must set tenantId, otherwise the request responds 400.\n\nUses a simple paging algorithm, which works as follows:\n- You begin by asking for the top (first) N files, e.g. ```top=N&criteria={\"filenameContains\": \"Bob\"}```. If unspecified, top defaults to 50.\n- The API responds by returning the files and the starting point for the **next** set of results, if any more are available.\n- In subsequent calls, pass the returned **next** value as the *after* parameter, e.g. ```top=N&after=next&criteria={\"filenameContains\": \"Bob\"}```\n- Continue iterating until **next** is undefined.\n\nSince inaccessible files are filtered from each page, a page can have fewer than top results even when more are available.\n","parameters":[{"$ref":"#/components/parameters/FileTenantId"},{"name":"top","description":"Number of files to return in the page, e.g. the top N files. Defaults to 50.","example":10,"in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"after","description":"Cursor for retrieving additional pages. Use the **next** value returned by the previous call to GET /file/v1/files.","example":"Mw==","in":"query","required":false,"schema":{"type":"string"}},{"name":"criteria","description":"Criteria for files to retrieve, as a JSON object. Must be valid JSON.","in":"query","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"typeEquals":{"description":"The ID of the File Type collection associated with a file when it is created. There is a one-to-many relationship between a File Type collection and files.","example":"supporting-documents","type":"string"},"recordIdEquals":{"description":"An application-defined record ID; associated with a file when it is created. There is a one-to-many relationship between a record ID and files.","example":"53fca659-362d-407f-9c4d-c2c8c6427bdb","type":"string"},"recordIdContains":{"description":"Returns all files that represent a partial match of the recordId.","example":"53fca659-362d-407f-9c4d-c2c8c6427bdb","type":"string"},"filenameContains":{"description":"Returns all files that have a file name matching \"*.${inputString}*.\", e.g. \"Bobs\" will match \"Bobs PDF file\", and \"Word file of Bobs\".","example":"Bob","type":"string"},"lastAccessedBefore":{"description":"Returns all files with lastAccessed before (exclusive) the ISO 8601 timestamp provided.","type":"string","format":"date-time"},"lastAccessedAfter":{"description":"Returns all files with lastAccessed after (exclusive) the ISO 8601 timestamp provided.","type":"string","format":"date-time"}}},"example":{"typeEquals":"supporting-documents","filenameContains":"income"}}}}],"responses":{"200":{"description":"Request successful.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"page":{"type":"object","properties":{"next":{"description":"Cursor for requesting the next next page, if any. Next will be undefined if no more results are available.","example":"Ng==","type":"string"},"size":{"description":"The number of files returned.","example":10,"type":"number"},"after":{"description":"The cursor used to generate the current page. Note - Do not use this as the *after* parameter in subsequent calls,\nas it will just repeat the set just returned.\n","example":"Mw==","type":"string"}}}}},"example":{"results":[{"urn":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274","id":"ced3fbdd-7597-455e-84c6-1d0b3d03a274","filename":"proof-of-income.pdf","size":112845,"typeName":"Supporting Documents","recordId":"864f975b-8d57-450b-b581-72ff42299bdf","mimeType":"application/pdf","created":"2026-09-24T17:00:00.000Z","createdBy":{"id":"21fabd96-34f7-4b0f-a8b6-9f80b9a9ab0d","name":"Test User"},"lastAccessed":"2026-09-25T15:30:00.000Z","scanned":true,"infected":false,"securityClassification":"protected a","digest":"sha256-vVEAaGCkdyXB56ABe6NxEU+Fsym7bieZg/97hN7+HyQ=","_links":{"self":{"href":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274"},"download":{"href":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274/download"}}}],"page":{"after":"Mw==","next":"NA==","size":1}}}}},"400":{"$ref":"#/components/responses/FileBadRequest"},"401":{"$ref":"#/components/responses/FileUnauthorized"}}},"delete":{"tags":["File"],"description":"Marks multiple files for deletion. File deletion is not immediate, but files will eventually disappear. Requires an authenticated user. Users with the file-service-admin role can delete any file of their tenant; other users can only delete files they uploaded and still have one of the file type's updateRoles for.\n\nFiles are processed in order, and the request stops at the first file that is not found (404) or cannot be deleted (401). Files before it stay marked for deletion.\n","parameters":[{"name":"files","description":"IDs (UUIDs) of the files to delete, as a comma-separated list. A bracketed list (`[id1,id2]`) and repeated files parameters are also accepted. At least one ID is required.\n","example":"53fca659-362d-407f-9c4d-c2c8c6427bdb,ced3fbdd-7597-455e-84c6-1d0b3d03a274","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delete result.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}},"example":{"deleted":true,"results":[{"id":"53fca659-362d-407f-9c4d-c2c8c6427bdb","deleted":true},{"id":"ced3fbdd-7597-455e-84c6-1d0b3d03a274","deleted":true}]}}}},"400":{"$ref":"#/components/responses/FileBadRequest"},"401":{"$ref":"#/components/responses/FileUnauthorized"},"404":{"$ref":"#/components/responses/FileNotFound"}}}},"/file/v1/files/{fileId}":{"parameters":[{"name":"fileId","description":"ID of the file.","example":"53fca659-362d-407f-9c4d-c2c8c6427bdb","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"delete":{"tags":["File"],"description":"Marks a file for deletion. File deletion is not immediate, but it will eventually disappear. Requires an authenticated user who can read the file (see GET), otherwise 403. Users with the file-service-admin role can delete any file of their tenant; other users can only delete files they uploaded and still have one of the file type's updateRoles for, otherwise 401.\n","responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"example":{"deleted":true}}}},"400":{"$ref":"#/components/responses/FileBadRequest"},"401":{"$ref":"#/components/responses/FileUnauthorized"},"403":{"$ref":"#/components/responses/FileForbidden"},"404":{"$ref":"#/components/responses/FileNotFound"}}},"get":{"tags":["File"],"description":"Retrieves a file's metadata. The user must have uploaded the file, have one of the file type's readRoles or the file-service-admin role in the file's tenant, or the file type must allow anonymous read. A bearer token is not required for files of types with anonymousRead.\n\nPlatform services with the directory-service resource-resolver role (urn:ads:platform:directory-service:resource-resolver) can also retrieve the metadata of any file. This is used to resolve file URNs to their details and is not intended for tenant applications.\n","security":[{},{"accessToken":[]}],"responses":{"200":{"description":"File metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}}},"400":{"$ref":"#/components/responses/FileBadRequest"},"403":{"$ref":"#/components/responses/FileForbidden"},"404":{"$ref":"#/components/responses/FileNotFound"}}},"post":{"tags":["File"],"description":"Executes a file operation. The copy operation copies the file to a new file, optionally of a different type. Requires an authenticated user who can read the source file (see GET), otherwise 403, and who has one of the destination file type's updateRoles or the file-service-admin role, otherwise 401. The destination type is looked up in the tenant of the request, so core users who set type must also set tenantId.\n","parameters":[{"$ref":"#/components/parameters/FileTenantId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CopyFileOperation"}],"discriminator":{"propertyName":"operation","mapping":{"copy":"#/components/schemas/CopyFileOperation"}}},"example":{"operation":"copy","type":"supporting-documents","filename":"proof-of-income-copy.pdf","recordId":"864f975b-8d57-450b-b581-72ff42299bdf"}}}},"responses":{"200":{"description":"Result of the operation. For copy, the new file, which is scanned for malware after the copy.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/File"}]},"example":{"urn":"urn:ads:platform:file-service:v1:/files/0d9c8b7a-6f5e-4d3c-8b2a-1f0e9d8c7b6a","id":"0d9c8b7a-6f5e-4d3c-8b2a-1f0e9d8c7b6a","filename":"proof-of-income-copy.pdf","size":112845,"typeName":"Supporting Documents","recordId":"864f975b-8d57-450b-b581-72ff42299bdf","mimeType":"application/pdf","created":"2026-09-26T10:00:00.000Z","createdBy":{"id":"21fabd96-34f7-4b0f-a8b6-9f80b9a9ab0d","name":"Test User"},"lastAccessed":"2026-09-26T10:00:00.000Z","scanned":false,"infected":false,"securityClassification":"protected a","_links":{"self":{"href":"urn:ads:platform:file-service:v1:/files/0d9c8b7a-6f5e-4d3c-8b2a-1f0e9d8c7b6a"},"download":{"href":"urn:ads:platform:file-service:v1:/files/0d9c8b7a-6f5e-4d3c-8b2a-1f0e9d8c7b6a/download"}}}}}},"400":{"description":"Operation not recognized, a parameter failed validation, or tenantId is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"Validation failed with error(s): operation (body) - Invalid value"}}}},"401":{"$ref":"#/components/responses/FileUnauthorized"},"403":{"$ref":"#/components/responses/FileForbidden"},"404":{"$ref":"#/components/responses/FileNotFound"}}}},"/file/v1/files/{fileId}/download":{"get":{"tags":["File"],"description":"Downloads a file. By default the file is sent as an attachment, so this call can safely be used in an anchor tag to trigger a browser download, e.g.\n\n```<a href=\"https://file-service.adsp.alberta.ca/file/v1/files/{fileId}/download\"/>```\n\nHowever, to embed images and other documents into a browser page, you would use the *embed* query parameter, e.g.\n\n```<img src=\"https://file-service.adsp.alberta.ca/file/v1/files/{fileId}/download?embed=true\"/>```\n\nAccess follows the same rules as retrieving the file's metadata (except for the resource-resolver role). Links like the ones above only work without a bearer token when the file type has anonymousRead set; otherwise the request must include a bearer token.\n\nThe response Content-Type is the MIME type of the file (application/octet-stream when it is unknown; SVG images have `;base64` appended). Content-Disposition is `attachment`, or `inline` with embed=true, and carries the filename. Cache-Control is `no-store`, except `public` for embedded files of types with anonymousRead.\n\nA file that was not scanned when it was uploaded is considered unsafe, and will not download by default. You can override this behaviour by setting unsafe=true. Infected files and files marked for deletion cannot be downloaded.\n\nSingle byte ranges are supported with the Range header, in which case the response is 206 Partial Content. Multiple ranges and ranges outside the file respond 400.\n","security":[{},{"accessToken":[]}],"parameters":[{"name":"fileId","description":"ID of the file to download.","example":"53fca659-362d-407f-9c4d-c2c8c6427bdb","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"embed","description":"Flag indicating whether to inline the file. Defaults to false.","example":true,"in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unsafe","description":"Flag indicating whether to download file not yet virus scanned. Defaults to false.","example":false,"in":"query","required":false,"schema":{"type":"boolean"}},{"name":"Range","description":"Single byte range of the file to download.","example":"bytes=0-1023","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Request successful. The body is the file content.","headers":{"Content-Type":{"description":"MIME type of the file.","schema":{"type":"string","example":"application/pdf"}},"Content-Disposition":{"description":"attachment, or inline with embed=true, with the filename.","schema":{"type":"string","example":"attachment; filename*=UTF-8''proof-of-income.pdf"}},"Content-Length":{"description":"Size of the file in bytes.","schema":{"type":"integer","example":112845}},"Accept-Ranges":{"schema":{"type":"string","example":"bytes"}}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"Requested range of the file.","headers":{"Content-Range":{"description":"Range of the file in the body, and the size of the file.","schema":{"type":"string","example":"bytes 0-1023/112845"}},"Content-Length":{"description":"Size of the range in bytes.","schema":{"type":"integer","example":1024}}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"File scan pending, file is infected or marked for deletion, the range is not supported, or a parameter failed validation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"File scan pending."}}}},"403":{"$ref":"#/components/responses/FileForbidden"},"404":{"$ref":"#/components/responses/FileNotFound"}}}},"/file/v1/types":{"get":{"tags":["File Type"],"description":"Retrieves the file types the user can access: types with anonymousRead, types where the user has one of the readRoles or updateRoles, or every type for users with the file-service-admin role. Requires an authenticated user.\n\nReturns the file types of the tenant combined with the platform (core) file types; a platform type replaces a tenant type with the same ID. Core users set tenantId to read the types of a tenant; without it only the platform types are returned.\n","parameters":[{"$ref":"#/components/parameters/FileTenantId"}],"responses":{"200":{"description":"Request successful.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileType"}},"example":[{"id":"supporting-documents","name":"Supporting Documents","anonymousRead":false,"readRoles":["assessor"],"updateRoles":["applicant"],"allowedFileTypes":[".pdf",".jpg"]},{"id":"generated-pdf","name":"Generated PDF","anonymousRead":false,"readRoles":["urn:ads:platform:pdf-service:pdf-generator"],"updateRoles":["urn:ads:platform:pdf-service:pdf-generator"]}]}}},"400":{"$ref":"#/components/responses/FileBadRequest"},"401":{"$ref":"#/components/responses/FileUnauthorized"}}}},"/file/v1/types/{typeId}":{"get":{"tags":["File Type"],"description":"Retrieves a file type. Requires an authenticated user. The type must allow anonymous read, or the user must have one of its readRoles or updateRoles, or the file-service-admin role. Core users set tenantId to read a type of a tenant; without it only platform types are found.\n","parameters":[{"name":"typeId","description":"ID of the file type.","example":"supporting-documents","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/FileTenantId"}],"responses":{"200":{"description":"Request successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileType"}}}},"400":{"$ref":"#/components/responses/FileBadRequest"},"401":{"$ref":"#/components/responses/FileUnauthorized"},"403":{"$ref":"#/components/responses/FileForbidden"},"404":{"$ref":"#/components/responses/FileNotFound"}}}}},"components":{"securitySchemes":{"accessToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"FileTenantId":{"name":"tenantId","description":"ID of the tenant to act on. Only used for core (platform) users; tenant users and tenant service accounts always act on the tenant of their token and this parameter is ignored. Must be a tenant URN; an invalid value responds 400.\n","in":"query","required":false,"schema":{"type":"string"},"example":"urn:ads:platform:tenant-service:v2:/tenants/61f2e3a8c9b1d2e3f4a5b6c7"}},"responses":{"FileBadRequest":{"description":"Request is invalid, for example a parameter failed validation or the operation is not allowed for the file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"Validation failed with error(s): fileId (params) - Invalid value"}}}},"FileForbidden":{"description":"User is not permitted to access the file or file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"User Test User (ID: 1234) not permitted to read file."}}}},"FileNotFound":{"description":"File or file type not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"File with ID '53fca659-362d-407f-9c4d-c2c8c6427bdb' could not be found."}}}},"FileUnauthorized":{"description":"Request does not include a valid bearer token, or the user does not have a role on the file type that permits the operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileError"},"example":{"errorMessage":"User not authorized to delete file."}}}}},"schemas":{"CopyFileOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["copy"]},"type":{"type":"string","description":"ID of the file type of the copy. Defaults to the type of the source file."},"filename":{"type":"string","description":"Name of the copy. Defaults to the name of the source file."},"recordId":{"type":"string","description":"Record ID of the copy. Defaults to the record ID of the source file."}},"required":["operation"]},"File":{"type":"object","properties":{"urn":{"readOnly":true,"description":"A unique, Universal Resource Name, identifying the file. The URN can be used to lookup the files URL with ADSP's Directory Service","example":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274","type":"string"},"id":{"readOnly":true,"description":"A unique file identifier, used in by the APIs to identify a file.","example":"ced3fbdd-7597-455e-84c6-1d0b3d03a274","type":"string"},"filename":{"description":"The name of the file, specified when it is uploaded; used to provide a human-readable identifier for the file.","example":"test_2023-04-03T21-27-13.pdf","type":"string"},"size":{"readOnly":true,"description":"The size of the file, in bytes.","example":112845,"type":"number"},"typeName":{"readOnly":true,"description":"The File Type collection name to which the file belongs, if any.","example":"Generated PDF","type":"string"},"recordId":{"description":"An optional, application supplied ID, for use in cross-referencing the file.","example":"864f975b-8d57-450b-b581-72ff42299bdf","type":"string"},"mimeType":{"description":"MIME type of the file, detected from the content when possible.","example":"application/pdf","type":"string"},"created":{"readOnly":true,"description":"Date the file was uploaded.","example":"2023-04-03T21:27:17.102Z","type":"string","format":"date-time"},"createdBy":{"readOnly":true,"type":"object","properties":{"id":{"description":"ID of user that uploaded the file.","example":"21fabd96-34f7-4b0f-a8b6-9f80b9a9ab0d","type":"string"},"name":{"description":"Name of the user, that uploaded the file.","example":"service-account-urn:ads:platform:pdf-service","type":"string"}}},"scanned":{"readOnly":true,"description":"True if the file was scanned for malware when uploaded.","example":true,"type":"boolean"},"infected":{"readOnly":true,"description":"True if the file was scanned when uploaded, and malware was found.","example":false,"type":"boolean"},"lastAccessed":{"readOnly":true,"description":"Date the file was last accessed via the File Service APIs.","example":"2023-04-03T21:27:20.245Z","type":"string","format":"date-time"},"securityClassification":{"readOnly":true,"description":"The data security classification for the file type. If a security classification is empty that indicates the file type was created before the security classication was implemented.","type":"string","default":"protected a","enum":["public","protected a","protected b","protected c"]},"digest":{"readOnly":true,"description":"Digest of the file prefixed with the hash algorithm. This can be used to verify integrity of downloaded file.","example":"sha256-vVEAaGCkdyXB56ABe6NxEU+Fsym7bieZg/97hN7+HyQ=","type":"string"},"_links":{"readOnly":true,"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","example":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274"}}},"download":{"type":"object","properties":{"href":{"type":"string","example":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274/download"}}}}}},"example":{"urn":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274","id":"ced3fbdd-7597-455e-84c6-1d0b3d03a274","filename":"proof-of-income.pdf","size":112845,"typeName":"Supporting Documents","recordId":"864f975b-8d57-450b-b581-72ff42299bdf","mimeType":"application/pdf","created":"2026-09-24T17:00:00.000Z","createdBy":{"id":"21fabd96-34f7-4b0f-a8b6-9f80b9a9ab0d","name":"Test User"},"lastAccessed":"2026-09-25T15:30:00.000Z","scanned":true,"infected":false,"securityClassification":"protected a","digest":"sha256-vVEAaGCkdyXB56ABe6NxEU+Fsym7bieZg/97hN7+HyQ=","_links":{"self":{"href":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274"},"download":{"href":"urn:ads:platform:file-service:v1:/files/ced3fbdd-7597-455e-84c6-1d0b3d03a274/download"}}}},"FileError":{"type":"object","properties":{"errorMessage":{"type":"string"}}},"FileType":{"type":"object","description":"A File Type collection, configured in the configuration service under platform:file-service. Users with the file-service-admin role can read and update files of every type.\n\nreadRoles and updateRoles are matched against the roles in the caller's token for the tenant. When the caller is another platform service using its service account (for example notification-service reading a file for an email attachment, or pdf-service writing a generated PDF), the service account's token comes from the core realm, so the role must be granted to that service account in the core realm. Roles registered by services, and roles configured on tenant file types, are only created in tenant realms and do not apply to core service accounts.\n","properties":{"id":{"description":"A unique id for a File Type collection.","example":"my-file-type-collection","type":"string"},"name":{"description":"A unique name for the File Type collection.","example":"My File Type Collection","type":"string"},"anonymousRead":{"description":"True if public read access has been granted to files within the collection. Files of the type can then be read and downloaded without a bearer token.\n","example":true,"type":"boolean"},"readRoles":{"description":"Roles that can read files within the collection.","type":"array","items":{"description":"A keycloak role that has read access to files within the collection.","example":"urn:ads:platform:pdf-service:pdf-generator","type":"string"}},"updateRoles":{"description":"Roles that can upload files to, and delete their own files from, the collection.","type":"array","items":{"description":"A keycloak role that can update files within the collection.","example":"urn:ads:platform:tenant-service:platform-service","type":"string"}},"allowedFileTypes":{"description":"File extensions accepted for upload to the collection, including the leading period. The extension is detected from the file content when possible, otherwise taken from the filename. Any extension is accepted when the list is empty or not set.\n","type":"array","items":{"description":"An accepted file extension.","example":".pdf","type":"string"}},"rules":{"description":"Rules applied to files of the type, such as retention.","type":"object","nullable":true,"properties":{"retention":{"type":"object","nullable":true,"description":"When active, a daily job deletes files of the type that have not been accessed for deleteInDays days.\n","properties":{"active":{"type":"boolean","example":true},"deleteInDays":{"type":"integer","example":90}}}},"additionalProperties":true}},"example":{"id":"supporting-documents","name":"Supporting Documents","anonymousRead":false,"readRoles":["assessor"],"updateRoles":["applicant"],"allowedFileTypes":[".pdf",".jpg"],"rules":{"retention":{"active":true,"deleteInDays":90}}}}}},"security":[{"accessToken":[]}],"tags":[{"name":"File Type","description":"API to retrieve File Type collections. Types are configured via the configuration service."},{"name":"File","description":"API to upload and download files."}]}
|