Skip to content
LogoLogo

Report schema

See Management API schema for every domain, the endpoint and authentication.

Queries

report

Reads a project report. Null when no project report has the ID. Scope: ORGANIZATION_REPORTS_READ.

report(id: ID!): ProjectReport @auth

Mutations

reportCreate

Creates a report and adds it to a project. Scope: ORGANIZATION_REPORTS_CREATE.

reportCreate(input: ReportCreateInput!): ReportCreatePayload! @auth

reportUpdate

Updates a project report and its report. Scope: ORGANIZATION_REPORTS_UPDATE.

reportUpdate(input: ReportUpdateInput!): ReportUpdatePayload! @auth

reportDelete

Deletes a report from its project, and the report itself when no other project uses it. Scope: ORGANIZATION_REPORTS_DELETE.

reportDelete(input: ReportDeleteInput!): ReportDeletePayload! @auth

Types

ReportSortKeys

"""The orders a report list can take. `reverse: true` flips the order."""
enum ReportSortKeys {
  """By name, A to Z."""
  NAME
  """By display order, lowest first."""
  DISPLAY_ORDER
  """By creation time, oldest first."""
  CREATED_AT
}

ReportType

"""What a report embeds."""
enum ReportType {
  """One question, a single chart."""
  QUESTION
  """A dashboard of several charts."""
  DASHBOARD
}

Report

"""
An embedded analytics dashboard or question: a Metabase report with a name and description.
"""
type Report {
  """The ID of the report."""
  id: ID!
  """The ID of the analytics question or dashboard."""
  analyticsReportId: Int!
  """The ID of the analytics question or dashboard."""
  metabaseReportId: Int! @deprecated(reason: "Use analyticsReportId.")
  """The name of the report."""
  name: String!
  """The description of the report. Null when it has none."""
  description: String
  """What the report embeds."""
  analyticsReportType: ReportType!
  """What the report embeds."""
  metabaseReportType: ReportType! @deprecated(reason: "Use analyticsReportType.")
  """When the report was created."""
  createdAt: DateTime!
  """When the report last changed."""
  updatedAt: DateTime!
}

ProjectReport

"""
A report attached to a project, with the parameters its embed is locked to.
"""
type ProjectReport {
  """The ID of the project report."""
  id: ID!
  """The report."""
  report: Report!
  """
  The Metabase parameters the embed is locked to: `project_id`, the report's own project.
  """
  lockedParameters: JSON
  """The position of the report in the project's list. Null sorts last."""
  displayOrder: Int
  """When the report was added to the project."""
  createdAt: DateTime!
  """
  The ID of the user who added the report to the project. Null when unknown.
  """
  createdBy: String
  """
  A signed embed URL for the report. It expires 3 hours after it is read.
  """
  embedUrl: String!
}

ProjectReportEdge

"""A project report in a page of results."""
type ProjectReportEdge {
  """The cursor of this edge."""
  cursor: String!
  """The project report."""
  node: ProjectReport!
}

ProjectReportConnection

"""A page of project reports."""
type ProjectReportConnection {
  """The edges in this page."""
  edges: [ProjectReportEdge!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """The total number of reports on the project."""
  totalCount: Int!
}

ReportCreateInput

"""The input of `reportCreate`."""
input ReportCreateInput {
  """The ID of the project to add the report to."""
  projectId: ID!
  """Ignored. The project's organization applies."""
  organizationId: ID!
  """The name of the report. Must not be blank."""
  name: String!
  """The description of the report."""
  description: String
  """
  The ID of the analytics question or dashboard. Must be positive. Required.
  """
  analyticsReportId: Int
  """The ID of the analytics question or dashboard."""
  metabaseReportId: Int @deprecated(reason: "Use analyticsReportId.")
  """What the report embeds. Required."""
  analyticsReportType: ReportType
  """What the report embeds."""
  metabaseReportType: ReportType @deprecated(reason: "Use analyticsReportType.")
  """Ignored. The embed locks the report's own project."""
  lockedParameters: JSON @deprecated(reason: "Ignored. The embed locks the report's own project.")
  """The position of the report in the project's list."""
  displayOrder: Int
}

ReportCreatePayload

"""The result of `reportCreate`."""
type ReportCreatePayload {
  """The created project report."""
  projectReport: ProjectReport
}

ReportUpdateInput

"""
The input of `reportUpdate`. Omit a field to keep its value. Null clears `description` and
`displayOrder`.
"""
input ReportUpdateInput {
  """The ID of the project report."""
  projectReportId: ID!
  """The name of the report."""
  name: String
  """The description of the report."""
  description: String
  """The ID of the analytics question or dashboard."""
  analyticsReportId: Int
  """The ID of the analytics question or dashboard."""
  metabaseReportId: Int @deprecated(reason: "Use analyticsReportId.")
  """What the report embeds. Required."""
  analyticsReportType: ReportType
  """What the report embeds."""
  metabaseReportType: ReportType @deprecated(reason: "Use analyticsReportType.")
  """Ignored. The embed locks the report's own project."""
  lockedParameters: JSON @deprecated(reason: "Ignored. The embed locks the report's own project.")
  """The position of the report in the project's list."""
  displayOrder: Int
}

ReportUpdatePayload

"""The result of `reportUpdate`."""
type ReportUpdatePayload {
  """The updated project report."""
  projectReport: ProjectReport
}

ReportDeleteInput

"""The input of `reportDelete`."""
input ReportDeleteInput {
  """The ID of the project report."""
  projectReportId: ID!
}

ReportDeletePayload

"""The result of `reportDelete`."""
type ReportDeletePayload {
  """Whether the report was deleted."""
  success: Boolean!
}