Export
Export custom client reports
GET /export/customData
GET /export/customData
Export data using custom SQL queries with dynamic parameters. This endpoint allows you to execute pre-configured SQL queries with customizable parameters that replace placeholders in the query.
This endpoint should only be used if standard export endpoints (for tickets, messages, worklog, survey, etc.) do not suffice. It is an adanced feature and every query requires prior approval by your Enneo account manager.
How Parameters Work
- SQL Query Placeholders: Custom exports contain SQL queries with placeholders like
{limit},{offset},{customerId} - Parameter Resolution: Parameters are resolved in this order:
- GET query parameters (highest priority)
- Default values from export configuration
- Required parameters will throw an error if missing
- Security: All parameters are safely bound using prepared statements
Example Custom Export Configuration
{
"label": "Customer Events Report",
"sqlQuery": "SELECT id, type, createdAt FROM event WHERE customerId = {customerId} ORDER BY id DESC LIMIT {limit} OFFSET {offset}",
"parameters": [
{
"key": "customerId",
"label": "Customer ID",
"description": "The customer to export events for",
"defaultValue": null
},
{
"key": "limit",
"label": "Limit",
"description": "Maximum number of records to return",
"defaultValue": "100"
},
{
"key": "offset",
"label": "Offset",
"description": "Number of records to skip",
"defaultValue": "0"
}
]
}Example Usage
GET /api/mind/export/customData?exportId=0&format=json&customerId=12345&limit=50&offset=0This would execute:
SELECT id, type, createdAt FROM event WHERE customerId = ? ORDER BY id DESC LIMIT ? OFFSET ?With parameters: [12345, 50, 0]
Query parameters
formatenumqueryThe format of the export
exportIdintegerqueryThe ID of the export configuration to use. This corresponds to the index in the
customDataExports settings array. If null, the default export as configured
in the customDataExportSelected setting will be used.
{parameterName}stringqueryDynamic parameters that replace placeholders in the SQL query.
Any parameter defined in the export configuration can be overridden via GET parameters. Parameter names should match the placeholders in the SQL query (without the curly braces).
Parameter Resolution Logic:
- If provided as GET parameter → use that value
- If not provided but has default value → use default value
- If not provided and no default → throw error (parameter required)
Common Parameter Examples:
limit=100→ replaces{limit}placeholderoffset=0→ replaces{offset}placeholdercustomerId=12345→ replaces{customerId}placeholderstartDate=2024-01-01→ replaces{startDate}placeholderendDate=2024-12-31→ replaces{endDate}placeholderstatus=active→ replaces{status}placeholderdepartmentId=5→ replaces{departmentId}placeholder
Responses
200 — Successful operation
Response Example
[
{
"id": 1,
"type": "login",
"createdAt": "2024-01-15T10:30:00Z",
"customerId": 12345
},
{
"id": 2,
"type": "purchase",
"createdAt": "2024-01-14T15:45:00Z",
"customerId": 12345
}
]400 — Bad request - required parameter missing or invalid export configuration
403 — Unauthorized
500 — Internal server error