Notes TCP API¶
Notes are CRM timeline records displayed inside customer cards, including customers at the LEAD lifecycle stage.
Tasks and calendar events are intentionally separate future modules. Notes are used only for manual notes, system records, and imported CRM timeline records.
The main message body is stored in ast_json. It can be sent as a JSON object, JSON array, or JSON string.
Access Control¶
All notes methods require one of:
SESSION_MANAGERSESSION_ADMINSESSION_DEALERSESSION_CRM_MANAGERSESSION_CRM_ADMIN
Manager access is resolved from the cached staff record. The token is used only as a source of manager id and session type; permissions, brand, desks, and groups are not trusted from the token.
Notes require CRM access and are scoped through their linked entity:
| Permission | Used for |
|---|---|
see_notes |
Read a note and list notes by customer |
set_notes |
Create, update, or archive a note |
del_notes |
Delete a note |
Scope is checked against linked customer_id, linked account login, or note brand. Customer notes must be inside the manager brand / desks scope unless the manager has admin scope or see_all_customers.
Commands¶
MngAddNoteMngUpdateNoteMngDeleteNoteMngArchiveNoteMngGetNoteMngGetNotesByCustomerId
Core Fields¶
| Field | Type | Description |
|---|---|---|
id |
int | Note id |
brand |
string | Brand namespace |
customer_id |
int | Linked customer id |
login |
int | Optional linked trading account login |
manager_id |
int | Responsible manager |
created_by |
int | Creator manager id |
updated_by |
int | Last updater manager id |
type |
int | 0 note, 1 record |
status |
int | 0 active, 1 archive |
source |
int | 0 manual, 1 system, 2 import |
ast_json |
object/array/string | AST message body |
text |
string | Plain preview/search text |
files_json |
object/array/string | Optional files payload |
created_time, updated_time, archive_time |
time_t | Unix timestamps |
import_batch_id, old_id |
string | Import compatibility fields |
meta_json |
string | Optional JSON extension payload |
List Scope¶
Notes are listed through MngGetNotesByCustomerId. This also covers leads because they use a normal customer_id.
The list method supports:
customer_idlimitoffset- optional
likesearch overtext
Rows are returned ordered by created_time DESC, id DESC.