Skip to content

Notes TCP API

Notes are CRM timeline records displayed inside customer and lead cards.

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_MANAGER
  • SESSION_ADMIN
  • SESSION_DEALER
  • SESSION_CRM_MANAGER
  • SESSION_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 or lead
set_notes Create, update, or archive a note
del_notes Delete a note

Scope is checked against linked customer_id, linked lead_id, linked account login, or note brand. Customer and lead notes must be inside the manager brand / desks scope unless the manager has admin scope or see_all_customers.

Commands

  • MngAddNote
  • MngUpdateNote
  • MngDeleteNote
  • MngArchiveNote
  • MngGetNote
  • MngGetNotesByCustomerId
  • MngGetNotesByLeadId

Core Fields

Field Type Description
id int Note id
brand string Brand namespace
customer_id int Linked customer id
lead_id int Optional linked lead 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 can be listed through MngGetNotesByCustomerId or MngGetNotesByLeadId.

The list method supports:

  • customer_id or lead_id
  • limit
  • offset
  • optional like search over text

Rows are returned ordered by created_time DESC, id DESC.