---
title: "Save notification target (saveNotificationTarget)"
method: POST
path: "/api/notification/target"
tags: ["notification-target-controller"]
---

# Save notification target (saveNotificationTarget)

`POST /api/notification/target`

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.

## Request body

- NotificationTarget
  - `id` NotificationTargetId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'NOTIFICATION_TARGET', required — string
  - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `name` string, required
  - `configuration` union, required
    - MicrosoftTeamsNotificationTargetConfig
      - `description` string
      - `type` string, required
      - `webhookUrl` string, required
      - `channelName` string, required
      - `useOldApi` boolean
      - `id` unknown
      - `title` string
      - `email` string
      - `firstName` string
      - `lastName` string
    - PlatformUsersNotificationTargetConfig
      - `description` string
      - `type` string, required
      - `usersFilter` union, required
        - AffectedTenantAdministratorsFilter
          - `type` string, required
        - AffectedUserFilter
          - `type` string, required
        - AllUsersFilter
          - `type` string, required
        - CustomerUsersFilter
          - `type` string, required
          - `customerId` string, uuid, required
        - OriginatorEntityOwnerUsersFilter
          - `type` string, required
        - SystemAdministratorsFilter
          - `type` string, required
        - TenantAdministratorsFilter
          - `type` string, required
          - `tenantsIds` string[]
          - `tenantProfilesIds` string[]
        - UserListFilter
          - `type` string, required
          - `usersIds` string[], required
    - SlackNotificationTargetConfig
      - `description` string
      - `type` string, required
      - `conversationType` 'DIRECT' | 'PUBLIC_CHANNEL' | 'PRIVATE_CHANNEL'
      - `conversation` SlackConversation, required
        - `type` 'DIRECT' | 'PUBLIC_CHANNEL' | 'PRIVATE_CHANNEL', required
        - `id` string, required
        - `name` string, required
        - `wholeName` string
        - `email` string
        - `title` string

## Response `200`

OK

- NotificationTarget
  - `id` NotificationTargetId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'NOTIFICATION_TARGET', required — string
  - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `name` string, required
  - `configuration` union, required
    - MicrosoftTeamsNotificationTargetConfig
      - `description` string
      - `type` string, required
      - `webhookUrl` string, required
      - `channelName` string, required
      - `useOldApi` boolean
      - `id` unknown
      - `title` string
      - `email` string
      - `firstName` string
      - `lastName` string
    - PlatformUsersNotificationTargetConfig
      - `description` string
      - `type` string, required
      - `usersFilter` union, required
        - AffectedTenantAdministratorsFilter
          - `type` string, required
        - AffectedUserFilter
          - `type` string, required
        - AllUsersFilter
          - `type` string, required
        - CustomerUsersFilter
          - `type` string, required
          - `customerId` string, uuid, required
        - OriginatorEntityOwnerUsersFilter
          - `type` string, required
        - SystemAdministratorsFilter
          - `type` string, required
        - TenantAdministratorsFilter
          - `type` string, required
          - `tenantsIds` string[]
          - `tenantProfilesIds` string[]
        - UserListFilter
          - `type` string, required
          - `usersIds` string[], required
    - SlackNotificationTargetConfig
      - `description` string
      - `type` string, required
      - `conversationType` 'DIRECT' | 'PUBLIC_CHANNEL' | 'PRIVATE_CHANNEL'
      - `conversation` SlackConversation, required
        - `type` 'DIRECT' | 'PUBLIC_CHANNEL' | 'PRIVATE_CHANNEL', required
        - `id` string, required
        - `name` string, required
        - `wholeName` string
        - `email` string
        - `title` string

---

[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)
