{"openapi":"3.1.0","info":{"title":"CCD Case Document AM API","description":"download, upload","version":"2-beta"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/cases/documents":{"post":{"tags":["cases","upload"],"summary":"creates a list of stored document by uploading a list of binary/text file","operationId":"uploadDocuments","parameters":[{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/DocumentUploadRequest"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}},"400":{"description":"Classification is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}}}}},"/cases/documents/{documentId}":{"get":{"tags":["cases","get"],"summary":"Retrieves JSON representation of a Stored Document.","operationId":"getDocumentByDocumentId","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Case document Id is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"404":{"description":"Case document not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}}}},"delete":{"tags":["cases","delete"],"summary":"Deletes a case document with service authorization.","operationId":"deleteDocumentByDocumentId","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"permanent","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Case document Id is not valid"},"404":{"description":"Case document not found"}}},"patch":{"tags":["patch","cases"],"summary":"Updates ttl on document ","operationId":"patchDocumentByDocumentId","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTtlRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentResponse"}}}},"400":{"description":"Case document Id is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentResponse"}}}},"404":{"description":"Case document not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentResponse"}}}}}}},"/cases/documents/attachToCase":{"patch":{"tags":["patch","cases"],"summary":"Updates a list of case document with provided metadata","operationId":"patchMetaDataOnDocuments","parameters":[{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDocumentsMetadata"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentMetaDataResponse"}}}},"400":{"description":"Case document hash-token is not valid for document Id : %s","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentMetaDataResponse"}}}},"404":{"description":"Case document not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentMetaDataResponse"}}}}}}},"/cases/documents/{documentId}/token":{"get":{"tags":["cases","get"],"summary":"Retrieves the hashcode for document Id","operationId":"generateHashCode","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedHashCodeResponse"}}}},"400":{"description":"Case document Id is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedHashCodeResponse"}}}},"404":{"description":"Case document not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedHashCodeResponse"}}}}}}},"/cases/documents/{documentId}/binary":{"get":{"tags":["cases","get"],"summary":"Streams contents of the most recent Document associated with the Case Document.","operationId":"getDocumentBinaryContentByDocumentId","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"ServiceAuthorization","in":"header","description":"S2S JWT token for an approved micro-service","required":true,"schema":{"type":"string"}},{"name":"ServiceAuthorization","in":"header","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Keyword `Bearer` followed by a valid IDAM user token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Case document Id is not valid","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Case document not found","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}}}}},"components":{"schemas":{"DocumentUploadRequest":{"type":"object","description":"List of documents to be uploaded and their metadata","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":2147483647,"minItems":1},"classification":{"type":"string"},"caseTypeId":{"type":"string","pattern":"^[a-zA-Z0-9_-]*$"},"jurisdictionId":{"type":"string","pattern":"^[a-zA-Z0-9_-]*$"}},"required":["caseTypeId","classification","files","jurisdictionId"]},"Document":{"type":"object","properties":{"classification":{"type":"string","enum":["PUBLIC","PRIVATE","RESTRICTED"]},"size":{"type":"integer","format":"int64"},"mimeType":{"type":"string"},"originalDocumentName":{"type":"string"},"hashToken":{"type":"string"},"createdOn":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedBy":{"type":"string"},"modifiedOn":{"type":"string","format":"date-time"},"ttl":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"_links":{"$ref":"#/components/schemas/Links"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"Links":{"type":"object","properties":{"self":{"$ref":"#/components/schemas/Link"},"binary":{"$ref":"#/components/schemas/Link"}}},"UploadResponse":{"type":"object","properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}},"UpdateTtlRequest":{"type":"object","properties":{"ttl":{"type":"string","format":"date-time"}},"required":["ttl"]},"PatchDocumentResponse":{"type":"object","properties":{"ttl":{"type":"string","format":"date-time"},"createdOn":{"type":"string","format":"date-time"},"modifiedOn":{"type":"string","format":"date-time"},"originalDocumentName":{"type":"string"},"mimeType":{"type":"string"},"lastModifiedBy":{"type":"string"}}},"CaseDocumentsMetadata":{"type":"object","properties":{"caseId":{"type":"string","maxLength":16,"minLength":16,"pattern":"^[0-9]*$"},"caseTypeId":{"type":"string","pattern":"^[a-zA-Z0-9_-]*$"},"jurisdictionId":{"type":"string","pattern":"^[a-zA-Z0-9_-]*$"},"documentHashTokens":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHashToken"},"maxItems":2147483647,"minItems":1}},"required":["caseId","caseTypeId","jurisdictionId"]},"DocumentHashToken":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"hashToken":{"type":"string"}}},"PatchDocumentMetaDataResponse":{"type":"object","properties":{"Result":{"type":"string","minLength":1}},"required":["Result"]},"GeneratedHashCodeResponse":{"type":"object","properties":{"hashToken":{"type":"string"}}}}}}