openapi: 3.0.0 info: description: This is the OpenAPI specification file for KPMG Datatrust API. version: "3.0.0" title: Datatrust API servers: - url: https://api.datatrust.fr description: Production server externalDocs: url: https://developer.datatrust.fr description: Find out more about Datatrust API. tags: - name: account description: Get insights about your Datatrust account - name: user description: Operations about users - name: token description: Everything about JSON Web Tokens - name: document description: Everything about document anchoring - name: document storing description: Everything about source document storing - name: pdf receipt description: Operation to download and verify certificates security: - BasicAuth: [] - BearerAuth: [] paths: /account: get: tags: - account responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /account/remaining-nb-anchors: get: tags: - account description: Get number of remaining anchors for this month according to the maxNbAnchors feature. responses: 200: description: Success content: application/json: schema: type: object properties: accountMaxNbAnchorsEnabled: type: boolean description: Status of the limit on the maximum number of remaining available anchors for this month at the account level. accountMaxNbAnchors: type: integer description: Maximum number of anchors per month at the account level. accountRemainingNbAnchors: type: integer description: Number of remaining available anchors for this month at the account level. userMaxNbAnchorsEnabled: type: boolean description: Status of the limit on the maximum number of remaining available anchors for this month at the user level. userMaxNbAnchors: type: integer description: Maximum number of anchors per month at the user level. userRemainingNbAnchors: type: integer description: Number of remaining available anchors for this month at the user level. "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /user: post: tags: - user requestBody: required: true content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /user/{username}: parameters: - name: username in: path required: true schema: type: string default: "" get: tags: - user responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" put: tags: - user requestBody: content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" password: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" delete: tags: - user responses: "200": description: User account successfully deleted "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /user/search: post: tags: - user requestBody: content: application/json: schema: type: object properties: options: $ref: "#/components/schemas/UserSearchFilter" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /user/search/count: post: tags: - user requestBody: content: application/json: schema: type: object properties: options: $ref: "#/components/schemas/UserSearchFilter" responses: "200": description: Success content: application/json: schema: type: object properties: count: type: integer "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /users: get: tags: - user responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /token: post: tags: - token requestBody: required: true content: application/json: schema: type: object properties: expirationTime: type: string description: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/JsonWebToken" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /token/{jwt}: parameters: - name: jwt in: path required: true schema: type: string get: tags: - token responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/JsonWebToken" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" put: tags: - token requestBody: required: true content: application/json: schema: type: object properties: token: $ref: "#/components/schemas/JsonWebToken" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/JsonWebToken" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" delete: tags: - token responses: "200": description: Token successfully deleted "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /tokens: get: tags: - token responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/JsonWebToken" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/{digest}: parameters: - name: digest in: path required: true schema: type: string post: tags: - document requestBody: required: true content: application/json: schema: type: object properties: features: $ref: "#/components/schemas/DocumentFeatures" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Document" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" get: tags: - document responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Document" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" put: tags: - document requestBody: content: application/json: schema: type: object properties: features: $ref: "#/components/schemas/DocumentFeatures" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Document" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" delete: tags: - document responses: "200": description: Pending document successfully deleted "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/{digest}/signature: parameters: - name: digest in: path required: true schema: type: string post: tags: - document requestBody: required: true content: application/json: schema: type: object properties: signature: type: string pattern: "[A-Fa-f0-9]" publicKey: type: string pattern: "[A-Fa-f0-9]{20}" minLength: 20 maxLength: 20 responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/DocumentSignature" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/public/{digest}: parameters: - name: digest in: path required: true schema: type: string get: tags: - document security: [] responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/PublicDocument" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/public/{digest}/{certificationTime}: parameters: - name: digest in: path required: true schema: type: string - name: certificationTime in: path required: true schema: type: string enum: - all - latest - earliest get: tags: - document security: [] responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/PublicDocument_all" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/search: post: tags: - document requestBody: content: application/json: schema: type: object properties: options: $ref: "#/components/schemas/DocumentSearchFilter" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Document" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/search/batch: post: tags: - document requestBody: content: application/json: schema: type: object properties: batch: type: array items: type: object properties: options: $ref: "#/components/schemas/DocumentSearchFilter" responses: "200": description: Success content: application/json: schema: type: array items: type: array items: $ref: "#/components/schemas/Document" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/search/count: post: tags: - document requestBody: content: application/json: schema: type: object properties: options: $ref: "#/components/schemas/DocumentSearchFilter" responses: "200": description: Success content: application/json: schema: type: object properties: count: type: integer "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/search/count/batch: post: tags: - document requestBody: content: application/json: schema: type: object properties: batch: type: array items: type: object properties: options: $ref: "#/components/schemas/DocumentSearchFilter" responses: "200": description: Success content: application/json: schema: type: array items: type: object properties: count: type: integer "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/{digest}/source: parameters: - name: digest in: path required: true schema: type: string post: tags: - document storing requestBody: content: multipart/form-data: schema: properties: file: # a binary file of any type type: string format: binary responses: "200": description: Source document successfully uploaded and stored "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" get: tags: - document storing responses: "200": description: Success content: application/octet-stream: # any media type, functionally equivalent to `*/*` schema: type: string format: binary "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" delete: tags: - document storing responses: "200": description: Source document successfully removed "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/pdf-receipt: post: tags: - pdf receipt requestBody: required: true content: application/json: schema: type: object properties: digestsOrPublicIds: type: array items: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 responses: "200": description: A PDF certificate or a ZIP archive of certificates. content: application/pdf: schema: type: string format: binary "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" /document/verify: post: tags: - pdf receipt security: [] requestBody: required: true content: application/json: schema: type: object properties: digest: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 responses: "200": description: Success content: application/json: schema: type: object properties: digest: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 observableDocs: oneOf: - $ref: "#/components/schemas/observableDocs" - $ref: "#/components/schemas/observableDocs_all" receiptFor: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/Standard500ErrorResponse" components: schemas: Account: type: object properties: anchoringSchedule: type: array minItems: 24 maxItems: 24 items: type: boolean defaults: $ref: "#/components/schemas/AccountDefaults" flashAnchoringOption: type: boolean logoUrl: type: string userManualUrl: type: string verificationPageUrl: type: string mainPrimaryColor: type: string pattern: "#[A-Fa-f0-9]{6}" minLength: 7 maxLength: 7 example: "#1f9e5b" mainSecondaryColor: type: string pattern: "#[A-Fa-f0-9]{6}" minLength: 7 maxLength: 7 example: "#eaa522" maxNbUsers: type: integer maxNbAnchorsEnabled: type: boolean maxNbAnchors: type: integer name: type: string sourceStorageOption: type: boolean sourceStorageSpace: type: integer sourceStorageUsedSpace: type: integer AccountDefaults: type: object properties: language: type: string enum: - en - fr documentsTags: type: object documentsTypes: type: object docDiscoverableByDefault: type: boolean largestDocumentSize: type: integer signatureServerEnabled: type: boolean signatureServerURI: type: string signatureServerEthKeyId: type: integer webhookEnabled: type: boolean webhook: type: string JsonWebToken: type: object properties: expirationDate: type: string description: type: string jwt: readOnly: true type: string User: type: object properties: features: $ref: "#/components/schemas/UserFeatures" roles: type: array items: $ref: "#/components/schemas/UserRole" defaults: $ref: "#/components/schemas/UserDefaults" UserFeatures: type: object properties: email: type: string name: type: string company: type: string maxNbAnchorsEnabled: type: boolean maxNbAnchors: type: integer flashAnchoringOption: type: boolean UserRole: type: string enum: - admin - subuser UserDefaults: type: object properties: docDiscoverableByDefault: type: boolean language: type: string enum: - en - fr default: en signatureServerEnabled: type: boolean signatureServerURI: type: string signatureServerEthKeyId: type: integer webhookEnabled: type: boolean webhook: type: string UserSearchFilter: type: object properties: filter: type: object example: { "features": { "name": "string" } } excludedFields: type: array items: type: string skip: type: integer limit: type: integer sortBy: type: array items: type: string example: ["-features.name"] Anchor: type: object readOnly: true properties: blockchain: type: string enum: - ETHEREUM - POLYGON timestamp: type: string status: type: string enum: - PENDING - WAITING_TO_BE_MINED - VALID stdProof: $ref: "#/components/schemas/StandardProof" Anchor_many: type: array items: $ref: "#/components/schemas/Anchor" Document: type: object properties: publicId: type: string readOnly: true pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 anchor: oneOf: - $ref: "#/components/schemas/Anchor" - $ref: "#/components/schemas/Anchor_many" features: $ref: "#/components/schemas/DocumentFeatures" creator: $ref: "#/components/schemas/UserFeatures" signatures: readOnly: true type: array uniqueItems: true items: $ref: "#/components/schemas/DocumentSignature" StandardProof: readOnly: true type: object properties: "@context": type: string description: the JSON-LD context for the receipt example: https://w3id.org/chainpoint/v2 type: type: string description: receipt type definition specifying hash method and version example: ChainpointSHA256v2 targetHash: type: string description: hash value being anchored to the blockchain pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 example: 00c2802975a227c6db761766d7e36b714aaac537454c525ea417624f8386f3c5 merkleRoot: type: string description: merkle tree root value that is anchored to the blockchain pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 example: 00c2802975a227c6db761766d7e36b714aaac537454c525ea417624f8386f3c5 proof: type: array description: merkle proof establishing link from the targetHash to the merkleRoot items: type: object properties: direction: type: string enum: - left - right hash: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 anchors: type: object properties: type: type: string description: anchor type definition specifying anchoring method example: ETHData sourceId: type: string description: identifier, such as a transaction id, used to locate anchored data example: d9c4be64970ebf5211a4826ee6fc1bb545bbb8a026ee1243fc78a29e20697362 DocumentFeatures: type: object properties: digest: type: string readOnly: true pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 name: type: string description: type: string type: type: string tags: type: array uniqueItems: true items: type: string creationTimestamp: readOnly: true type: string size: type: integer storedOnline: readOnly: true type: boolean discoverable: type: boolean archived: type: boolean webhook: type: string DocumentSignature: type: object properties: signature: type: string pattern: "[A-Fa-f0-9]" signatureDigest: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 signeePubKey: type: string pattern: "[A-Fa-f0-9]" signeeAddress: type: string pattern: "[A-Fa-f0-9]{40}" minLength: 40 maxLength: 40 anchor: oneOf: - $ref: "#/components/schemas/Anchor" - $ref: "#/components/schemas/Anchor_many" PublicDocument: type: object properties: blockchain: type: string enum: - ETHEREUM - POLYGON publicId: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 stdProof: $ref: "#/components/schemas/StandardProof" timestamp: type: string accountName: readOnly: true type: string PublicDocument_all: type: object properties: publicId: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 blockchain: type: object properties: ETHEREUM: type: object properties: timestamp: type: string stdProof: $ref: "#/components/schemas/StandardProof" accountName: readOnly: true type: string DocumentSearchFilter: allOf: - $ref: "#/components/schemas/UserSearchFilter" - type: object properties: searchText: type: string filter: type: object example: { "anchor": { "status": { "$ne": "PENDING" } } } from: type: string to: type: string inclusive: type: boolean sortBy: type: array items: type: string example: ["-features.creationTimestamp"] observableDocs: type: array items: type: object properties: blockchain: type: string enum: - ETHEREUM - POLYGON accountName: type: string publicId: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 timestamp: type: string observableDocs_all: type: array items: type: object properties: accountName: type: string publicId: type: string pattern: "[A-Fa-f0-9]{64}" minLength: 64 maxLength: 64 timestamp: type: object properties: blockchain: type: string Error: type: object properties: type: type: string message: type: string responses: Standard500ErrorResponse: description: An unexpected error occured. content: application/json: schema: $ref: "#/components/schemas/Error" Unauthorized: description: Unauthorized securitySchemes: BasicAuth: type: http scheme: basic BearerAuth: type: http scheme: bearer bearerFormat: JWT