openapi: 3.2.0 info: title: ThingsBoard REST Notification Target Controller API description: ThingsBoard open-source IoT platform REST API documentation. contact: name: ThingsBoard team url: https://thingsboard.io email: info@thingsboard.io license: name: Apache License Version 2.0 url: https://github.com/thingsboard/thingsboard/blob/master/LICENSE version: 3.7.0 servers: - url: https://vista.viridiparente.com description: Generated server url tags: - name: notification-target-controller paths: /api/notification/target: post: tags: - notification-target-controller summary: Save notification target (saveNotificationTarget) description: 'Creates or updates notification target. Available `configuration` types are `PLATFORM_USERS` and `SLACK`. For `PLATFORM_USERS` the `usersFilter` must be specified. For tenant, there are following users filter types available: `USER_LIST`, `CUSTOMER_USERS`, `TENANT_ADMINISTRATORS`, `ALL_USERS`, `ORIGINATOR_ENTITY_OWNER_USERS`, `AFFECTED_USER`. For sysadmin: `TENANT_ADMINISTRATORS`, `AFFECTED_TENANT_ADMINISTRATORS`, `SYSTEM_ADMINISTRATORS`, `ALL_USERS`. Here is an example of tenant-level notification target to send notification to customer''s users: ```json { "name": "Users of Customer A", "configuration": { "type": "PLATFORM_USERS", "usersFilter": { "type": "CUSTOMER_USERS", "customerId": "32499a20-d785-11ed-a06c-21dd57dd88ca" }, "description": "Users of Customer A" } } ``` Available for users with ''SYS_ADMIN'' or ''TENANT_ADMIN'' authority.' operationId: saveNotificationTarget requestBody: content: application/json: schema: $ref: '#/components/schemas/NotificationTarget' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/NotificationTarget' /api/notification/target/recipients: post: tags: - notification-target-controller summary: Get recipients for notification target config… description: 'Returns the page of recipients for such notification target configuration. Available for users with ''SYS_ADMIN'' or ''TENANT_ADMIN'' authority.' operationId: getRecipientsForNotificationTargetConfig 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 requestBody: content: application/json: schema: $ref: '#/components/schemas/NotificationTarget' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PageDataUser' /api/notification/targets: get: tags: - notification-target-controller summary: Get notification targets by ids (getNotificationTargetsByIds) description: 'Returns the list of notification targets found by provided ids. Available for users with ''SYS_ADMIN'' or ''TENANT_ADMIN'' authority.' operationId: getNotificationTargets_1_1 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' filed based on the target'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 - name: notificationType in: query required: false schema: type: string enum: - GENERAL - ALARM - DEVICE_ACTIVITY - ENTITY_ACTION - ALARM_COMMENT - RULE_ENGINE_COMPONENT_LIFECYCLE_EVENT - ALARM_ASSIGNMENT - NEW_PLATFORM_VERSION - ENTITIES_LIMIT - API_USAGE_LIMIT - RULE_NODE - RATE_LIMITS - EDGE_CONNECTION - EDGE_COMMUNICATION_FAILURE - TASK_PROCESSING_FAILURE - name: ids in: query description: Comma-separated list of uuids representing targets ids required: true schema: items: {} responses: '200': description: OK content: application/json: schema: oneOf: - type: array items: $ref: '#/components/schemas/NotificationTarget' - $ref: '#/components/schemas/PageDataNotificationTarget' /api/notification/target/{id}: get: tags: - notification-target-controller summary: Get notification target by id (getNotificationTargetById) description: 'Fetches notification target by id. Available for users with ''SYS_ADMIN'' or ''TENANT_ADMIN'' authority.' operationId: getNotificationTargetById parameters: - name: id in: path required: true schema: type: string format: uuid responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/NotificationTarget' delete: tags: - notification-target-controller summary: Delete notification target by id (deleteNotificationTargetById) description: 'Deletes notification target by its id. This target cannot be referenced by existing scheduled notification requests or any notification rules. Available for users with ''SYS_ADMIN'' or ''TENANT_ADMIN'' authority.' operationId: deleteNotificationTargetById parameters: - name: id in: path required: true schema: type: string format: uuid responses: '200': description: OK components: schemas: PageDataNotificationTarget: properties: data: type: array description: Array of the entities items: $ref: '#/components/schemas/NotificationTarget' 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 SlackConversation: properties: type: type: string enum: - DIRECT - PUBLIC_CHANNEL - PRIVATE_CHANNEL id: type: string name: type: string wholeName: type: string email: type: string title: type: string required: - id - name - type SlackNotificationTargetConfig: allOf: - $ref: '#/components/schemas/NotificationTargetConfig' - type: object properties: conversationType: type: string enum: - DIRECT - PUBLIC_CHANNEL - PRIVATE_CHANNEL conversation: $ref: '#/components/schemas/SlackConversation' required: - conversation NotificationTargetConfig: discriminator: propertyName: type properties: description: type: string type: type: string required: - type User: description: A JSON value representing the User. properties: id: $ref: '#/components/schemas/UserId' description: JSON object with the User Id. Specify this field to update the device. Referencing non-existing User Id will cause error. Omit this field to create new customer. createdTime: type: integer format: int64 description: Timestamp of the user creation, in milliseconds example: 1609459200000 readOnly: true tenantId: $ref: '#/components/schemas/TenantId' description: JSON object with the Tenant Id. readOnly: true customerId: $ref: '#/components/schemas/CustomerId' description: JSON object with the Customer Id. readOnly: true roleId: $ref: '#/components/schemas/RoleId' email: type: string description: Email of the user example: user@example.com authority: type: string description: Authority enum: - SYS_ADMIN - TENANT_ADMIN - CUSTOMER_USER - REFRESH_TOKEN - PRE_VERIFICATION_TOKEN example: SYS_ADMIN, TENANT_ADMIN or CUSTOMER_USER firstName: type: string description: First name of the user example: John lastName: type: string description: Last name of the user example: Doe phone: type: string description: Phone number of the user example: 38012345123 name: type: string description: Duplicates the email of the user, readonly example: user@example.com readOnly: true additionalInfo: $ref: '#/components/schemas/JsonNode' description: Additional parameters of the user required: - authority - email UsersFilter: discriminator: propertyName: type properties: type: type: string required: - type PlatformUsersNotificationTargetConfig: allOf: - $ref: '#/components/schemas/NotificationTargetConfig' - type: object properties: usersFilter: $ref: '#/components/schemas/UsersFilter' required: - usersFilter NotificationTargetId: 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: - NOTIFICATION_TARGET example: NOTIFICATION_TARGET required: - entityType - id UserId: 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: - USER example: USER required: - entityType - id RoleId: 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 - ROLE - 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 example: DEVICE required: - entityType - id PageDataUser: properties: data: type: array description: Array of the entities items: $ref: '#/components/schemas/User' 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 CustomerId: 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: - CUSTOMER example: CUSTOMER required: - entityType - id NotificationTarget: properties: id: $ref: '#/components/schemas/NotificationTargetId' createdTime: type: integer format: int64 tenantId: $ref: '#/components/schemas/TenantId' name: type: string configuration: oneOf: - $ref: '#/components/schemas/MicrosoftTeamsNotificationTargetConfig' - $ref: '#/components/schemas/PlatformUsersNotificationTargetConfig' - $ref: '#/components/schemas/SlackNotificationTargetConfig' required: - configuration - name MicrosoftTeamsNotificationTargetConfig: allOf: - $ref: '#/components/schemas/NotificationTargetConfig' - type: object properties: webhookUrl: type: string channelName: type: string title: type: string id: {} email: type: string firstName: type: string lastName: type: string required: - channelName - webhookUrl TenantId: 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 JsonNode: description: A value representing the any type (object or primitive) examples: - {} securitySchemes: HTTP_login_form: type: http description: Enter Username / Password scheme: loginPassword bearerFormat: /api/auth/login|X-Authorization