ThingsBoard entities-version-control-controller API

Entities Version Control

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-device-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-deviceprofile-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-asset-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-assetprofile-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-entityrelation-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-alarm-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-rulechain-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-dashboard-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-tenant-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-customer-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/json-schema/thingsboard-user-schema.json

OpenAPI Specification

thingsboard-entities-version-control-controller-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ThingsBoard Admin admin-controller entities-version-control-controller API
  description: 'ThingsBoard Admin API — subset of the ThingsBoard REST API (open-source IoT platform). Covers: Admin, Audit Log, Event, Usage Info, Queue, Queue Stats, Mail Config Template, Qr Code Settings, Job.'
  version: 4.3.0.3DEMO
  contact:
    name: ThingsBoard team
    url: https://thingsboard.io
    email: info@thingsboard.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://demo.thingsboard.io
  description: ThingsBoard Live Demo
- url: http://localhost:8080
  description: Local ThingsBoard server
tags:
- name: entities-version-control-controller
  description: Entities Version Control
paths:
  /api/entities/vc/version:
    get:
      tags:
      - entities-version-control-controller
      summary: List All Versions (listVersions)
      description: "Lists all available versions in a branch for all entity types. \nIf specified branch does not exist - empty page data will be returned. The response format is the same as for `listEntityVersions` API method.\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: listVersions
      parameters:
      - name: branch
        in: query
        description: The name of the working branch, for example 'master'
        required: true
        schema:
          type: string
      - name: pageSize
        in: query
        description: Maximum amount of entities in a one page
        required: true
        schema:
          type: integer
          format: int32
      - name: page
        in: query
        description: Sequence number of page starting from 0
        required: true
        schema:
          type: integer
          format: int32
      - name: textSearch
        in: query
        description: The case insensitive 'substring' filter based on the entity version name.
        required: false
        schema:
          type: string
      - name: sortProperty
        in: query
        description: Property of entity to sort by
        required: false
        schema:
          type: string
          enum:
          - timestamp
      - name: sortOrder
        in: query
        description: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageDataEntityVersion'
    post:
      tags:
      - entities-version-control-controller
      summary: Save Entities Version (saveEntitiesVersion)
      description: "Creates a new version of entities (or a single entity) by request.\nSupported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.\n\nThere are two available types of request: `SINGLE_ENTITY` and `COMPLEX`. Each of them contains version name (`versionName`) and name of a branch (`branch`) to create version (commit) in. If specified branch does not exists in a remote repo, then new empty branch will be created. Request of the `SINGLE_ENTITY` type has id of an entity (`entityId`) and additional configuration (`config`) which has following options: \n- `saveRelations` - whether to add inbound and outbound relations of type COMMON to created entity version;\n- `saveAttributes` - to save attributes of server scope (and also shared scope for devices);\n- `saveCredentials` - when saving a version of a device, to add its credentials to the version.\n\nAn example of a `SINGLE_ENTITY` version create request:\n```json\n{\n  \"type\": \"SINGLE_ENTITY\",\n\n  \"versionName\": \"Version 1.0\",\n  \"branch\": \"dev\",\n\n  \"entityId\": {\n    \"entityType\": \"DEVICE\",\n    \"id\": \"b79448e0-d4f4-11ec-847b-0f432358ab48\"\n  },\n  \"config\": {\n    \"saveRelations\": true,\n    \"saveAttributes\": true,\n    \"saveCredentials\": false\n  }\n}\n```\n\nSecond request type (`COMPLEX`), additionally to `branch` and `versionName`, contains following properties:\n- `entityTypes` - a structure with entity types to export and configuration for each entity type;    this configuration has all the options available for `SINGLE_ENTITY` and additionally has these ones: \n     - `allEntities` and `entityIds` - if you want to save the version of all entities of the entity type         then set `allEntities` param to true, otherwise set it to false and specify the list of specific entities (`entityIds`);\n     - `syncStrategy` - synchronization strategy to use for this entity type: when set to `OVERWRITE`         then the list of remote entities of this type will be overwritten by newly added entities. If set to         `MERGE` - existing remote entities of this entity type will not be removed, new entities will just         be added on top (or existing remote entities will be updated).\n- `syncStrategy` - default synchronization strategy to use when it is not specified for an entity type.\n\nExample for this type of request:\n```json\n{\n  \"type\": \"COMPLEX\",\n\n  \"versionName\": \"Devices and profiles: release 2\",\n  \"branch\": \"master\",\n\n  \"syncStrategy\": \"OVERWRITE\",\n  \"entityTypes\": {\n    \"DEVICE\": {\n      \"syncStrategy\": null,\n      \"allEntities\": true,\n      \"saveRelations\": true,\n      \"saveAttributes\": true,\n      \"saveCredentials\": true\n    },\n    \"DEVICE_PROFILE\": {\n      \"syncStrategy\": \"MERGE\",\n      \"allEntities\": false,\n      \"entityIds\": [\n        \"b79448e0-d4f4-11ec-847b-0f432358ab48\"\n      ],\n      \"saveRelations\": true\n    }\n  }\n}\n```\n\nResponse wil contain generated request UUID, that can be then used to retrieve status of operation via `getVersionCreateRequestStatus`.\n\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: saveEntitiesVersion
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/ComplexVersionCreateRequest'
              - $ref: '#/components/schemas/SingleEntityVersionCreateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: uuid
  /api/entities/vc/entity:
    post:
      tags:
      - entities-version-control-controller
      summary: Load Entities Version (loadEntitiesVersion)
      description: "Loads specific version of remote entities (or single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.\n\nThere are multiple types of request. Each of them requires branch name (`branch`) and version id (`versionId`). Request of type `SINGLE_ENTITY` is needed to restore a concrete version of a specific entity. It contains id of a remote entity (`externalEntityId`) and additional configuration (`config`):\n- `loadRelations` - to update relations list (in case `saveRelations` option was enabled during version creation);\n- `loadAttributes` - to load entity attributes (if `saveAttributes` config option was enabled);\n- `loadCredentials` - to update device credentials (if `saveCredentials` option was enabled during version creation).\n\nAn example of such request:\n```json\n{\n  \"type\": \"SINGLE_ENTITY\",\n  \n  \"branch\": \"dev\",\n  \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",\n  \n  \"externalEntityId\": {\n    \"entityType\": \"DEVICE\",\n    \"id\": \"b7944123-d4f4-11ec-847b-0f432358ab48\"\n  },\n  \"config\": {\n    \"loadRelations\": false,\n    \"loadAttributes\": true,\n    \"loadCredentials\": true\n  }\n}\n```\n\nAnother request type (`ENTITY_TYPE`) is needed to load specific version of the whole entity types. It contains a structure with entity types to load and configs for each entity type (`entityTypes`). For each specified entity type, the method will load all remote entities of this type that are present at the version. A config for each entity type contains the same options as in `SINGLE_ENTITY` request type, and additionally contains following options:\n- `removeOtherEntities` - to remove local entities that are not present on the remote - basically to    overwrite local entity type with the remote one;\n- `findExistingEntityByName` - when you are loading some remote entities that are not yet present at this tenant,    try to find existing entity by name and update it rather than create new.\n\nHere is an example of the request to completely restore version of the whole device entity type:\n```json\n{\n  \"type\": \"ENTITY_TYPE\",\n\n  \"branch\": \"dev\",\n  \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",\n\n  \"entityTypes\": {\n    \"DEVICE\": {\n      \"removeOtherEntities\": true,\n      \"findExistingEntityByName\": false,\n      \"loadRelations\": true,\n      \"loadAttributes\": true,\n      \"loadCredentials\": true\n    }\n  }\n}\n```\n\nThe response will contain generated request UUID that is to be used to check the status of operation via `getVersionLoadRequestStatus`.\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: loadEntitiesVersion
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/EntityTypeVersionLoadRequest'
              - $ref: '#/components/schemas/SingleEntityVersionLoadRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: uuid
  /api/entities/vc/version/{requestId}/status:
    get:
      tags:
      - entities-version-control-controller
      summary: Get Version Create Request Status (getVersionCreateRequestStatus)
      description: "Returns the status of previously made version create request. \n\nThis status contains following properties:\n- `done` - whether request processing is finished;\n- `version` - created version info: timestamp, version id (commit hash), commit name and commit author;\n- `added` - count of items that were created in the remote repo;\n- `modified` - modified items count;\n- `removed` - removed items count;\n- `error` - error message, if an error occurred while handling the request.\n\nAn example of successful status:\n```json\n{\n  \"done\": true,\n  \"added\": 10,\n  \"modified\": 2,\n  \"removed\": 5,\n  \"version\": {\n    \"timestamp\": 1655198528000,\n    \"id\":\"8a834dd389ed80e0759ba8ee338b3f1fd160a114\",\n    \"name\": \"My devices v2.0\",\n    \"author\": \"John Doe\"\n  },\n  \"error\": null\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: getVersionCreateRequestStatus
      parameters:
      - name: requestId
        in: path
        description: A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionCreationResult'
  /api/entities/vc/version/{entityType}:
    get:
      tags:
      - entities-version-control-controller
      summary: List Entity Type Versions (listEntityTypeVersions)
      description: "Returns list of versions of an entity type in a branch. This is a collected list of versions that were created for entities of this type in a remote branch. \nIf specified branch does not exist - empty page data will be returned. The response structure is the same as for `listEntityVersions` API method.\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: listEntityTypeVersions
      parameters:
      - name: entityType
        in: path
        description: A string value representing the entity type. For example, 'DEVICE'
        required: true
        schema:
          type: string
          enum:
          - TENANT
          - CUSTOMER
          - USER
          - DASHBOARD
          - ASSET
          - DEVICE
          - ALARM
          - RULE_CHAIN
          - RULE_NODE
          - ENTITY_VIEW
          - WIDGETS_BUNDLE
          - WIDGET_TYPE
          - TENANT_PROFILE
          - DEVICE_PROFILE
          - ASSET_PROFILE
          - API_USAGE_STATE
          - TB_RESOURCE
          - OTA_PACKAGE
          - EDGE
          - RPC
          - QUEUE
          - NOTIFICATION_TARGET
          - NOTIFICATION_TEMPLATE
          - NOTIFICATION_REQUEST
          - NOTIFICATION
          - NOTIFICATION_RULE
          - QUEUE_STATS
          - OAUTH2_CLIENT
          - DOMAIN
          - MOBILE_APP
          - MOBILE_APP_BUNDLE
          - CALCULATED_FIELD
          - JOB
          - ADMIN_SETTINGS
          - AI_MODEL
          - API_KEY
      - name: branch
        in: query
        description: The name of the working branch, for example 'master'
        required: true
        schema:
          type: string
      - name: pageSize
        in: query
        description: Maximum amount of entities in a one page
        required: true
        schema:
          type: integer
          format: int32
      - name: page
        in: query
        description: Sequence number of page starting from 0
        required: true
        schema:
          type: integer
          format: int32
      - name: textSearch
        in: query
        description: The case insensitive 'substring' filter based on the entity version name.
        required: false
        schema:
          type: string
      - name: sortProperty
        in: query
        description: Property of entity to sort by
        required: false
        schema:
          type: string
          enum:
          - timestamp
      - name: sortOrder
        in: query
        description: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageDataEntityVersion'
  /api/entities/vc/version/{entityType}/{externalEntityUuid}:
    get:
      tags:
      - entities-version-control-controller
      summary: List Entity Versions (listEntityVersions)
      description: "Returns list of versions for a specific entity in a concrete branch. \nYou need to specify external id of an entity to list versions for. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity. \nIf specified branch does not exist - empty page data will be returned. \n\nEach version info item has timestamp, id, name and author. Version id can then be used to restore the version. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nResponse example: \n```json\n{\n  \"data\": [\n    {\n      \"timestamp\": 1655198593000,\n      \"id\": \"fd82625bdd7d6131cf8027b44ee967012ecaf990\",\n      \"name\": \"Devices and assets - v2.0\",\n      \"author\": \"John Doe <johndoe@gmail.com>\"\n    },\n    {\n      \"timestamp\": 1655198528000,\n      \"id\": \"682adcffa9c8a2f863af6f00c4850323acbd4219\",\n      \"name\": \"Update my device\",\n      \"author\": \"John Doe <johndoe@gmail.com>\"\n    },\n    {\n      \"timestamp\": 1655198280000,\n      \"id\": \"d2a6087c2b30e18cc55e7cdda345a8d0dfb959a4\",\n      \"name\": \"Devices and assets - v1.0\",\n      \"author\": \"John Doe <johndoe@gmail.com>\"\n    }\n  ],\n  \"totalPages\": 1,\n  \"totalElements\": 3,\n  \"hasNext\": false\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: listEntityVersions
      parameters:
      - name: entityType
        in: path
        description: A string value representing the entity type. For example, 'DEVICE'
        required: true
        schema:
          type: string
          enum:
          - TENANT
          - CUSTOMER
          - USER
          - DASHBOARD
          - ASSET
          - DEVICE
          - ALARM
          - RULE_CHAIN
          - RULE_NODE
          - ENTITY_VIEW
          - WIDGETS_BUNDLE
          - WIDGET_TYPE
          - TENANT_PROFILE
          - DEVICE_PROFILE
          - ASSET_PROFILE
          - API_USAGE_STATE
          - TB_RESOURCE
          - OTA_PACKAGE
          - EDGE
          - RPC
          - QUEUE
          - NOTIFICATION_TARGET
          - NOTIFICATION_TEMPLATE
          - NOTIFICATION_REQUEST
          - NOTIFICATION
          - NOTIFICATION_RULE
          - QUEUE_STATS
          - OAUTH2_CLIENT
          - DOMAIN
          - MOBILE_APP
          - MOBILE_APP_BUNDLE
          - CALCULATED_FIELD
          - JOB
          - ADMIN_SETTINGS
          - AI_MODEL
          - API_KEY
      - name: externalEntityUuid
        in: path
        description: A string value representing external entity id. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity.
        required: true
        schema:
          type: string
          format: uuid
      - name: branch
        in: query
        description: The name of the working branch, for example 'master'
        required: true
        schema:
          type: string
      - name: pageSize
        in: query
        description: Maximum amount of entities in a one page
        required: true
        schema:
          type: integer
          format: int32
      - name: page
        in: query
        description: Sequence number of page starting from 0
        required: true
        schema:
          type: integer
          format: int32
      - name: textSearch
        in: query
        description: The case insensitive 'substring' filter based on the entity version name.
        required: false
        schema:
          type: string
      - name: sortProperty
        in: query
        description: Property of entity to sort by
        required: false
        schema:
          type: string
          enum:
          - timestamp
      - name: sortOrder
        in: query
        description: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageDataEntityVersion'
  /api/entities/vc/info/{versionId}/{entityType}/{externalEntityUuid}:
    get:
      tags:
      - entities-version-control-controller
      summary: Get Entity Data Info (getEntityDataInfo)
      description: "Retrieves short info about the remote entity by external id at a concrete version. \nReturned entity data info contains following properties: `hasRelations` (whether stored entity data contains relations), `hasAttributes` (contains attributes) and `hasCredentials` (whether stored device data has credentials).\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: getEntityDataInfo
      parameters:
      - name: versionId
        in: path
        description: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.
        required: true
        schema:
          type: string
      - name: entityType
        in: path
        description: A string value representing the entity type. For example, 'DEVICE'
        required: true
        schema:
          type: string
          enum:
          - TENANT
          - CUSTOMER
          - USER
          - DASHBOARD
          - ASSET
          - DEVICE
          - ALARM
          - RULE_CHAIN
          - RULE_NODE
          - ENTITY_VIEW
          - WIDGETS_BUNDLE
          - WIDGET_TYPE
          - TENANT_PROFILE
          - DEVICE_PROFILE
          - ASSET_PROFILE
          - API_USAGE_STATE
          - TB_RESOURCE
          - OTA_PACKAGE
          - EDGE
          - RPC
          - QUEUE
          - NOTIFICATION_TARGET
          - NOTIFICATION_TEMPLATE
          - NOTIFICATION_REQUEST
          - NOTIFICATION
          - NOTIFICATION_RULE
          - QUEUE_STATS
          - OAUTH2_CLIENT
          - DOMAIN
          - MOBILE_APP
          - MOBILE_APP_BUNDLE
          - CALCULATED_FIELD
          - JOB
          - ADMIN_SETTINGS
          - AI_MODEL
          - API_KEY
      - name: externalEntityUuid
        in: path
        description: A string value representing external entity id
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntityDataInfo'
  /api/entities/vc/entity/{versionId}:
    get:
      tags:
      - entities-version-control-controller
      summary: List All Entities at Version (listAllEntitiesAtVersion)
      description: "Returns a list of all remote entities available in a specific version. Response type is the same as for listAllEntitiesAtVersion API method. \nReturned entities order will be the same as in the repository.\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: listAllEntitiesAtVersion
      parameters:
      - name: versionId
        in: path
        description: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VersionedEntityInfo'
  /api/entities/vc/entity/{requestId}/status:
    get:
      tags:
      - entities-version-control-controller
      summary: Get Version Load Request Status (getVersionLoadRequestStatus)
      description: "Returns the status of previously made version load request. The structure contains following parameters:\n- `done` - if the request was successfully processed;\n- `result` - a list of load results for each entity type:\n     - `created` - created entities count;\n     - `updated` - updated entities count;\n     - `deleted` - removed entities count.\n- `error` - if an error occurred during processing, error info:\n     - `type` - error type;\n     - `source` - an external id of remote entity;\n     - `target` - if failed to find referenced entity by external id - this external id;\n     - `message` - error message.\n\nAn example of successfully processed request status:\n```json\n{\n  \"done\": true,\n  \"result\": [\n    {\n      \"entityType\": \"DEVICE\",\n      \"created\": 10,\n      \"updated\": 5,\n      \"deleted\": 5\n    },\n     {\n      \"entityType\": \"ASSET\",\n      \"created\": 4,\n      \"updated\": 0,\n      \"deleted\": 8\n    }\n  ]\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: getVersionLoadRequestStatus
      parameters:
      - name: requestId
        in: path
        description: A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionLoadResult'
  /api/entities/vc/entity/{entityType}/{versionId}:
    get:
      tags:
      - entities-version-control-controller
      summary: List Entities at Version (listEntitiesAtVersion)
      description: "Returns a list of remote entities of a specific entity type that are available at a concrete version. \nEach entity item in the result has `externalId` property. Entities order will be the same as in the repository.\n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: listEntitiesAtVersion
      parameters:
      - name: entityType
        in: path
        description: A string value representing the entity type. For example, 'DEVICE'
        required: true
        schema:
          type: string
          enum:
          - TENANT
          - CUSTOMER
          - USER
          - DASHBOARD
          - ASSET
          - DEVICE
          - ALARM
          - RULE_CHAIN
          - RULE_NODE
          - ENTITY_VIEW
          - WIDGETS_BUNDLE
          - WIDGET_TYPE
          - TENANT_PROFILE
          - DEVICE_PROFILE
          - ASSET_PROFILE
          - API_USAGE_STATE
          - TB_RESOURCE
          - OTA_PACKAGE
          - EDGE
          - RPC
          - QUEUE
          - NOTIFICATION_TARGET
          - NOTIFICATION_TEMPLATE
          - NOTIFICATION_REQUEST
          - NOTIFICATION
          - NOTIFICATION_RULE
          - QUEUE_STATS
          - OAUTH2_CLIENT
          - DOMAIN
          - MOBILE_APP
          - MOBILE_APP_BUNDLE
          - CALCULATED_FIELD
          - JOB
          - ADMIN_SETTINGS
          - AI_MODEL
          - API_KEY
      - name: versionId
        in: path
        description: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VersionedEntityInfo'
  /api/entities/vc/diff/{entityType}/{internalEntityUuid}:
    get:
      tags:
      - entities-version-control-controller
      summary: Compare Entity Data to Version (compareEntityDataToVersion)
      description: "Returns an object with current entity data and the one at a specific version. Entity data structure is the same as stored in a repository. \n\nAvailable for users with 'TENANT_ADMIN' authority."
      operationId: compareEntityDataToVersion
      parameters:
      - name: entityType
        in: path
        description: A string value representing the entity type. For example, 'DEVICE'
        required: true
        schema:
          type: string
          enum:
          - TENANT
          - CUSTOMER
          - USER
          - DASHBOARD
          - ASSET
          - DEVICE
          - ALARM
          - RULE_CHAIN
          - RULE_NODE
          - ENTITY_VIEW
          - WIDGETS_BUNDLE
          - WIDGET_TYPE
          - TENANT_PROFILE
          - DEVICE_PROFILE
          - ASSET_PROFILE
          - API_USAGE_STATE
          - TB_RESOURCE
          - OTA_PACKAGE
          - EDGE
          - RPC
          - QUEUE
          - NOTIFICATION_TARGET
          - NOTIFICATION_TEMPLATE
          - NOTIFICATION_REQUEST
          - NOTIFICATION
          - NOTIFICATION_RULE
          - QUEUE_STATS
          - OAUTH2_CLIENT
          - DOMAIN
          - MOBILE_APP
          - MOBILE_APP_BUNDLE
          - CALCULATED_FIELD
          - JOB
          - ADMIN_SETTINGS
          - AI_MODEL
          - API_KEY
      - name: internalEntityUuid
        in: path
        description: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'
        required: true
        schema:
          type: string
          format: uuid
      - name: versionId
        in: query
        description: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntityDataDiff'
  /api/entities/vc/branches:
    get:
      tags:
      - entities-version-control-controller
      summary: List Branches (listBranches)
      description: "Lists branches available in the remote repository. \n\nResponse example: \n```json\n[\n  {\n    \"name\": \"master\",\n    \"default\": true\n  },\n  {\n    \"name\": \"dev\",\n    \"default\": false\n  },\n  {\n    \"name\": \"dev-2\",\n    \"default\": false\n  }\n]\n```"
      operationId: listBranches
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BranchInfo'
components:
  schemas:
    WidgetsBundle:
      type: object
      description: A JSON value representing the Widget Bundle.
      properties:
        id:
          $ref: '#/components/schemas/WidgetsBundleId'
          description: JSON object with the Widget Bundle Id. Specify this field to update the Widget Bundle. Referencing non-existing Widget Bundle Id will cause error. Omit this field to create new Widget Bundle.
        createdTime:
          type: integer
          format: int64
          description: Timestamp of the Widget Bundle creation, in milliseconds
          example: 1609459200000
          readOnly: true
        tenantId:
          $ref: '#/components/schemas/TenantId'
          description: JSON object with Tenant Id.
          readOnly: true
        alias:
          type: string
          description: Unique alias that is used in widget types as a reference widget bundle
          readOnly: true
        title:
          type: string
          description: Title used in search and UI
          readOnly: true
        image:
          type: string
          description: Relative or external image URL. Replaced with image data URL (Base64) in case of relative URL and 'inlineImages' option enabled.
          readOnly: true
        scada:
          type: boolean
          description: Whether widgets bundle contains SCADA symbol widget types.
          readOnly: true
        description:
          type: string
          description: Description
          readOnly: true
        order:
          type: integer
          format: int32
          description: Order
          readOnly: true
        version:
          type: integer
          format: int64
        name:
          type: string
          description: Same as title of the Widget Bundle. Read-only field. Update the 'title' to change the 'name' of the Widget Bundle.
          readOnly: true
    RuleNodeId:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the entity, time-based UUID v1
          example: 784f394c-42b6-435a-983c-b7beff2784f9
        entityType:
          type: string
          description: string
          enum:
          - RULE_NODE
          example: RULE_NODE
      required:
      - entityType
      - id
    EntityRelation:
      type: object
      description: A JSON value representing the relation.
      properties:
        from:
          $ref: '#/components/schemas/EntityId'
          description: JSON object with [from] Entity Id.
        to:
          $ref: '#/components/schemas/EntityId'
          description: JSON object with [to] Entity Id.
        type:
          type: string
          description: String value of relation type.
          example: Contains
          minLength: 1
        typeGroup:
          type: string
          description: Represents the type group of the relation.
          enum:
          - COMMON
          - DASHBOARD
          - RULE_CHAIN
          - RULE_NODE
          - EDGE
          - EDGE_AUTO_ASSIGN_RULE_CHAIN
          example: COMMON
        version:
          type: integer
          format: int64
        additionalInfo:
          $ref: '#/components/schemas/JsonNode'
          description: Additional parameters of the relation
      required:
      - from
      - to
      - type
      - typeGroup
    OutputStrategy: {}
    PageDataEntityVersion:
      type: object
      properties:
        data:
          type: array
          description: Array of the entities
          items:
            $ref: '#/components/schemas/EntityVersion'
          readOnly: true
        totalPages:
          type: integer
          format: int32
          description: Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria
          readOnly: true


# --- truncated at 32 KB (75 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/thingsboard/refs/heads/main/openapi/thingsboard-entities-version-control-controller-api-openapi.yml