Queries
analyticsCatalogEntities— What analytics reports can be about with the store’s Redo products: each entity a report can have one row per. UseanalyticsCatalogEntityDetailsto see what a report on one can show, andanalyticsCatalogSearchto find where a metric lives.analyticsCatalogEntityDetails— The fields, metrics, filters and relationships of catalog entities, to see what a report can show before asking for one.analyticsCatalogSearch— Search the analytics catalog by name, synonym or value, one result per term. Use it to check whether something can be reported on before asking for a report.analyticsReport— Fetch an analytics report by its id. Null when no such report exists or it belongs to another store.analyticsReportExport— An export fromanalyticsReportExportStart. Null when no such export exists for this store.analyticsReportRows— Read an analytics report’s rows. The first page runs the report once and saves the result for about a day; later pages, paged with the cursors it returns, read that saved result without running the report again, so they stay consistent even if the report is edited meanwhile. Pages hold up to 500 rows (100 by default), and only the first 100000 rows can be paged: use analyticsReportExportStart for more. A request may read at most 4 pages. An agent should not page through more than about 1,000 rows; edit the report to aggregate, or export it, instead. Null when the report does not exist or belongs to another store. Throws REPORT_NOT_READY (409) while the report is PREPARING or FAILED, RESULT_EXPIRED (410) once a cursor’s saved result has expired, and INVALID_CURSOR or EXPORT_REQUIRED (400).analyticsReports— List the store’s analytics reports, newest first.
Mutations
analyticsReportCreateFromPlan— Save a report fromanalyticsReportPlanwithout planning it again. Null when the plan is unknown or was made by another user or store.analyticsReportDelete— Delete a report, its versions and its schedule. Returns true if an owned report was deleted, false if none matched. Throws REPORT_NOT_READY (409) while the report is PREPARING.analyticsReportDuplicate— Copy a READY report into a new one. Returns the copy, or null when the report does not exist. Throws REPORT_NOT_READY (409) until the report is READY, and STALE_REPORT (409) when it changed while being copied; retry.analyticsReportEdit— Change what a report calculates by describing the change in plain English, such asadd a column for refund amountoronly last quarter. Saves a new version. Takes 10 to 30 seconds. Null when the report does not exist. Throws ANALYTICS_REPORT_EDIT_NOT_POSSIBLE (400), with the reasons in the message, when the change can’t be made as asked, and REPORT_NOT_READY (409) while the report is PREPARING.analyticsReportExportStart— Write every row of a READY report to a CSV in the background. Returns the export while it is RUNNING; pollanalyticsReportExportfor the download link. The file is kept for 24 hours after the export starts. Null when the report does not exist. Throws REPORT_NOT_READY (409) until the report is READY.analyticsReportGenerate— Ask a question and have Redo build a report for it in the background. Returns the report while it is PREPARING; pollanalyticsReportuntil it is READY (usually 10 to 30 seconds) or FAILED. To see what would be built first, useanalyticsReportPlan.analyticsReportPlan— See what report Redo would build for a question, and whether it can be built as asked, without saving one. Also answers whether something can be reported on at all. Takes 10 to 30 seconds.analyticsReportRevisionRestore— Restore a saved version of a report from itsrevisions. Saves the restored version as a new one, so nothing is lost. Null when the report does not exist. Throws REVISION_NOT_FOUND (404) when it has no version with that number.analyticsReportScheduleRemove— Stop delivering a report on a schedule. Null when the report does not exist.analyticsReportScheduleSet— Deliver a report on a schedule by email, SFTP or both, replacing any schedule it has. Deliveries run in the report’s timezone. Null when the report does not exist. Throws INVALID_SCHEDULE (400) for a bad cadence, cron or email address, REPORT_NOT_READY (409) until the report is READY, and STALE_REPORT (409) when its schedule changed meanwhile; read the report again and retry.analyticsReportUpdate— Change a report’s title, timezone, columns or sorting, and save a new version. Null when the report does not exist. Throws STALE_REPORT (409) whenexpectedUpdatedAtis out of date.
Objects
AnalyticsCatalogDefinition— A calculation Redo defines on an entity: a metric to summarize, or a filter to apply.AnalyticsCatalogEntity— Something an analytics report can have one row per, such as returns or orders.AnalyticsCatalogEntityDetail— An entity with everything a report on it can use.AnalyticsCatalogEntityDetails— The entities asked for, and the names that could not be used.AnalyticsCatalogField— A value a report can show, group by, or filter on.AnalyticsCatalogMatch— Something in the analytics catalog that matches a search term.AnalyticsCatalogRelationship— How another entity relates to this one.AnalyticsReport— An analytics report: a question answered as a table, with columns, filters and sorting. Read its rows withanalyticsReportRows, or export them all withanalyticsReportExportStart.AnalyticsReportCadence— When a scheduled report is delivered, in the report’s timezone.AnalyticsReportColumn— A report column and how it is calculated, written for a reader rather than as SQL.AnalyticsReportDefinition— What a report shows and how: its columns with their calculations, its filters, sorting and row limit.AnalyticsReportExport— A CSV of every row of an analytics report, written in the background and kept for 24 hours after the export starts. Use it for more rows thananalyticsReportRowsshould page.AnalyticsReportFilterDescription— A filter a report or column applies, in plain English.AnalyticsReportPlan— What Redo would build for a question, without saving a report. PassplanIdtoanalyticsReportCreateFromPlanto save it.AnalyticsReportResultColumn— A column of a report’s rows, in the orderAnalyticsReportRow.valueslists them.AnalyticsReportRevision— A saved version of a report. Restore one withanalyticsReportRevisionRestore.AnalyticsReportRow— One row of an analytics report.AnalyticsReportSchedule— When and where a report is delivered on a schedule.AnalyticsReportSort— One column a report is sorted by.
Input objects
AnalyticsReportCadenceInput— When a report is delivered, in the report’s timezone. WEEKLY needsdayOfWeek; MONTHLY needsdayOfMonth.AnalyticsReportColumnInput— A column to keep, and optionally a new header for it.AnalyticsReportScheduleInput— When and where to deliver a report. GivecadenceorcronExpression, and at least one ofemailRecipientsorsftpDelivery.AnalyticsReportSortInput— A column to sort by.UpdateAnalyticsReportInput— Changes to a report’s settings. Omit a field to leave it unchanged. To change what the report calculates, useanalyticsReportEdit.
Enums
AnalyticsCatalogMatchKind— What a catalog search match is.AnalyticsReportColumnKind— What a column holds, and so how its values are written inAnalyticsReportRow.values.AnalyticsReportExportStatus— Where an analytics report export stands.AnalyticsReportFailureCode— Why an analytics report failed.AnalyticsReportFrequency— How often a scheduled analytics report is delivered.AnalyticsReportPlanStatus— Whether a planned report can be made as asked.AnalyticsReportSortKey— A field this list can be ordered by; pass to the list’sorderByargument and pair withreverseto flip direction.AnalyticsReportStatus— Where an analytics report stands.AnalyticsReportWeekday— A day of the week.AnalyticsSortDirection— The direction an analytics report column is sorted in.