ThingsBoard domain-controller API

Domain

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-domain-controller-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ThingsBoard Admin admin-controller domain-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: domain-controller
  description: Domain
paths:
  /api/domain/{id}/oauth2Clients:
    put:
      tags:
      - domain-controller
      summary: Update Oauth2 Clients (updateOauth2Clients)
      description: 'Update oauth2 clients for the specified domain. '
      operationId: updateOauth2Clients_1
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
                format: uuid
        required: true
      responses:
        '200':
          description: OK
  /api/domain:
    post:
      tags:
      - domain-controller
      summary: Save or Update Domain (saveDomain)
      description: 'Create or update the Domain. When creating domain, platform generates Domain Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Domain Id will be present in the response. Specify existing Domain Id to update the domain. Referencing non-existing Domain Id will cause ''Not Found'' error.


        Domain name is unique for entire platform setup.




        Available for users with ''SYS_ADMIN'' authority.'
      operationId: saveDomain
      parameters:
      - name: oauth2ClientIds
        in: query
        description: A list of oauth2 client registration ids, separated by comma ','
        required: false
        schema:
          type: array
          items:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Domain'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
  /api/domain/infos:
    get:
      tags:
      - domain-controller
      summary: Get Domain Infos (getTenantDomainInfos)
      description: '


        Available for users with ''SYS_ADMIN'' authority.'
      operationId: getTenantDomainInfos
      parameters:
      - 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: Case-insensitive 'substring' filter based on domain's name
        required: false
        schema:
          type: string
      - name: sortProperty
        in: query
        description: Property of entity to sort by
        required: false
        schema:
          type: string
      - name: sortOrder
        in: query
        description: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageDataDomainInfo'
  /api/domain/info/{id}:
    get:
      tags:
      - domain-controller
      summary: Get Domain Info by Id (getDomainInfoById)
      description: '


        Available for users with ''SYS_ADMIN'' authority.'
      operationId: getDomainInfoById
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainInfo'
  /api/domain/{id}:
    delete:
      tags:
      - domain-controller
      summary: Delete Domain by ID (deleteDomain)
      description: 'Deletes Domain by ID. Referencing non-existing domain Id will cause an error.


        Available for users with ''SYS_ADMIN'' authority.'
      operationId: deleteDomain
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
components:
  schemas:
    DomainId:
      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
          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
          example: DEVICE
      required:
      - entityType
      - id
    Domain:
      type: object
      description: A JSON value representing the Domain.
      properties:
        id:
          $ref: '#/components/schemas/DomainId'
        createdTime:
          type: integer
          format: int64
          description: Entity creation timestamp in milliseconds since Unix epoch
          example: 1746028547220
          readOnly: true
        tenantId:
          $ref: '#/components/schemas/TenantId'
          description: JSON object with Tenant Id
        name:
          type: string
          description: Domain name. Cannot be empty
          minLength: 1
        oauth2Enabled:
          type: boolean
          description: Whether OAuth2 settings are enabled or not
        propagateToEdge:
          type: boolean
          description: Whether OAuth2 settings are enabled on Edge or not
      required:
      - name
    PageDataDomainInfo:
      type: object
      properties:
        data:
          type: array
          description: Array of the entities
          items:
            $ref: '#/components/schemas/DomainInfo'
          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
        totalElements:
          type: integer
          format: int64
          description: Total number of elements in all available pages
          readOnly: true
        hasNext:
          type: boolean
          description: '''false'' value indicates the end of the result set'
          readOnly: true
    OAuth2ClientId:
      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
          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
          example: DEVICE
      required:
      - entityType
      - id
    TenantId:
      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:
          - TENANT
          example: TENANT
      required:
      - entityType
      - id
    OAuth2ClientInfo:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OAuth2ClientId'
        createdTime:
          type: integer
          format: int64
          description: Entity creation timestamp in milliseconds since Unix epoch
          example: 1746028547220
          readOnly: true
        title:
          type: string
          description: Oauth2 client registration title (e.g. My google)
        providerName:
          type: string
          description: Oauth2 client provider name (e.g. Google)
        platforms:
          type: array
          description: List of platforms for which usage of the OAuth2 client is allowed (empty for all allowed)
          items:
            type: string
            enum:
            - WEB
            - ANDROID
            - IOS
        name:
          type: string
          readOnly: true
    DomainInfo:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/DomainId'
        createdTime:
          type: integer
          format: int64
          description: Entity creation timestamp in milliseconds since Unix epoch
          example: 1746028547220
          readOnly: true
        tenantId:
          $ref: '#/components/schemas/TenantId'
          description: JSON object with Tenant Id
        name:
          type: string
          description: Domain name. Cannot be empty
          minLength: 1
        oauth2Enabled:
          type: boolean
          description: Whether OAuth2 settings are enabled or not
        propagateToEdge:
          type: boolean
          description: Whether OAuth2 settings are enabled on Edge or not
        oauth2ClientInfos:
          type: array
          description: List of available oauth2 clients
          items:
            $ref: '#/components/schemas/OAuth2ClientInfo'
      required:
      - name
  securitySchemes:
    HTTP login form:
      type: http
      description: Enter Username / Password
      scheme: loginPassword
      bearerFormat: /api/auth/login|X-Authorization
    API key form:
      type: apiKey
      description: 'Enter the API key value with ''ApiKey'' prefix in format: **ApiKey <your_api_key_value>**


        Example: **ApiKey tb_5te51SkLRYpjGrujUGwqkjFvooWBlQpVe2An2Dr3w13wjfxDW**


        <br>**NOTE**: Use only ONE authentication method at a time. If both are authorized, JWT auth takes the priority.<br>

        '
      name: X-Authorization
      in: header