Skip to main content

REST API

The Advanced Reports extension for Magento 2 exposes its reports, dashboards, email notifications and Config Builder configs through the standard Magento REST API. Use it to read report data into another system, such as a BI tool or a spreadsheet, or to manage dashboards, email notifications and configs from a script.

Authentication​

Call the endpoints with a Magento admin token or an integration token, sent as Authorization: Bearer <token>. See the Magento REST API authentication guide for how to get one. Each endpoint needs the same permission in Magento ACL as the matching part of the admin panel: the role of the admin user, or the resources of the integration, must include it (see How to restrict access to a specific report). Each section below names the permission it needs.

note

An integration token works as a bearer token only when Stores -> Configuration -> Services -> OAuth -> Consumer Settings -> Allow OAuth Access Tokens to be used as standalone Bearer tokens is set to Yes.

Filtering, sorting, and pagination​

The list endpoints of boards, email notifications and configs accept the standard Magento searchCriteria query parameter. See Search using REST APIs for its syntax. The list of reports reads only searchCriteria[pageSize] and searchCriteria[currentPage].


Reports - /V1/advanced-reports/reports​

Read and run the reports. Permission: Reports. To run a report, the role also needs that report's own permission under Reports.

MethodEndpointDescription
GET/V1/advanced-reports/reportsList the reports, with their columns, toolbar and chart settings
GET/V1/advanced-reports/reports/:identifierGet a single report
POST/V1/advanced-reports/reports/:identifier/executeRun a report and return its rows. See Run a report

Custom reports - /V1/advanced-reports/custom-reports​

Create and change reports, as in the Report builder. Permission: Changing Reports. Saving an SQL statement also needs Authoring SQL Reports, and turning sharing on or off needs Sharing Reports.

MethodEndpointDescription
POST/V1/advanced-reports/custom-reportsCreate a report from a report object
PUT/V1/advanced-reports/custom-reports/:reportIdUpdate a report. Only the parts sent are written
POST/V1/advanced-reports/custom-reports/:identifier/duplicateCopy a report. Takes an optional name
DELETE/V1/advanced-reports/custom-reports/:reportIdDelete a custom report

Dashboards - /V1/advanced-reports/boards​

Manage the dashboard boards and their widgets. Permission: Dashboards to read and run, Changing Dashboards to create, update and delete. With an admin token, the shared boards and the admin's own private boards are available.

MethodEndpointDescription
GET/V1/advanced-reports/boardsList the boards, with their blocks (supports searchCriteria)
GET/V1/advanced-reports/boards/:boardIdGet a single board
POST/V1/advanced-reports/boardsCreate a board from a board object
PUT/V1/advanced-reports/boards/:boardIdUpdate a board
DELETE/V1/advanced-reports/boards/:boardIdDelete a board
POST/V1/advanced-reports/boards/:boardId/blocksAdd a block from a block object, and return the board
PUT/V1/advanced-reports/boards/:boardId/blocks/:blockIdentifierUpdate a block, and return the board
DELETE/V1/advanced-reports/boards/:boardId/blocks/:blockIdentifierRemove a block, and return the board
POST/V1/advanced-reports/boards/:boardId/blocks/:blockIdentifier/executeRun a block as it is saved on the board, and return its rows. Takes no body

Email notifications - /V1/advanced-reports/email​

Manage the email notifications. Permission: Email Notifications.

MethodEndpointDescription
GET/V1/advanced-reports/emailsList the email notifications (supports searchCriteria)
GET/V1/advanced-reports/email/:emailIdGet a single email notification
POST/V1/advanced-reports/emailCreate an email notification from an email object
PUT/V1/advanced-reports/email/:emailIdUpdate an email notification. Only the fields sent are written
DELETE/V1/advanced-reports/email/:emailIdDelete an email notification
POST/V1/advanced-reports/email/:emailId/sendSend the email now. Takes an optional recipientEmail to send it to that address instead

An email's schedule is a cron expression with five fields, for example 0 8 * * 1. Each item of blocks names a report by its identifier, or a dashboard block as <board identifier>:<block identifier>, with a time_range and a limit. Like in the admin panel, an email may hold only the reports and boards the role may see.


Config Builder - /V1/advanced-reports/schema-configs​

Read the report schema and manage the Config Builder configs. Permission: Config Builder.

MethodEndpointDescription
GET/V1/advanced-reports/schemaList the datasets, with their columns. Use it to find column identifiers for Run a report
GET/V1/advanced-reports/schema-configsList the configs (supports searchCriteria)
GET/V1/advanced-reports/schema-configs/:configIdGet a single config
POST/V1/advanced-reports/schema-configsCreate a config from a config object, whose config field holds the JSON as a string
PUT/V1/advanced-reports/schema-configs/:configIdUpdate a config
DELETE/V1/advanced-reports/schema-configs/:configIdDelete a config

Run a report​

POST /V1/advanced-reports/reports/:identifier/execute runs a report as it is saved. Every field of the body is optional:

ParameterDescriptionTypeRequired
timeRangeThe period, such as today, yesterday, last7Days, last30Days, last90Days, last365days, week, month, quarter, year, prev_week, prev_month, prev_year or lifetime. Defaults to lifetime.stringNo
dateFromThe start of a period of your own, as YYYY-MM-DD. When given together with dateTo, replaces timeRange.stringNo
dateToThe end of a period of your own, as YYYY-MM-DD.stringNo
columnsThe columns to return, replacing the report's own. Find the identifiers with GET /V1/advanced-reports/schema, for example sales_order.created_at__month.string[]No
filtersConditions added to the report's own, each with column, condition_type (such as eq, neq, gt, lt, in, like) and value.object[]No
sortOrdersThe order of the rows, each with column and direction.object[]No
pageSizeThe number of rows on a page.intNo
currentPageThe page to return.intNo
parametersFor an SQL report, the values of its parameters, each with name and value.object[]No

For example, completed orders by month over the last 365 days:

curl -X POST "https://example.com/rest/V1/advanced-reports/reports/order_overview/execute" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"timeRange": "last365days",
"columns": ["sales_order.created_at__month", "sales_order.orders_count", "sales_order.grand_total"],
"filters": [{"column": "sales_order.status", "condition_type": "in", "value": ["complete"]}],
"sortOrders": [{"column": "sales_order.created_at__month", "direction": "desc"}],
"pageSize": 3
}'

The answer holds:

  • columns: each column's name, label, and type (such as text, number or money);
  • items: the rows, each with data (raw values) and formatted_data (values as the report shows them), listed in the order of columns;
  • totals: the totals row, in the same shape;
  • size: the number of rows in all pages;
  • request: the request as the report read it.

Shortened, the answer looks like this:

{
"columns": [
{"name": "sales_order.created_at__month", "value_type": "date", "label": "Month", "type": "text"},
{"name": "sales_order.orders_count", "value_type": "number", "label": "Orders", "type": "number"},
{"name": "sales_order.grand_total", "value_type": "money", "label": "Grand Total", "type": "money"}
],
"size": 13,
"items": [
{"data": ["2026-11-01 00:00:00", "83", "21062.60000000"], "formatted_data": ["Nov, 2026", "83", "$21,062.60"]}
],
"totals": {"data": [null, 2299, 588033.67], "formatted_data": [null, "2299", "$588,033.67"]}
}

A period that does not exist returns HTTP 400 with the list of valid ones.