Skip to content

Export Accounts By Filter

MngExportAccountsByFilter

Description: Exports account records selected by the same filter model as GetUsersByFilter into a file stored in the server storage directory.

The method does not return account rows in JSON. Instead, it creates a file and returns only its generated name.

The export always contains the full filtered result set.

Access Control

🛡️ Access Level Required: SESSION_MANAGER, SESSION_ADMIN, SESSION_DEALER

Request Parameters

Name Type Required Description
groupFilter string Yes Group mask used to select accounts, for example STD-* or *
format string Yes Output format: csv or excel
where array No Additional filter rules
whereNot array No Negated filter rules
orderBy array No Sort instructions
select array No List of fields to export. If omitted or empty, all default account fields are exported

Supported Filter Keys

  • where: [[field, operator, value], ...]
  • whereNot: [[field, value], ...]

Supported where Operators

  • =
  • ==
  • !=
  • >
  • <
  • >=
  • <=
  • like

Supported select Fields

If select is passed, every item must be one of the fields below. Any unknown field causes 400 INVALID_DATA.

  • login
  • enable
  • enable_read_only
  • enable_change_password
  • leverage
  • currency
  • group
  • email
  • country
  • phone
  • comment
  • address
  • city
  • zipcode
  • name
  • regdate
  • prevbalance
  • prevmonthbalance
  • balance
  • credit
  • margin
  • margin_free
  • margin_level
  • equity
  • online

Request Example

{
  "groupFilter": "STD-*",
  "format": "csv",
  "select": ["login", "group", "currency", "balance", "equity", "online"],
  "where": [
    ["enable", "=", 1]
  ],
  "whereNot": [],
  "orderBy": ["balance", "DESC"]
}

Response Parameters

Name Type Description
file_name string Generated file name stored in storage/

Successful Response Example

{
  "file_name": "550e8400-e29b-41d4-a716-446655440000.csv"
}

Notes

  • format = "csv" generates a .csv file
  • format = "excel" currently generates an Excel-compatible .xls file
  • the response contains only the generated file name with extension
  • the export always contains the full filtered result set
  • limit and offset are not supported by this method

Errors

Code Description
400 Invalid request payload or unsupported field in select
500 Export directory creation or file write failed