AI-Agent-First Documentation
Prompt your Agent: "Query and mutate records on the 'chat_message' table (ID prefix 'ctme_') using platform.records and platform.query.sql, ensuring all lookup fields use plain string IDs."
Chat Message (chat_message)
Chat messages are the actual content inside each chat. They allow users and contacts to communicate with each other
Python SDK & PlatformContext Example
# 1. Query chat_message via parameterized ANSI SQL
rows = await platform.query.sql("SELECT id, name, created_date FROM chat_message ORDER BY created_date DESC LIMIT 25")
# 2. Create chat_message record (Generates 'ctme_...' Base62 ID)
created = await platform.records.create("chat_message", [
{"name": "Example Chat Message"}
])| Field API Name | Type / Format | Lookup Target | Flags | Description |
|---|---|---|---|---|
| id | string | — | required | Id |
| name | string | — | required | Name |
| created_date | stringdate-time | — | Created Date | |
| modified_date | stringdate-time | — | Modified Date | |
| created_by | stringlookup | → user (string ID) | requiredsystem | Created By |
| modified_by | stringlookup | → user (string ID) | requiredsystem | Modified By |
| chat | stringlookup | → chat (string ID) | required | Chat |
| body | stringmarkdown | — | The message contents that were sent | |
| direction | stringenum | — | required | Direction |
| participant_name | string | — | Participant Name | |
| contact | stringlookup | → contact (string ID) | The contact who sent the message | |
| user | stringlookup | → user (string ID) | The user that sent the message | |
| read | jsonjson | — | The read receipt of each user or contact for the message | |
| shared_with | listsharing | — | system | Shared With |
