Mode Reports API
The Reports API from Mode — 27 operation(s) for reports.
The Reports API from Mode — 27 operation(s) for reports.
swagger: '2.0'
info:
version: 0.0.1
title: Mode Account Reports API
description: 'Mode provides a REST API for many common operations, such as:
* Listing spaces and reports
* Running reports
* Downloading query results
## Authentication
For most Mode API calls, the client must supply an API token and secret for
HTTP basic authentication.
If authentication is required for a given resource, unauthenticated requests
will result in a `401 Unauthorized` response.
[Create and Manage API Tokens](https://modeanalytics.com/settings/access_tokens)
'
termsOfService: https://mode.com/tos/
contact:
name: Mode API Team
email: support@modeanalytics.com
license:
name: MIT
host: modeanalytics.com
basePath: /api
schemes:
- https
consumes:
- application/json
produces:
- application/hal+json
security:
- accessTokenAuth: []
tags:
- name: Reports
paths:
/{account}/reports/{report}/queries/{query}/charts:
x-summary: Charts
get:
operationId: listChartsInQuery
summary: List Charts for a Query
description: Returns all `Chart`s for a `Query`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Chart` collection response'
schema:
$ref: '#/definitions/QueryCharts'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: query
in: path
description: '`Query` token'
required: true
type: string
tags:
- Reports
/{account}/reports/{report}/queries/{query}/charts/{chart}:
x-summary: Chart
get:
operationId: getChart
summary: Get a chart
description: Returns a representation of a single `Chart`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Chart` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Chart` response'
schema:
$ref: '#/definitions/Chart'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: query
in: path
description: '`Query` token'
required: true
type: string
- name: chart
in: path
description: '`Chart` token'
required: true
type: string
tags:
- Reports
/{account}/reports/{report}/queries:
x-summary: Queries
get:
operationId: listQueriesInReport
summary: List queries
description: Returns all `Queries` in a `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Query` collection response'
schema:
$ref: '#/definitions/ReportQueries'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
tags:
- Reports
post:
operationId: createQueryInReport
summary: Create a query
description: Creates a `Query` in a `Report`
parameters:
- name: parameters
in: body
schema:
$ref: '#/definitions/CreateQueryRequestBody'
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Query` response'
schema:
$ref: '#/definitions/Query'
tags:
- Reports
/{account}/reports/{report}/queries/{query}:
x-summary: Query
get:
operationId: getQueryInReport
summary: Get a query
description: Returns a `Query` in a `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Query` response'
schema:
$ref: '#/definitions/Query'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: query
in: path
description: '`Query` token'
required: true
type: string
tags:
- Reports
patch:
operationId: updateQueryInReport
summary: Update a query
description: Updates a `Query` in a `Report`
parameters:
- name: parameters
in: body
schema:
$ref: '#/definitions/UpdateQueryRequestBody'
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: query
in: path
description: '`Query` token'
required: true
type: string
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Query` response'
schema:
$ref: '#/definitions/Query'
tags:
- Reports
delete:
operationId: deleteQueryInReport
summary: Delete a query
description: Deletes a `Query` in a `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Query` response'
schema:
$ref: '#/definitions/Query'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: query
in: path
description: '`Query` token'
required: true
type: string
tags:
- Reports
/{account}/reports/{report}/runs/{run}/query_runs:
x-summary: Query Runs
get:
operationId: listQueryRunsForReportRun
summary: List query runs
description: Returns all `QueryRun`s for a single `ReportRun`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: run
in: path
description: '`ReportRun` token'
required: true
type: string
responses:
'404':
description: '`ReportRun` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'200':
description: '`QueryRun` collection response'
schema:
$ref: '#/definitions/QueryRuns'
tags:
- Reports
/{account}/reports/{report}/runs/{run}/query_runs/{query_run}:
x-summary: Query Runs
get:
operationId: getQueryRunForReportRun
summary: Get a query run
description: Returns a `QueryRun` for a single `ReportRun`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: run
in: path
description: '`ReportRun` token'
required: true
type: string
- name: query_run
in: path
description: '`Query Run` token'
required: true
type: string
responses:
'404':
description: '`ReportRun` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'200':
description: '`Query Run`response'
schema:
$ref: '#/definitions/QueryRun'
tags:
- Reports
/{account}/reports/{report}/runs/{run}/query_runs/{query_run}/results/content(.csv, .json):
x-summary: Export
get:
operationId: getQueryRunContent
summary: Get query results
description: Gets the content of a query run in the requested format (csv or json)
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: run
in: path
description: '`ReportRun` token'
required: true
type: string
- name: query_run
in: path
description: '`Query Run` token'
required: true
type: string
responses:
'404':
description: '`ReportRun` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'200':
description: '`Query Run` result content in the requested format'
tags:
- Reports
/{account}/reports/{report}/filters:
x-summary: Report Filters
get:
operationId: listReportFilters
summary: List report filters
description: Returns all `ReportFilter`s for a single `Report`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
responses:
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'200':
description: '`ReportFilter` collection response'
schema:
$ref: '#/definitions/ReportFilters'
tags:
- Reports
post:
operationId: createReportFilter
summary: Create a report filter
description: Creates a `ReportFilter`
parameters:
- name: body
in: body
description: '`ReportFilter` attributes'
required: true
schema:
$ref: '#/definitions/CreateOrUpdateReportFilterRequestBody'
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
responses:
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'200':
description: '`ReportFilter` response'
schema:
$ref: '#/definitions/ReportFilter'
tags:
- Reports
/{account}/reports/{report}/filters/{filter}:
x-summary: Report Filter
get:
operationId: getReportFilter
summary: Get a report filter
description: Gets a `ReportFilter`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: filter
in: path
description: '`ReportFilter` token'
required: true
type: string
responses:
'404':
description: '`ReportFilter` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'200':
description: '`ReportFilter` response'
schema:
$ref: '#/definitions/ReportFilter'
tags:
- Reports
patch:
operationId: updateReportFilter
summary: Update a report filter
description: Updates a `ReportFilter`
parameters:
- name: body
in: body
description: '`ReportFilter` attributes'
required: true
schema:
$ref: '#/definitions/CreateOrUpdateReportFilterRequestBody'
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: filter
in: path
description: '`ReportFilter` token'
required: true
type: string
responses:
'404':
description: '`ReportFilter` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'200':
description: '`ReportFilter` response'
schema:
$ref: '#/definitions/ReportFilter'
tags:
- Reports
delete:
operationId: deleteReportFilter
summary: Delete a report filter
description: Deletes a `ReportFilter`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: filter
in: path
description: '`ReportFilter` token'
required: true
type: string
responses:
'404':
description: '`ReportFilter` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'200':
description: '`ReportFilter` response'
schema:
$ref: '#/definitions/ReportFilter'
tags:
- Reports
/{account}/reports/{report}/exports/runs/{run}/pdf/download:
x-summary: Export
get:
operationId: getReportRunExport
summary: Get PDF of a report run
description: Gets exported pdf of the report run
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: run
in: path
description: '`ReportRun` token'
required: true
type: string
responses:
'404':
description: '`ReportRun` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'200':
description: The data stream containing the exported pdf file
tags:
- Reports
/{account}/reports/{report}/runs/{run}/duplicates/{duplicate}:
x-summary: Report Runs
get:
operationId: getReportRunDuplicate
summary: Get report run duplication status
description: Returns a representation of a single `ReportRunDuplicate`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: run
in: path
description: '`ReportRun` token'
required: true
type: string
- name: duplicate
in: path
description: '`ReportRunDuplicate` token'
required: true
type: string
responses:
'404':
description: '`ReportRunDuplicate` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'200':
description: '`ReportRunDuplicate` response'
schema:
$ref: '#/definitions/ReportRunDuplicate'
tags:
- Reports
/{account}/reports/{report}/runs/{run}/duplicates:
x-summary: Report Runs
post:
operationId: duplicateReportRun
summary: Duplicate a report run
description: Returns a representation of the enqueued `ReportRunDuplicate`
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: run
in: path
description: '`ReportRun` token'
required: true
type: string
- in: query
name: collection_id
required: false
type: string
description: 'The token of a collection. Example: collection_id=875a93v22b93'
responses:
'404':
description: '`ReportRun` not found'
schema:
$ref: '#/definitions/NotFound'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'200':
description: '`ReportRunDuplicate` response'
schema:
$ref: '#/definitions/ReportRunDuplicate'
tags:
- Reports
/{account}/reports/{report}:
x-summary: Report
patch:
operationId: updateReport
summary: Update a report
description: Updates a single `report` with the provided attributes
parameters:
- name: parameters
in: body
schema:
$ref: '#/definitions/UpdateReportRequestBody'
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Report` response'
schema:
$ref: '#/definitions/Report'
tags:
- Reports
get:
operationId: getReport
summary: Get a report
description: Returns a representation of a single `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Report` response'
schema:
$ref: '#/definitions/Report'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
tags:
- Reports
delete:
operationId: deleteReport
summary: Delete a report
description: Deletes a single `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Empty body
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
tags:
- Reports
/{account}/reports/{report}/archive:
x-summary: Report
patch:
operationId: archiveReport
summary: Archive a report
description: Archives a single `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Report` response'
schema:
$ref: '#/definitions/Report'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
tags:
- Reports
/{account}/reports/{report}/unarchive:
x-summary: Report
patch:
operationId: unarchiveReport
summary: Unarchive a report
description: Unarchives a single `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: '`Report` response'
schema:
$ref: '#/definitions/Report'
parameters:
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
tags:
- Reports
/{account}/reports/purge:
x-summary: Report
post:
operationId: purgeAllReports
summary: Purge all report results
description: Removes all report results for an organization
parameters:
- name: time
in: query
description: All records older than the date ("YYYY-MM-DD") which should be purged.
required: true
type: date
- name: end_time
in: query
description: Purge records up to and including the end date ("YYYY-MM-DD"). Purging a large number of reports can result in error, so use the `end_time` to break up the purging into smaller requests.
required: false
type: date
- name: in_progress
in: query
description: Includes reports that are already in the process of purging. Defaults to `true`.
required: false
type: boolean
- name: account
in: path
description: '`Account` (`Workspace` or `User`) username'
required: true
type: string
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'400':
description: Bad request
schema:
$ref: '#/definitions/BadRequest'
'404':
description: '`Account` not found'
schema:
$ref: '#/definitions/NotFound'
'202':
description: Accepted
schema: {}
tags:
- Reports
/{workspace}/reports/{report}/schedules:
x-summary: ReportSchedule
get:
operationId: listReportSchedules
summary: List schedules for a report
description: Returns all `Schedule`s for a `Report`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Report `Schedule` collection response
schema:
$ref: '#/definitions/ReportSchedules'
parameters:
- name: workspace
in: path
description: '`Workspace` username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
tags:
- Reports
post:
operationId: createReportSchedule
summary: Create a report schedule
description: Creates a `Report` `Schedule`
parameters:
- name: parameters
in: body
schema:
$ref: '#/definitions/CreateReportScheduleRequestBody'
- name: workspace
in: path
description: '`Workspace` username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`Report` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Report `Schedule` response
schema:
$ref: '#/definitions/ReportSchedule'
tags:
- Reports
/{workspace}/reports/{report}/schedules/{schedule}:
x-summary: ReportSchedule
get:
operationId: getReportSchedule
summary: Get a report schedule
description: Returns a `Report`'s `Schedule`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`ReportSchedule` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Report `Schedule` response
schema:
$ref: '#/definitions/ReportSchedule'
parameters:
- name: workspace
in: path
description: '`Workspace` username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: schedule
in: path
description: '`Schedule` token'
required: true
type: string
tags:
- Reports
patch:
operationId: updateReportSchedule
summary: Update a report schedule
description: Updates a `Report`'s `Schedule`
parameters:
- name: parameters
in: body
schema:
$ref: '#/definitions/UpdateReportScheduleRequestBody'
- name: workspace
in: path
description: '`Workspace` username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: schedule
in: path
description: '`Schedule` token'
required: true
type: string
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`ReportSchedule` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Report `Schedule` response
schema:
$ref: '#/definitions/ReportSchedule'
tags:
- Reports
delete:
operationId: deleteReportSchedule
summary: Delete a report schedule
description: Deletes a `Report`'s `Schedule`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`ReportSchedule` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Empty body
parameters:
- name: workspace
in: path
description: '`Workspace` username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: schedule
in: path
description: '`Schedule` token'
required: true
type: string
tags:
- Reports
/{workspace}/reports/schedules/v1/bulk_delete:
x-summary: BulkDeleteReportSchedule
delete:
operationId: bulkDeleteReportSchedule
summary: Delete of multiple report schedule
description: Deletes multiple `Report`'s `Schedule`
responses:
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Unauthorized'
'404':
description: '`ReportSchedule` not found'
schema:
$ref: '#/definitions/NotFound'
'200':
description: Empty body
parameters:
- name: workspace
in: path
description: '`Workspace` username'
required: true
type: string
- name: report
in: path
description: '`Report` token'
required: true
type: string
- name: schedule
in: path
description: '`Schedule` token'
required: true
type: string
tags:
- Reports
/{account}/reports/{report}/s
# --- truncated at 32 KB (77 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/mode/refs/heads/main/openapi/mode-reports-api-openapi.yml