Add

[POST] .../v1/chatmessage/add

Adds a message to a chat. Use this method to publish a regular, private or system chat message after uploading any required files with ChatMessage/AddFile. The request body is required, chat_id must identify a writable chat and the payload must provide text and/or file_ids; created_date is server-owned and is rejected when sent by the client. Access is scoped to the current request user's chat role or linked entity write permissions and custom author fields require the manage-all chat scope. Missing body, missing chat_id, invalid message type, invalid files, unsupported actions database version, denied write access, closed linked entity restrictions and database failures are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
actions Array of Array of ChatMessageAction Optional Message callback actions used to render inline buttons.
author_entity_id Int64 Optional Message author entity ID.
author_entity_type String Optional Message author entity type. Allowed values: Default, User, ChatBot, Client.
chat_id String Required Chat UUID.
external_message_id String Optional External message ID.
file_ids Array of Int64 Optional File ID array. Either text or file_ids must be specified.
mention_options CommonMentionOptions Optional Mention processing options.
mentions Array of CommonMentionInput Optional Structured user mentions in text.
message_type String Optional Message type: Regular, Private or System. Allowed values: Default, Regular, System, Private.
replay_text String Optional Text of the message being replied to. If omitted and reply_id is specified, the server fills it from the source message.
reply_id String Optional UUID of the message being replied to.
text String Optional Message text. Either text or file_ids must be specified.

Request Example

{
  "chat_id": "8cdd646d-dbd0-45c0-8f5b-d90a9b000001",
  "message_type": "Regular",
  "text": "Please review the supplier invoice.",
  "file_ids": [
    321
  ],
  "external_message_id": "external-message-1001"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert_uuid Created UUID record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": "4b9727ec-a389-4274-95b6-069350000001"
  }
}