---
title: "Save an internal comment on a contact"
description: "Requires a signed-in session (Authorization Bearer) and current membership of the workspace in X-Workspace-Id. Any member may comment on any contact in that workspace. The server builds the row: only body, contact, msg_type (comment or note), user_name and a client UUID are taken from the request; direction, internal flag and time are set by the server, and the verified author is stored in metadata.author_user_id (user_id stays empty so reports do not count comments as agent messages). A client id is used once: re-sending it within 24 hours by the same author for the same contact returns the first row; any other reuse, in any workspace, is 409. Mentioned users who are not current members are dropped.\n"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › LiveChat

`POST /api/livechat2/save-comment`

Requires a signed-in session (Authorization Bearer) and current membership of the workspace in X-Workspace-Id. Any member may comment on any contact in that workspace. The server builds the row: only body, contact, msg_type (comment or note), user_name and a client UUID are taken from the request; direction, internal flag and time are set by the server, and the verified author is stored in metadata.author_user_id (user_id stays empty so reports do not count comments as agent messages). A client id is used once: re-sending it within 24 hours by the same author for the same contact returns the first row; any other reuse, in any workspace, is 409. Mentioned users who are not current members are dropped.

## Authentication

- `bearerAuth`

## Header parameters

- `X-Workspace-Id` (`post/api/livechat2/save-comment.header.X-Workspace-Id`; string, required)

## Request body

_Required._

- `message` (`post/api/livechat2/save-comment.message`; object, required)
  - `contact_id` (`post/api/livechat2/save-comment.message.contact_id`; string, required)
    - format `uuid`
  - `workspace_id` (`post/api/livechat2/save-comment.message.workspace_id`; string, required)
  - `body` (`post/api/livechat2/save-comment.message.body`; string, required)
    - maxLength 10000
  - `id` (`post/api/livechat2/save-comment.message.id`; string, optional)
    - format `uuid`
  - `msg_type` (`post/api/livechat2/save-comment.message.msg_type`; string, optional)
    - one of `"comment"`, `"note"`
  - `user_name` (`post/api/livechat2/save-comment.message.user_name`; string, optional)
    - maxLength 200
- `mentionedUsers` (`post/api/livechat2/save-comment.mentionedUsers`; array<string>, optional)
  - format `uuid`

## Example request

```json
{
  "message": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "contact_id": "f245e2a3-e141-4d41-912c-b1c1f5bd5598",
    "workspace_id": "string",
    "body": "string",
    "msg_type": "comment",
    "user_name": "string"
  },
  "mentionedUsers": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/livechat2/save-comment \
  --header 'Content-Type: application/json' \
  --header 'X-Workspace-Id: string' \
  --data '
{
  "message": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "contact_id": "f245e2a3-e141-4d41-912c-b1c1f5bd5598",
    "workspace_id": "string",
    "body": "string",
    "msg_type": "comment",
    "user_name": "string"
  },
  "mentionedUsers": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/livechat2/save-comment';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'X-Workspace-Id': 'string'},
  body: JSON.stringify({
    message: {
      id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
      contact_id: 'f245e2a3-e141-4d41-912c-b1c1f5bd5598',
      workspace_id: 'string',
      body: 'string',
      msg_type: 'comment',
      user_name: 'string'
    },
    mentionedUsers: ['497f6eca-6276-4993-bfeb-53cbbbba6f08']
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/livechat2/save-comment"

payload = {
    "message": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "contact_id": "f245e2a3-e141-4d41-912c-b1c1f5bd5598",
        "workspace_id": "string",
        "body": "string",
        "msg_type": "comment",
        "user_name": "string"
    },
    "mentionedUsers": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"]
}
headers = {
    "Content-Type": "application/json",
    "X-Workspace-Id": "string"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

{ data: [row], mentionsRecorded } — mentionsRecorded is false only when mentions could not be recorded, so no mention emails will send. Re-sending the same id returns the first row, and records its mentions if none were recorded yet.

### 400

Missing or invalid fields

### 401

No valid signed-in session

### 403

Not a member of the workspace

### 404

The contact is not in this workspace

### 409

The id is already used (by another comment

### 503

Identity or membership verification unavailable


Source: https://developer.channelautomations.com/api/post-api-livechat2-save-comment/index.md
