{"openapi":"3.1.0","info":{"title":"Document Management Store API","description":"API to upload and download Documents, retrieve metadata associated with the Documents.","version":"2-beta"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"tags":[{"name":"DocumentContentVersion Service","description":"Endpoint for Document Content Version"},{"name":"StoredDocumentAudit Service","description":"Endpoint for Audit entities"},{"name":"StoredDocument Service","description":"Endpoint for Stored Document Management"},{"name":"StoredDocumentDelete Service","description":"Endpoint for Deletion of Documents"},{"name":"StoredDocumentUpdate Service","description":"Endpoint for Updating Documents"}],"paths":{"/documents":{"post":{"tags":["StoredDocument Service"],"summary":"Creates a list of Stored Documents by uploading a list of binary/text files.","operationId":"createFrom","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadDocumentsCommand"}}}},"responses":{"200":{"description":"Success","content":{"application/hal+json":{"schema":{"$ref":"#/components/schemas/StoredDocumentHalResourceCollection"}}}},"400":{"description":"Invalid input","content":{"application/hal+json":{"schema":{"type":"object"}}}},"405":{"description":"Validation exception","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}},"patch":{"tags":["StoredDocumentUpdate Service"],"summary":"Bulk update of document TTL and metadata","operationId":"updateDocuments","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentsCommand"}}},"required":true},"responses":{"200":{"description":"Update completed","content":{"application/hal+json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}}},"/documents/{documentId}":{"get":{"tags":["StoredDocument Service"],"summary":"Retrieves JSON representation of a Stored Document.","operationId":"getMetaData","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"user-roles","in":"header","description":"User Roles","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/hal+json":{"schema":{"type":"object"}}}},"404":{"description":"Document not found","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}},"post":{"tags":["DocumentContentVersion Service"],"summary":"Adds a Document Content Version and associates it with a given Stored Document.","operationId":"addDocumentContentVersionForVersionsMappingNotPresent","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadDocumentVersionCommand"}}}},"responses":{"201":{"description":"JSON representation of a document version","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}},"delete":{"tags":["StoredDocumentDelete Service"],"summary":"Deletes a Stored Document.","operationId":"deleteDocument","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"permanent","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"204":{"description":"No Content returned","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}},"patch":{"tags":["StoredDocumentUpdate Service"],"summary":"Updates document instance (ex. ttl)","operationId":"updateDocument","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentCommand"}}},"required":true},"responses":{"200":{"description":"Returns representation of the new state","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}}},"/documents/{documentId}/versions":{"post":{"tags":["DocumentContentVersion Service"],"summary":"Adds a Document Content Version and associates it with a given Stored Document.","operationId":"addDocumentContentVersion","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadDocumentVersionCommand"}}}},"responses":{"201":{"description":"JSON representation of a document version","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}}},"/documents/delete":{"post":{"tags":["StoredDocumentDelete Service"],"summary":"Marks case documents as soft deleted.","operationId":"deleteCaseDocuments","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCaseDocumentsCommand"}}},"required":true},"responses":{"200":{"description":"Case documents deletion results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDocumentsDeletionResults"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDocumentsDeletionResults"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDocumentsDeletionResults"}}}}}}},"/documents/{documentId}/versions/{versionId}":{"get":{"tags":["DocumentContentVersion Service"],"summary":"Returns a specific version of the content of a Stored Document.","operationId":"getDocumentContentVersionDocument","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"user-roles","in":"header","description":"User Roles","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"JSON representation of a document version","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}}},"/documents/{documentId}/versions/{versionId}/binary":{"get":{"tags":["DocumentContentVersion Service"],"summary":"Streams a specific version of the content of a Stored Document.","operationId":"getDocumentContentVersionDocumentBinary","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","schema":{"type":"string"}},{"name":"user-roles","in":"header","description":"User Roles","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns contents of a document version","content":{"application/hal+json":{"schema":{"type":"object"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"type":"object"}}}}}}},"/documents/{documentId}/binary":{"get":{"tags":["StoredDocument Service"],"summary":"Streams contents of the most recent Document Content Version associated withthe Stored Document.","operationId":"getBinary","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"user-id","in":"header","description":"User Id","required":true,"schema":{"type":"string"}},{"name":"user-roles","in":"header","description":"User Roles","required":true,"schema":{"type":"string"}},{"name":"classification","in":"header","description":"Classification","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns contents of a file"},"404":{"description":"Document not found"},"403":{"description":"Access Denied"}}}},"/documents/{documentId}/auditEntries":{"get":{"tags":["StoredDocumentAudit Service"],"summary":"Retrieves audits related to a Stored Document.","operationId":"findAudits","parameters":[{"name":"serviceauthorization","in":"header","description":"Service Authorization (S2S Bearer token)","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/hal+json":{"schema":{"$ref":"#/components/schemas/CollectionModelStoredDocumentAuditEntryHalResource"}}}},"403":{"description":"Access Denied","content":{"application/hal+json":{"schema":{"$ref":"#/components/schemas/CollectionModelStoredDocumentAuditEntryHalResource"}}}}}}},"/":{"get":{"tags":["welcome-controller"],"operationId":"welcome","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}},"components":{"schemas":{"UploadDocumentsCommand":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":2147483647,"minItems":1},"classification":{"type":"string","enum":["PUBLIC","PRIVATE","RESTRICTED"]},"roles":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"ttl":{"type":"string","format":"date-time"}},"required":["classification","files"]},"StoredDocumentHalResourceCollection":{},"UploadDocumentVersionCommand":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]},"DeleteCaseDocumentsCommand":{"type":"object","properties":{"caseRef":{"type":"string"}},"required":["caseRef"]},"CaseDocumentsDeletionResults":{"type":"object","properties":{"caseDocumentsFound":{"type":"integer","format":"int32"},"markedForDeletion":{"type":"integer","format":"int32"}}},"DocumentUpdate":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid","minLength":1},"metadata":{"type":"object","additionalProperties":{"type":"string"}}},"required":["documentId","metadata"]},"UpdateDocumentsCommand":{"type":"object","properties":{"ttl":{"type":"string","format":"date-time"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentUpdate"},"minItems":1}},"required":["documents"]},"UpdateDocumentCommand":{"type":"object","properties":{"ttl":{"type":"string","format":"date-time"}}},"CollectionModelStoredDocumentAuditEntryHalResource":{"type":"object","properties":{"_embedded":{"type":"object","properties":{"auditEntries":{"type":"array","items":{"$ref":"#/components/schemas/StoredDocumentAuditEntryHalResource"}}}},"_links":{"$ref":"#/components/schemas/Links"}}},"RepresentationModelObject":{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/Links"}}},"StoredDocumentAuditEntryHalResource":{"type":"object","properties":{"action":{"type":"string","enum":["CREATED","READ","UPDATED","MIGRATED","DELETED","HARD_DELETED","RECOVERED"]},"username":{"type":"string"},"recordedDateTime":{"type":"string","format":"date-time"},"type":{"type":"string"},"_links":{"$ref":"#/components/schemas/Links"},"_embedded":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RepresentationModelObject"}}}},"Link":{"type":"object","properties":{"href":{"type":"string"},"hreflang":{"type":["string","null"]},"title":{"type":["string","null"]},"type":{"type":["string","null"]},"deprecation":{"type":["string","null"]},"profile":{"type":["string","null"]},"name":{"type":["string","null"]},"templated":{"type":"boolean"}}},"Links":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}}}
