{"openapi":"3.0.1","info":{"title":"aDocs Integration API","description":"API for performing operations on documents","version":"1.0.0.0"},"paths":{"/api/documents":{"get":{"tags":["Documents"],"summary":"Successfully returned information about documents.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"name":"source","in":"query","schema":{"type":"string","format":"string"}},{"name":"externalId","in":"query","schema":{"type":"string","format":"string"}},{"name":"name","in":"query","schema":{"type":"string","format":"string"}},{"name":"number","in":"query","schema":{"type":"string","format":"string"}},{"name":"date","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/DocStatus"}},{"name":"ownerCode","in":"query","schema":{"type":"string","format":"string"}},{"name":"recipientCode","in":"query","schema":{"type":"string","format":"string"}}],"responses":{"200":{"description":"Successfully returned information about documents.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Documents"],"summary":"Create document.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"}],"requestBody":{"$ref":"#/components/requestBodies/CreateDocumentBody"},"responses":{"201":{"description":"Successfully returned information about document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/documents/{documentId}":{"get":{"tags":["Documents"],"summary":"Get document by id.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"}],"responses":{"200":{"description":"Successfully returned information about document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"tags":["Documents"],"summary":"Delete document by id.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"}],"responses":{"204":{"description":"Successfull operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/documents/{documentId}/file":{"get":{"tags":["Documents"],"summary":"Get file content by document id.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"}],"responses":{"200":{"description":"Successfully returned information about document.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":false},"fileExtension":{"type":"string","nullable":false},"file":{"type":"string","nullable":false}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/documents/{documentId}/signers":{"get":{"tags":["Signers"],"summary":"Get document signers by document id.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"}],"responses":{"200":{"description":"Successfully returned information about document signers .","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Signer"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Signers"],"summary":"Add documents signer.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"}],"requestBody":{"$ref":"#/components/requestBodies/CreateSignerBody"},"responses":{"201":{"description":"Successfully returned information about document signers .","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signer"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"tags":["Signers"],"summary":"Delete all signers.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"}],"responses":{"204":{"description":"Successfull operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/documents/{documentId}/signers/{signerId}":{"delete":{"tags":["Signers"],"summary":"Delete signer.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"},{"$ref":"#/components/parameters/signerId"}],"responses":{"204":{"description":"Successfull operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/documents/{documentId}/signers/{signerId}/signature":{"get":{"tags":["Signatures"],"summary":"Get signature.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"},{"$ref":"#/components/parameters/signerId"}],"responses":{"200":{"description":"Successfully returned information about document signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signature"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Signatures"],"summary":"Add signature.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"},{"$ref":"#/components/parameters/signerId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signature"}}}},"responses":{"201":{"description":"Successfully returned information about document signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signer"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"tags":["Signatures"],"summary":"Delete signature.","parameters":[{"$ref":"#/components/parameters/X-Request-ID"},{"$ref":"#/components/parameters/X-Correlation-ID"},{"$ref":"#/components/parameters/documentId"},{"$ref":"#/components/parameters/signerId"}],"responses":{"204":{"description":"Successfull operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"schemas":{"Document":{"type":"object","properties":{"id":{"type":"string","format":"uuid","nullable":false},"source":{"type":"string","format":"string","nullable":true},"externalId":{"type":"string","format":"string","nullable":true},"typeCode":{"type":"string","nullable":false},"name":{"type":"string","nullable":false},"fileExtension":{"type":"string","nullable":false},"number":{"type":"string","nullable":false},"date":{"type":"string","format":"date-time","nullable":false},"note":{"type":"string","nullable":true},"orderOfSigning":{"$ref":"#/components/schemas/OrderOfSigning"},"category":{"$ref":"#/components/schemas/DocCategory"},"status":{"$ref":"#/components/schemas/DocStatus"},"createdAt":{"type":"string","format":"date-time","nullable":true},"ownerCode":{"type":"string","nullable":false},"recipientCode":{"type":"string","nullable":false},"tags":{"type":"object","additionalProperties":{"type":"string","nullable":true},"nullable":true,"example":{"enquiryId":"5aa84541-a48a-4946-876c-33e77137ad11","encashDate":"2023-05-19T14:15:45.830Z","aditionalData1":"Data1","aditionalData2":"Data2","aditionalData3":"Data3"}}}},"OrderOfSigning":{"enum":["parallel","sequentially"],"type":"string","nullable":false},"DocCategory":{"enum":["oneSided","twoSidedWithOneSignature","twoSided","multiSided"],"type":"string","nullable":false},"DocStatus":{"enum":["new","ready","toSign","signed","cancelled"],"type":"string","nullable":false},"CreateDocumentData":{"type":"object","properties":{"source":{"type":"string","format":"string","nullable":true},"externalId":{"type":"string","format":"string","nullable":true},"typeCode":{"type":"string","nullable":false},"name":{"type":"string","nullable":false},"fileExtension":{"type":"string","nullable":false},"number":{"type":"string","nullable":false},"date":{"type":"string","format":"date-time","nullable":false},"file":{"type":"string","format":"byte","nullable":false,"example":"ZmlsZQ=="},"note":{"type":"string","nullable":true},"orderOfSigning":{"$ref":"#/components/schemas/OrderOfSigning"},"category":{"$ref":"#/components/schemas/DocCategory"},"ownerCode":{"type":"string","nullable":false},"recipientCode":{"type":"string","nullable":false},"tags":{"type":"object","additionalProperties":{"type":"string","nullable":true},"nullable":true,"example":{"enquiryId":"5aa84541-a48a-4946-876c-33e77137ad11","encashDate":"2023-05-19T14:15:45.830Z","aditionalData1":"Data1","aditionalData2":"Data2","aditionalData3":"Data3"}}}},"Signer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"signatureIndex":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"shortName":{"type":"string","nullable":true},"role":{"type":"string","nullable":true},"partyCode":{"type":"string","format":"string","nullable":false},"partyName":{"type":"string","nullable":true},"signingStatus":{"$ref":"#/components/schemas/SigningStatus"}},"additionalProperties":false},"SigningStatus":{"enum":["notSigned","signed"],"type":"string","nullable":false},"CreateSignerData":{"type":"object","properties":{"signatureIndex":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"shortName":{"type":"string","nullable":true},"role":{"type":"string","nullable":true},"partyCode":{"type":"string","format":"string","nullable":false}},"additionalProperties":false},"Signature":{"type":"object","properties":{"signatureData":{"type":"string","format":"byte","nullable":false,"example":"c2lnbmF0dXJlRGF0YQ=="},"signatureProvider":{"type":"string","nullable":false}},"additionalProperties":false},"ErrorModel":{"type":"object","properties":{"errorId":{"type":"string","format":"uuid","example":"c052421c-17ab-457f-9be6-5cbce2724094"},"requestId":{"type":"string","example":"06f31981-c15d-48fb-86c6-53bfae940802"},"correlationId":{"type":"string","example":"2725ab36-4608-4abc-ba1c-6e929ef539b1"},"status":{"type":"string","example":"Response status"},"reasons":{"type":"array","items":{"$ref":"#/components/schemas/ErrorModelReason"}}},"additionalProperties":false},"ErrorModelReason":{"type":"object","properties":{"code":{"type":"string","example":"Error code","nullable":false},"message":{"type":"string","example":"The error message.","nullable":false},"path":{"type":"string","example":"document.Name","nullable":true}}}},"requestBodies":{"CreateDocumentBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentData"}}}},"CreateSignerBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSignerData"}}}}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}},"Unauthorized":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}},"Forbidden":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}},"InternalServerError":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"parameters":{"X-Request-ID":{"name":"X-Request-ID","in":"header","description":"The request id.","required":false,"example":"1ae92b4d-a3cf-4787-a1b4-69e6b9361212","schema":{"type":"string","nullable":false}},"X-Correlation-ID":{"name":"X-Correlation-ID","in":"header","description":"The correlation id.","required":false,"example":"5c9dec7b-9f7c-4106-a545-1501024e29eb","schema":{"type":"string","nullable":false}},"documentId":{"name":"documentId","in":"path","description":"The document id.","required":true,"example":"064955fd-2f8b-4f96-b02a-0ffdca61a92f","schema":{"type":"string","nullable":false}},"signerId":{"name":"signerId","in":"path","description":"The signer id.","required":true,"example":"e3b5d21d-6185-424b-a24c-1506b54b0e7f","schema":{"type":"string","nullable":false}}},"securitySchemes":{"Bearer":{"type":"apiKey","description":"JWT Authorization header using the Bearer scheme.<br>Enter 'Bearer' [space] and then your token in the text input below.<br>Example: 'Bearer 12345abcdef'","name":"Authorization","in":"header"}}},"security":[{"Bearer":[]}]}