Skip to main content

CHAT API Reference

Module Information

Service Files:

  • Private: service/private/chat.js

Available Services: 15 Documented Services: 15


chat.acknowledge

Mark a message as read. Updates message acknowledgment status and notifies the message author via WebSocket that their message has been read.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.acknowledge

Parameters

ParameterTypeRequiredDefaultDescription
message_idstringYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors

Error codes not documented


chat.attachment

Get attachments for a specific message with pagination. Returns media files attached to a message, with 5 items per page. Each attachment includes full file metadata.

PropertyValue
ScopeHub (requires hub context)
PermissionRead (2)

Endpoint:

https://hostname/-/svc/chat.attachment

Parameters

ParameterTypeRequiredDefaultDescription
message_idstringYes--
pageintegerNo1-

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.nidstring-
items.hub_idstring-
items.file_namestring-
items.filesizeinteger-
items.extensionstring-
items.categorystring-
items.privilegeinteger-
items.pageinteger-

Possible Errors

Error codes not documented


chat.chat_rooms

List chat rooms with filtering and pagination. Returns paginated list of chat rooms with optional filtering by tag, keyword, flag, and status (active/archived).

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.chat_rooms

Parameters

ParameterTypeRequiredDefaultDescription
tag_idstringNo""-
pageintegerNo1-
keystringNo""-
flagstringNo""-
optionstringNo"active"-

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.entity_idstring-
items.contact_idstring-
items.firstnamestring-
items.lastnamestring-
items.last_messagestring-
items.unread_countinteger-
items.last_activityinteger-

Possible Errors

Error codes not documented


chat.chat_room_info

Get detailed information about a specific chat room. Returns complete metadata and current status of a chat room identified by key.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.chat_room_info

Parameters

ParameterTypeRequiredDefaultDescription
keystringYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors

Error codes not documented


chat.change_status

Change chat room status (archive or unarchive). Archives or restores a chat conversation. Triggers WebSocket notification to update UI across all user sessions.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.change_status

Parameters

ParameterTypeRequiredDefaultDescription
entity_idstringYes--
statusstringYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors

Error CodeHTTP StatusDescription
INVALID_STATUS0-Status must be 'archived' or 'active'

chat.contact_rooms

List chat rooms filtered by contacts. Returns chat rooms specifically for direct contact conversations (not group chats), with optional tag and keyword filtering.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.contact_rooms

Parameters

ParameterTypeRequiredDefaultDescription
tag_idstringNo""-
pageintegerNo1-
keystringNo""-

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.entity_idstring-
items.contact_idstring-
items.firstnamestring-
items.lastnamestring-
items.last_messagestring-
items.unread_countinteger-

Possible Errors

Error codes not documented


chat.count_all

Get total unread message count across all chat rooms. Returns aggregate count of unread messages from all conversations.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.count_all

Parameters

No parameters

Returns

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors

Error codes not documented


chat.delete

Delete messages from chat. Can delete for self only ('me') or for both parties ('all'). Removes message content and attachments. Option 'all' requires user to be the message author.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.delete

Parameters

ParameterTypeRequiredDefaultDescription
optionstringYes--
messagesarray<string>Yes--

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.message_idstring-
items.entity_idstring-
items.delete_statusstring-

Possible Errors

Error CodeHTTP StatusDescription
INVALID_OPTION-Option must be 'me' or 'all'
INVALID_MESSAGES-One or more message IDs do not exist
INVALID_OPTION-Cannot delete 'all' - user is not the message author

chat.forward

Forward messages to multiple recipients. Takes existing messages and sends copies to specified entities. Preserves original message content and attachments. Supports bulk forwarding.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.forward

Parameters

ParameterTypeRequiredDefaultDescription
entitiesarray<string>Yes--
nodesobjectYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.message_idstring-
items.entity_idstring-
items.forward_message_idstring-
items.author_idstring-
items.is_attachmentinteger-

Possible Errors

Error codes not documented


chat.messages

Get paginated message list for a chat conversation. Returns messages with entity info, thread details, and attachment indicators. Automatically marks messages as read and notifies authors via WebSocket.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.messages

Parameters

ParameterTypeRequiredDefaultDescription
entity_idstringYes--
pageintegerNo1-

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.message_idstring-
items.entity_idstring-
items.messagestring-
items.author_idstring-
items.ctimeinteger-
items.is_attachmentinteger-
items.entityobject-
items.threadobject-

Possible Errors

Error codes not documented


chat.post

Send a message in a chat. Creates and delivers a message to a contact with optional attachments and thread reply. Validates contact, attachments, and thread. Moves attachments to permanent storage and distributes message to both parties via WebSocket.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.post

Parameters

ParameterTypeRequiredDefaultDescription
entity_idstringYes--
messagestringNo""-
thread_idstringNo--
attachmentarray<string>No[]-

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.message_idstring-
items.entity_idstring-
items.messagestring-
items.author_idstring-
items.to_idstring-
items.is_attachmentinteger-
items.entityobject-
items.threadobject-
items.roominteger-
items.totalinteger-
items.echoIdstring-

Possible Errors

Error CodeHTTP StatusDescription
INVALID_CONTACT-Contact does not exist or is invalid
INVALID_ATTACHMENT-One or more attachments are invalid or inaccessible
INVALID_THREAD-Thread ID does not exist

chat.share_rooms

List group/shared chat rooms. Returns chat rooms for group conversations (not direct contact chats), with optional keyword filtering and pagination.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.share_rooms

Parameters

ParameterTypeRequiredDefaultDescription
pageintegerNo1-
keystringNo""-

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.entity_idstring-
items.group_namestring-
items.last_messagestring-
items.unread_countinteger-
items.member_countinteger-

Possible Errors

Error codes not documented


chat.tag_chat_count

Get chat count for a specific tag. Returns the number of chat rooms associated with a contact tag.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.tag_chat_count

Parameters

ParameterTypeRequiredDefaultDescription
tag_idstringYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
itemsobject-
items.tag_idstring-
items.tag_namestring-
items.chat_countinteger-

Possible Errors

Error codes not documented


chat.to_read

Get number of unread message pages for a contact. Returns how many pages of unread messages exist in a conversation. Used for pagination UI indicators.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.to_read

Parameters

ParameterTypeRequiredDefaultDescription
entity_idstringYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors

Error CodeHTTP StatusDescription
INVALID_CONTACT-Contact does not exist or is invalid

chat.upload_remove

Remove an uploaded attachment before sending. Deletes a file from chat upload directory. Only works on files in /chat/upload/ path. File must be owned by user and cannot be a folder or hub.

PropertyValue
ScopeHub (requires hub context)
PermissionWrite (4)

Endpoint:

https://hostname/-/svc/chat.upload_remove

Parameters

ParameterTypeRequiredDefaultDescription
nidstringYes--

Returns

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors

Error CodeHTTP StatusDescription
INVALID_ATTACHMENT-File does not exist
INVALID_ATTACHMENT-File is not in chat upload directory (/chat/upload/)
INVALID_ATTACHMENT-Cannot delete folders or hubs

  • ACL System - Permission model
  • Service Routing - URL patterns
  • Error Handling - Error codes