openapi: 3.0.1
info:
  title: Changelogs
  version: 2.10.0
  description: Queries related to changelogs of the platform.
  contact:
    name: Tradevest GmbH
servers:
  - url: https://tvda-api.platform-test.tradevest.ai
    description: Test
security:
  - Bearer: []
tags:
  - name: Changelogs
    description: Changelogs
paths:
  /entities-changelog:
    get:
      summary: Get Entities Changelog
      description: Get a log of entities changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-entities-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/entities/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/EntitiesChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
  /roles-changelog:
    get:
      summary: Get Roles Changelog
      description: Get a log of roles changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-roles-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/roles/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/RolesChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RolesChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
  /digital-changelog:
    get:
      summary: Get Digital Assets Changelog
      description: Get a log of digital assets changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-digital-assets-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/digital-assets/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/DigitalAssetsChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigitalAssetsChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
  /products-changelog:
    get:
      summary: Get Products Changelog
      description: Get a log of products changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-products-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/products/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/ProductsChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductsChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
  /documents-changelog:
    get:
      summary: Get Documents Changelog
      description: Get a log of documents changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-documents-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/documents/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/DocumentsChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
  /traditional-changelog:
    get:
      summary: Get Traditional Assets Changelog
      description: Get a log of traditional assets changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-traditional-assets-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/traditional-assets/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/TraditionalAssetsChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraditionalAssetsChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
  /taxes-changelog:
    get:
      summary: Get Taxes Changelog
      description: Get a log of taxes changes for the specified timeframe, ordered chronologically. Option is to get by specified item type and id.
      operationId: get-taxes-changelog
      x-operation-group: changelogs-query
      x-required-permissions: rs/taxes/read
      tags:
        - Changelogs
      parameters:
        - $ref: '#/components/parameters/ItemId'
        - $ref: '#/components/parameters/TaxesChangelogItemType'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/OrderDirection'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxesChangelogEntries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    parameters: []
