openapi: 3.0.1
info:
  title: ClickWrap Integrators API
  version: v1
servers:
  - url: http://localhost
paths:
  /api/AppLog:
    post:
      tags:
        - AppLog
      summary: Create a new appLog
      parameters:
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        description: The content of the appLog to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppLogCreationViewModel'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppLogOutputCreationViewModel'
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/AppLog/List:
    post:
      tags:
        - AppLog
      summary: Provides a filtered list of appLogs
      parameters:
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        description: The parameters to filter by
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppLogSearchViewModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppLogOutputViewModel'
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/AppLog/GetAuditTrail/{guid}:
    get:
      tags:
        - AppLog
      summary: Provides the audit trail pdf document for a specific appLog
      parameters:
        - name: guid
          in: path
          description: The guid of the appLog
          required: true
          schema:
            type: string
            format: uuid
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/pdf:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/Consent:
    post:
      tags:
        - Consent
      summary: Create a new consent
      parameters:
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        description: The content of the consent to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentCreationViewModel'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentCreationOutputModel'
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/Consent/List:
    post:
      tags:
        - Consent
      summary: Provides a filtered list of consents
      parameters:
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        description: The parameters to filter by
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentSearchViewModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConsentOutputModel'
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/Consent/GetAuditTrail/{guid}:
    get:
      tags:
        - Consent
      summary: Provides the audit trail pdf document for a specific consent
      parameters:
        - name: guid
          in: path
          description: The guid of the consent
          required: true
          schema:
            type: string
            format: uuid
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/pdf:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/SignedContract:
    post:
      tags:
        - SignedContract
      summary: Create a new signedContract
      parameters:
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        description: The content of the signedContract to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignedContractCreationViewModel'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedContractCreationOutputModel'
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '412':
          description: >-
            Precondition failed: no p12 certificate was uploaded for the
            organization
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/SignedContract/List:
    post:
      tags:
        - SignedContract
      summary: Provides a filtered list of signedContracts
      parameters:
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        description: The parameters to filter by
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignedContractSearchViewModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SignedContractViewModel'
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/SignedContract/GetAuditTrail/{guid}:
    get:
      tags:
        - SignedContract
      summary: Provides the audit trail pdf document for a specific signedContract
      parameters:
        - name: guid
          in: path
          description: The guid of the signedContract
          required: true
          schema:
            type: string
            format: uuid
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/pdf:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
  /api/SignedContract/GetSignedContract/{guid}:
    get:
      tags:
        - SignedContract
      summary: Provides the signed contract pdf document for a specific signedContract
      parameters:
        - name: guid
          in: path
          description: The guid of the signedContract
          required: true
          schema:
            type: string
            format: uuid
        - name: apiKey
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: >-
            Bad request: the request is not conforming to the specification
            provided
          content:
            application/pdf:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: >-
            Unauthorized: either missing an apiKey header or an invalid apiKey
            was provided
        '403':
          description: >-
            Forbidden: an apiKey header was found and validated but it is
            forbidden to perform the requested action
        '404':
          description: 'Not found: a resource specified in the request was not found'
        '500':
          description: 'Internal server error: the server produced an unexpected error'
