Skip to content

MngExportJournalByFilter

Exports structured operational Journal records to a CSV or Excel file in the server storage directory. The response returns the generated file name and does not include exported records directly.

The method uses the same filters and record-level ACL as MngGetJournalByFilter. Pagination parameters are not used for export.

Access Control

The action requires a supported manager session, logs permission (except for SuperAdmin), and BackOffice or CRM application access.

Server-side brand, group, desk and domain restrictions are applied to every record before it is written to the export. Client filters cannot expand this scope.

Request Parameters

Name Type Required Description
from int64 Yes Inclusive Unix timestamp in seconds; must be >= 0
to int64 Yes Inclusive Unix timestamp in seconds; must be >= from
format string Yes csv or excel
max_rows int No Positive export limit; values above the format hard limit are capped
direction string No ASC or DESC; default DESC
brand string No Exact brand filter
domain string No Exact Journal domain
action string No Exact action name
status int No 0 accepted, 1 succeeded, 2 rejected, 3 failed
actor_type int No Exact session/actor type
actor_id string No Exact actor identifier
request_id string No Exact correlation identifier
channel string No Exact source channel
entity_type string No Exact entity type
entity_id string No Exact entity identifier
customer_id int No Exact customer id when greater than zero
login int No Exact account login when greater than zero
group string No Exact account group
desk_id int No Exact CRM desk id when greater than zero
search string No Case-insensitive substring search across main text fields

Export Limits

Format Default Hard limit Processing model
CSV 500000 rows 2000000 rows Written as a stream
Excel 50000 rows 50000 rows Rows are accumulated before XLSX generation

Request

{
  "command": "MngExportJournalByFilter",
  "extID": "journal-export-1",
  "data": {
    "from": 1789516800,
    "to": 1789603199,
    "format": "csv",
    "max_rows": 500000,
    "direction": "DESC",
    "brand": "ion4",
    "domain": "trading",
    "status": 2
  }
}

Successful Response

{
  "file_name": "550e8400-e29b-41d4-a716-446655440000.csv",
  "rows": 12450,
  "truncated": false
}

Limit reached:

{
  "file_name": "550e8400-e29b-41d4-a716-446655440000.csv",
  "rows": 500000,
  "truncated": true
}

Response Fields

Name Type Description
file_name string Generated .csv or .xlsx file name in storage/
rows uint64 Number of exported Journal records
truncated bool true when another matching record existed after max_rows

Export Columns

Both formats contain all Journal fields in this order:

schema_version, timestamp, event_id, brand, domain, action, status,
actor_type, actor_id, actor_name, session_id, request_id, channel, ip,
user_agent, device_id, entity_type, entity_id, customer_id, login, group,
desk_id, result_code, changes_json, detail

CSV cells beginning with =, +, -, or @ are prefixed with an apostrophe to prevent spreadsheet formula injection.

Notes

  • Time range boundaries are inclusive and daily files are selected by UTC date.
  • limit and offset are not used by this method; export size is controlled by max_rows.
  • The response contains only a file name, not an absolute path or download URL.
  • Use a narrow time range and specific filters for routine exports.

Errors

HTTP-style status Error Description
400 INVALID_DATA Invalid type, format, direction, row limit, or time range
401/403 permission error Session, application scope, or logs permission is missing
500 EXPORT_CREATE_DIR_ERROR The storage directory could not be created
500 EXPORT_OPEN_FILE_ERROR CSV output file could not be opened
500 EXPORT_WRITE_FILE_ERROR Journal could not be read or the export file could not be written