components:
  schemas:
    ChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    RolesChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RolesChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    EntitiesChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EntitiesChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    DigitalAssetsChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DigitalAssetsChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    ProductsChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ProductsChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    DocumentsChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DocumentsChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    TraditionalAssetsChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TraditionalAssetsChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    TaxesChangelogEntries:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TaxesChangelogEntry'
        pagination:
          $ref: '#/components/schemas/Pagination'
    ChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/ChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    RolesChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/RolesChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    EntitiesChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/EntitiesChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    DigitalAssetsChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/DigitalAssetsChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    ProductsChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/ProductsChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    DocumentsChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/DocumentsChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    TraditionalAssetsChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/TraditionalAssetsChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    TaxesChangelogEntry:
      type: object
      required:
        - changes
        - createdOn
        - entryId
        - itemId
        - itemType
        - source
      properties:
        itemType:
          $ref: '#/components/schemas/TaxesChangelogItemTypeEnum'
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
      title: ChangelogEntry
    EntitiesChangelogItemTypeEnum:
      title: EntitiesChangelogItemType
      type: string
      enum:
        - NATURAL_PERSON
        - BENEFICIAL_OWNER
        - LEGAL_ENTITY
        - LEGAL_REPRESENTATIVE
        - JOINT_PERSON
        - ONBOARDING
        - OFFBOARDING
    ChangelogEntryValueType:
      title: ChangelogEntryValueType
      type: string
      enum:
        - REPLACE
        - ADD
        - REMOVE
    ChangelogEntryValue:
      title: ChangelogEntryValue
      type: object
      required:
        - type
        - path
      properties:
        type:
          $ref: '#/components/schemas/ChangelogEntryValueType'
        path:
          type: string
          description: Path to the changed attribute.
          example: /legalEntity/contact/email
        oldValue:
          type: string
          description: Old value of the attribute.
          example: old_email@example.com
        value:
          type: string
          description: New value of the attribute.
          example: new_email@example.com
    ChangelogSource:
      title: ChangelogSource
      type: string
      enum:
        - PARTNER_SYSTEM
        - PARTNER_EMPLOYEE
        - INTERNAL_CHANGE
    ChangelogEntry-2:
      title: ChangelogEntry
      type: object
      required:
        - entryId
        - itemId
        - createdOn
        - changes
        - source
      properties:
        entryId:
          type: string
          format: uuid
          description: UUID of changelog entry.
        itemId:
          type: string
          format: uuid
          description: UUID of item
        createdOn:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangelogEntryValue'
        source:
          $ref: '#/components/schemas/ChangelogSource'
    Pagination:
      title: Pagination
      type: object
      properties:
        cursor:
          type: string
          description: String value used for pagination, which should be set in next page request.
        limit:
          type: integer
          description: Maximum number of returned items
      required:
        - cursor
        - limit
    ErrorDetailsExplanation:
      title: ErrorDetailsExplanation
      type: object
      properties:
        code:
          type: string
          maxLength: 255
        parameter:
          type: string
        message:
          type: string
      required:
        - code
        - message
    ErrorDetails:
      title: ErrorDetails
      type: object
      properties:
        field:
          type: string
          maxLength: 255
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetailsExplanation'
      required:
        - field
    ErrorMessage:
      title: ErrorMessage
      type: object
      properties:
        message:
          type: string
        responseType:
          type: string
        validationString:
          minLength: 1
          type: string
        requestId:
          type: string
        errorCode:
          type: string
          maxLength: 255
        errorDetails:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetails'
      required:
        - message
        - responseType
        - requestId
    RolesChangelogItemTypeEnum:
      title: RolesChangelogItemType
      type: string
      enum:
        - CUSTOMER
        - CUSTOMER_LABEL
        - PROXY
        - ONBOARDING
        - OFFBOARDING
    DigitalAssetsChangelogItemTypeEnum:
      title: DigitalAssetsChangelogItemType
      type: string
      enum:
        - ORDER
    ProductsChangelogItemTypeEnum:
      title: ProductsChangelogItemType
      type: string
      enum:
        - CUSTOMER_PRODUCT
        - PARTNER_PRODUCT_DEFINITION
    DocumentsChangelogItemTypeEnum:
      title: DocumentsChangelogItemType
      type: string
      enum:
        - CUSTOMER_DOCUMENT
        - PROXY_DOCUMENT
        - NATURAL_PERSON_DOCUMENT
        - PARTNER_USER_DOCUMENT
        - LEGAL_ENTITY_DOCUMENT
    TraditionalAssetsChangelogItemTypeEnum:
      title: TraditionalAssetsChangelogItemType
      type: string
      enum:
        - ORDER
    TaxesChangelogItemTypeEnum:
      title: TaxesChangelogItemType
      type: string
      enum:
        - TAX_EXEMPTION_ORDER
    ChangelogItemTypeEnum:
      title: ChangelogItemType
      type: string
      enum:
        - CUSTOMER
        - CUSTOMER_LABEL
        - CUSTOMER_DOCUMENT
        - PROXY_DOCUMENT
        - NATURAL_PERSON_DOCUMENT
        - NATURAL_PERSON
        - ONBOARDING
        - BENEFICIAL_OWNER
        - PROXY
        - PARTNER_USER_DOCUMENT
        - OFFBOARDING
        - LEGAL_ENTITY
        - LEGAL_REPRESENTATIVE
        - LEGAL_ENTITY_DOCUMENT
        - JOINT_PERSON
  parameters:
    ItemId:
      name: itemId
      in: query
      description: Unique item identification number in UUID format, for which changelogs are added
      schema:
        type: string
        format: uuid
    ChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/ChangelogItemTypeEnum'
    RolesChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/RolesChangelogItemTypeEnum'
    EntitiesChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/EntitiesChangelogItemTypeEnum'
    DigitalAssetsChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/DigitalAssetsChangelogItemTypeEnum'
    ProductsChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/ProductsChangelogItemTypeEnum'
    DocumentsChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/DocumentsChangelogItemTypeEnum'
    TraditionalAssetsChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/TraditionalAssetsChangelogItemTypeEnum'
    TaxesChangelogItemType:
      name: ChangelogItemType
      in: query
      description: optional filtering by changelog item type
      schema:
        $ref: '#/components/schemas/TaxesChangelogItemTypeEnum'
    Limit:
      name: limit
      in: query
      description: Maximum number of items to return
      required: true
      schema:
        type: integer
        default: 20
        minimum: 1
    Cursor:
      name: cursor
      in: query
      description: String value used for pagination
      schema:
        type: string
    OrderDirection:
      name: orderDirection
      in: query
      description: order direction
      schema:
        type: string
        default: ASC
        enum:
          - ASC
          - DESC
    StartDate:
      name: startDate
      in: query
      description: The left boundary of `[startDateTime - endDateTime]` changelog entries date-time range
      schema:
        type: string
        format: date-time
        example: '2019-04-12T23:20:50.52Z'
    EndDate:
      name: endDate
      in: query
      description: The right boundary of `[startDateTime - endDateTime]` changelog entries date-time range
      schema:
        type: string
        format: date-time
        example: '2019-05-12T23:20:50.52Z'
x-tagGroups:
  - name: Changelogs
    tags:
      - Changelogs