components:
  schemas:
    AgreementOutputViewModel:
      type: object
      properties:
        version:
          type: string
          nullable: true
        enviroment:
          $ref: '#/components/schemas/EnviromentEnum'
        groupGuid:
          type: string
          format: uuid
        nameOfAgreement:
          type: string
          nullable: true
      additionalProperties: false
    AppLogCreationViewModel:
      required:
        - applicationGuid
        - owner
        - payload
        - scope
        - source
        - target
      type: object
      properties:
        applicationGuid:
          type: string
          description: The guid of the application to log to
          format: uuid
          example: dd1d816d-2e80-478c-93fa-6cf29b168de1
        owner:
          minLength: 1
          type: string
          example: My owner
        scope:
          minLength: 1
          type: string
          example: My scope
        source:
          minLength: 1
          type: string
          example: My source
        target:
          minLength: 1
          type: string
          example: My target
        payload:
          minLength: 1
          type: string
          example: My payload
      additionalProperties: false
    AppLogOutputCreationViewModel:
      type: object
      properties:
        guid:
          type: string
          format: uuid
        applicationGuid:
          type: string
          format: uuid
        owner:
          type: string
          nullable: true
        timeStamp:
          type: string
          format: date-time
        scope:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
        ip:
          type: string
          nullable: true
        target:
          type: string
          nullable: true
        hash:
          type: string
          nullable: true
        payload:
          type: string
          nullable: true
      additionalProperties: false
    AppLogOutputViewModel:
      type: object
      properties:
        guid:
          type: string
          format: uuid
        applicationGuid:
          type: string
          format: uuid
        owner:
          type: string
          nullable: true
        timeStamp:
          type: string
          format: date-time
        scope:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
        ip:
          type: string
          nullable: true
        target:
          type: string
          nullable: true
        payload:
          type: string
          nullable: true
        blockchainStatus:
          $ref: '#/components/schemas/ConsentStatusEnum'
        blockchainStatusDate:
          type: string
          format: date-time
        blockchainProcessId:
          type: string
          nullable: true
        blockchainUuid:
          type: string
          nullable: true
        hash:
          type: string
          nullable: true
        blockchainTxHashUrl:
          type: string
          nullable: true
      additionalProperties: false
    AppLogSearchViewModel:
      type: object
      properties:
        applicationGuid:
          type: string
          format: uuid
        dateFrom:
          type: string
          format: date-time
          nullable: true
          example: 2020/04/01
        dateTo:
          type: string
          format: date-time
          nullable: true
          example: 2030/04/01
        page:
          maximum: 2147483647
          minimum: 0
          type: integer
          format: int32
          example: 0
        itemsPerPage:
          maximum: 5000
          minimum: 1
          type: integer
          format: int32
          example: 20
      additionalProperties: false
    ClausesViewModel:
      type: object
      properties:
        tag:
          type: string
          description: The tag of the clause
          nullable: true
          example: my_tag
        accepted:
          type: boolean
          description: Specifies wether the clause was accepted
          example: true
      additionalProperties: false
    ConsentCreationOutputModel:
      type: object
      properties:
        guid:
          type: string
          format: uuid
        agreement:
          $ref: '#/components/schemas/AgreementOutputViewModel'
        fieldCollection:
          type: string
          nullable: true
        consentDate:
          type: string
          format: date-time
        platform:
          type: string
          nullable: true
        userIdentifier:
          type: string
          nullable: true
        clauses:
          type: array
          items:
            $ref: '#/components/schemas/ClausesViewModel'
          nullable: true
        agreementHash:
          type: string
          nullable: true
        externalID:
          type: string
          nullable: true
        consentGroupGuid:
          type: string
          format: uuid
        screenshot:
          type: string
          format: byte
          nullable: true
        userIp:
          type: string
          nullable: true
      additionalProperties: false
    ConsentCreationViewModel:
      required:
        - agreementGroupGuid
        - clauses
        - environment
        - externalID
        - fieldCollection
        - screenshot
        - userIp
      type: object
      properties:
        agreementGroupGuid:
          type: string
          description: Specifies the guid of the agreementGroup
          format: uuid
        consentGroupGuid:
          type: string
          description: Specifies the guid of the consentGroup
          format: uuid
          nullable: true
        userIp:
          minLength: 1
          type: string
          description: Specifies the user ip address
          example: 127.0.0.1
        externalID:
          minLength: 1
          type: string
          description: Specifies the external ID
          example: 2c65cf53-d083-4cab-8f13-402d73b24463
        environment:
          $ref: '#/components/schemas/EnviromentEnum'
        screenshot:
          type: string
          format: byte
        clauses:
          type: array
          items:
            $ref: '#/components/schemas/ClausesViewModel'
        fieldCollection:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JToken'
      additionalProperties: false
    ConsentOutputModel:
      type: object
      properties:
        guid:
          type: string
          format: uuid
        agreement:
          $ref: '#/components/schemas/AgreementOutputViewModel'
        fieldCollection:
          type: string
          nullable: true
        consentDate:
          type: string
          format: date-time
        platform:
          type: string
          nullable: true
        userIdentifier:
          type: string
          nullable: true
        clauses:
          type: array
          items:
            $ref: '#/components/schemas/ClausesViewModel'
          nullable: true
        blockchainProcessId:
          type: string
          nullable: true
        blockchainTxHash:
          type: string
          nullable: true
        agreementHash:
          type: string
          nullable: true
        blockchainStatus:
          $ref: '#/components/schemas/ConsentStatusEnum'
        blockchainStatusDate:
          type: string
          format: date-time
        externalID:
          type: string
          nullable: true
        blockchainUuid:
          type: string
          nullable: true
        screenshot:
          type: string
          format: byte
          nullable: true
        consentGroupGuid:
          type: string
          format: uuid
        userIp:
          type: string
          nullable: true
      additionalProperties: false
    ConsentSearchViewModel:
      type: object
      properties:
        agreementGroupGuid:
          type: string
          format: uuid
          nullable: true
        externalID:
          type: string
          nullable: true
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        userIdentifier:
          type: string
          nullable: true
        dateFrom:
          type: string
          format: date-time
          nullable: true
          example: 2020/04/01
        dateTo:
          type: string
          format: date-time
          nullable: true
          example: 2030/04/01
        platform:
          type: string
          nullable: true
        enviroment:
          $ref: '#/components/schemas/EnviromentEnum'
        version:
          type: string
          nullable: true
        getScreenshot:
          type: boolean
        page:
          maximum: 2147483647
          minimum: 0
          type: integer
          format: int32
          example: 0
        itemsPerPage:
          maximum: 5000
          minimum: 1
          type: integer
          format: int32
          example: 20
      additionalProperties: false
    ConsentStatusEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
      type: integer
      format: int32
    EnviromentEnum:
      enum:
        - 0
        - 1
      type: integer
      format: int32
    JToken:
      type: array
      items:
        $ref: '#/components/schemas/JToken'
    SignedContractCreationOutputModel:
      type: object
      properties:
        guid:
          type: string
          format: uuid
        contract:
          $ref: '#/components/schemas/SignedContractOutputViewModel'
        fieldCollection:
          type: string
          nullable: true
        signedContractDate:
          type: string
          format: date-time
        platform:
          type: string
          nullable: true
        userIdentifier:
          type: string
          nullable: true
        clauses:
          type: array
          items:
            $ref: '#/components/schemas/ClausesViewModel'
          nullable: true
        contractHash:
          type: string
          nullable: true
        externalID:
          type: string
          nullable: true
        signedContractGroupGuid:
          type: string
          format: uuid
        userIp:
          type: string
          nullable: true
        contractGuid:
          type: string
          format: uuid
      additionalProperties: false
    SignedContractCreationViewModel:
      required:
        - clauses
        - contractGroupGuid
        - environment
        - externalID
        - fieldCollection
        - screenshot
        - userIp
      type: object
      properties:
        contractGroupGuid:
          type: string
          description: The guid of the contract
          format: uuid
          example: d8b7fcd1-e607-4099-8d66-f27884dddb77
        templateVariant:
          type: string
          description: The name of the template variant
          nullable: true
          example: Default
        externalID:
          minLength: 1
          type: string
          description: Specifies your ID
          example: d8b7fcd1-e607-4099-8d66-f27884dddb77
        userIp:
          minLength: 1
          type: string
          description: Specifies the ip address of the user
          example: 127.0.0.1
        environment:
          $ref: '#/components/schemas/EnviromentEnum'
        screenshot:
          type: string
          description: Specifies the byte array that contains the screenshot
          format: byte
        clauses:
          type: array
          items:
            $ref: '#/components/schemas/ClausesViewModel'
          description: The list of clauses
        fieldCollection:
          type: object
          additionalProperties:
            type: string
            nullable: true
      additionalProperties: false
    SignedContractOutputViewModel:
      type: object
      properties:
        version:
          type: string
          nullable: true
        enviroment:
          $ref: '#/components/schemas/EnviromentEnum'
        groupGuid:
          type: string
          format: uuid
        nameOfContract:
          type: string
          nullable: true
      additionalProperties: false
    SignedContractSearchViewModel:
      type: object
      properties:
        contractGroupGuid:
          type: string
          format: uuid
        externalID:
          type: string
          nullable: true
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        userIdentifier:
          type: string
          nullable: true
        dateFrom:
          type: string
          format: date-time
          nullable: true
          example: 2020/04/01
        dateTo:
          type: string
          format: date-time
          nullable: true
          example: 2030/04/01
        platform:
          type: string
          nullable: true
        enviroment:
          $ref: '#/components/schemas/EnviromentEnum'
        version:
          type: string
          nullable: true
        getScreenshot:
          type: boolean
        page:
          maximum: 2147483647
          minimum: 0
          type: integer
          format: int32
          example: 0
        itemsPerPage:
          maximum: 5000
          minimum: 1
          type: integer
          format: int32
          example: 20
      additionalProperties: false
    SignedContractViewModel:
      type: object
      properties:
        guid:
          type: string
          format: uuid
        contract:
          $ref: '#/components/schemas/SignedContractOutputViewModel'
        fieldCollection:
          type: string
          nullable: true
        contractGuid:
          type: string
          format: uuid
        signedContractDate:
          type: string
          format: date-time
        platform:
          type: string
          nullable: true
        userIdentifier:
          type: string
          nullable: true
        clauses:
          type: array
          items:
            $ref: '#/components/schemas/ClausesViewModel'
          nullable: true
        blockchainProcessId:
          type: string
          nullable: true
        blockchainTxHash:
          type: string
          nullable: true
        contractHash:
          type: string
          nullable: true
        blockchainStatus:
          $ref: '#/components/schemas/ConsentStatusEnum'
        blockchainStatusDate:
          type: string
          format: date-time
        externalID:
          type: string
          nullable: true
        blockchainUuid:
          type: string
          nullable: true
        pdf:
          type: string
          format: byte
          nullable: true
        signedContractGroupGuid:
          type: string
          format: uuid
        userIp:
          type: string
          nullable: true
        screenshot:
          type: string
          format: byte
          nullable: true
      additionalProperties: false
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
          readOnly: true
      additionalProperties: {}
tags:
  - name: AppLog
    description: Manage appLogs
  - name: Consent
    description: Manage consents
  - name: SignedContract
    description: Manage signedContracts
