---
title: "Create or update Alarm Comment"
method: POST
path: "/api/alarm/{alarmId}/comment"
tags: ["alarm-comment-controller"]
---

# Create or update Alarm Comment

`POST /api/alarm/{alarmId}/comment`

Creates or Updates the Alarm Comment. When creating comment, platform generates Alarm Comment Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Alarm Comment id will be present in the response. Specify existing Alarm Comment id to update the alarm. Referencing non-existing Alarm Comment Id will cause 'Not Found' error. 

 To create new Alarm comment entity it is enough to specify 'comment' json element with 'text' node, for example: {"comment": { "text": "my comment"}}. 

 If comment type is not specified the default value 'OTHER' will be saved. If 'alarmId' or 'userId' specified in body it will be ignored.

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

## Path parameters

- `alarmId` string, required

## Request body

- AlarmComment
  - `alarmId` AlarmId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'ALARM', required — string
  - `userId` UserId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'USER', required — string
  - `type` 'SYSTEM' | 'OTHER' — Defines origination of comment. System type means comment was created by TB. OTHER type means comment was created by user.
  - `comment` unknown
  - `id` AlarmCommentId
    - `id` string, uuid, required — string
  - `createdTime` integer — Timestamp of the alarm comment creation, in milliseconds
  - `name` string — representing comment text

## Response `200`

OK

- AlarmComment
  - `alarmId` AlarmId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'ALARM', required — string
  - `userId` UserId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'USER', required — string
  - `type` 'SYSTEM' | 'OTHER' — Defines origination of comment. System type means comment was created by TB. OTHER type means comment was created by user.
  - `comment` unknown
  - `id` AlarmCommentId
    - `id` string, uuid, required — string
  - `createdTime` integer — Timestamp of the alarm comment creation, in milliseconds
  - `name` string — representing comment text

---

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