---
title: "Create Or Update Widget Type (saveWidgetType)"
method: POST
path: "/api/widgetType"
tags: ["widget-type-controller"]
---

# Create Or Update Widget Type (saveWidgetType)

`POST /api/widgetType`

Create or update the Widget Type. Widget Type represents the template for widget creation. Widget Type and Widget are similar to class and object in OOP theory. When creating the Widget Type, platform generates Widget Type Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Widget Type Id will be present in the response. Specify existing Widget Type id to update the Widget Type. Referencing non-existing Widget Type Id will cause 'Not Found' error.

Widget Type fqn is unique in the scope of System or Tenant. Special Tenant Id '13814000-1dd2-11b2-8080-808080808080' is automatically used if the create request is sent by user with 'SYS_ADMIN' authority.Remove 'id', 'tenantId' rom the request body example (below) to create new Widget Type entity.

Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.

## Query parameters

- `updateExistingByFqn` boolean

## Request body

- WidgetTypeDetails — A JSON value representing the Widget Type Details.
  - `fqn` string — Unique FQN that is used in dashboards as a reference widget type
  - `name` string — Widget name used in search and UI
  - `deprecated` boolean — Whether widget type is deprecated.
  - `image` string — Relative or external image URL. Replaced with image data URL (Base64) in case of relative URL and 'inlineImages' option enabled.
  - `description` string — Description of the widget
  - `descriptor` unknown
  - `resources` ResourceExportData[]
    - `link` string
    - `title` string
    - `type` 'LWM2M_MODEL' | 'JKS' | 'PKCS_12' | 'JS_MODULE' | 'IMAGE' | 'DASHBOARD' | 'GENERAL'
    - `subType` 'IMAGE' | 'SCADA_SYMBOL' | 'EXTENSION' | 'MODULE'
    - `resourceKey` string
    - `fileName` string
    - `publicResourceKey` string
    - `isPublic` boolean
    - `mediaType` string
    - `data` string
    - `public` boolean
  - `id` WidgetTypeId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'WIDGET_TYPE', required — string
  - `createdTime` integer — Timestamp of the Widget Type creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `scada` boolean — Whether widget type is SCADA symbol.
  - `version` integer
  - `tags` string[] — Tags of the widget type

## Response `200`

OK

- WidgetTypeDetails — A JSON value representing the Widget Type Details.
  - `fqn` string — Unique FQN that is used in dashboards as a reference widget type
  - `name` string — Widget name used in search and UI
  - `deprecated` boolean — Whether widget type is deprecated.
  - `image` string — Relative or external image URL. Replaced with image data URL (Base64) in case of relative URL and 'inlineImages' option enabled.
  - `description` string — Description of the widget
  - `descriptor` unknown
  - `resources` ResourceExportData[]
    - `link` string
    - `title` string
    - `type` 'LWM2M_MODEL' | 'JKS' | 'PKCS_12' | 'JS_MODULE' | 'IMAGE' | 'DASHBOARD' | 'GENERAL'
    - `subType` 'IMAGE' | 'SCADA_SYMBOL' | 'EXTENSION' | 'MODULE'
    - `resourceKey` string
    - `fileName` string
    - `publicResourceKey` string
    - `isPublic` boolean
    - `mediaType` string
    - `data` string
    - `public` boolean
  - `id` WidgetTypeId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'WIDGET_TYPE', required — string
  - `createdTime` integer — Timestamp of the Widget Type creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `scada` boolean — Whether widget type is SCADA symbol.
  - `version` integer
  - `tags` string[] — Tags of the widget type

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
