---
title: "Preview Object Report Api"
method: POST
path: "/reports/preview"
tags: ["Reports"]
---

# Preview Object Report Api

`POST /reports/preview`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/reports/preview`
- Auth: HTTP bearer

Run an unsaved report with this credential's own access and a 10 second budget (nothing partial is returned).

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- ReportPreview: Run an unsaved report with the caller's own access (the builder's live preview). No drilldown.
  - `object_slug` string, required
  - `chart_type` 'table' | 'bar' | 'line' | 'funnel' | 'stage_over_time' | 'time_in_stage', required
  - `config` ReportConfig, required: What a report computes. ``timezone`` (an IANA name) fixes how dates are bucketed and what "end of day" means; when absent the organization's time zone applies (never the server's).
    - `filters` ReportFilter[]
      - `attribute_slug` string, required
      - `relationship_slug` string, nullable
      - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'starts_with' | 'is_null' | 'is_not_null' | 'in', required
      - `value` unknown
    - `group_by` ReportGroupBy[]
      - `kind` 'attribute' | 'related_attribute' | 'created_at'
      - `attribute_slug` string, nullable
      - `relationship_slug` string, nullable
      - `grain` 'day' | 'week' | 'month' | 'quarter' | 'year', nullable
    - `measures` ReportMeasure[]
      - `kind` 'count' | 'sum' | 'avg' | 'min' | 'max' | 'related_count', required
      - `attribute_slug` string, nullable
      - `relationship_slug` string, nullable
      - `label` string, nullable
    - `stage` ReportStage: The stage field and the ORDERED stages a funnel, stage-over-time or time-in-stage report walks.
      - `attribute_slug` string, required
      - `order` string[], required
    - `range` ReportRange: The calendar range a stage-over-time report snapshots, one column per ``grain`` period end (in the report's time zone).
      - `from` string, date, required
      - `to` string, date, required
      - `grain` 'day' | 'week' | 'month' | 'quarter' | 'year'
    - `timezone` string, nullable
  - `as_of` string, date, nullable

## Response `200`

Successful Response

- ApiResponseReportResult
  - `data` ReportResult, required
    - `kind` 'result'
    - `status` 'ok' | 'restricted'
    - `chart_type` 'table' | 'bar' | 'line' | 'funnel' | 'stage_over_time' | 'time_in_stage', required
    - `source` ReportSource, required
      - `slug` string, required
      - `singular_noun` string, required
      - `plural_noun` string, required
      - `kind` 'object' | 'process_list', required
      - `is_archived` boolean
    - `timezone` string, required
    - `as_of` AsOf
      - `date` string, date, required
      - `instant` string, date-time, required
      - `timezone` string, required
    - `columns` ResultColumn[]
      - `id` string, required
      - `kind` 'group_by' | 'measure' | 'stage' | 'gap', required
      - `label` string, nullable
      - `value_type` string, nullable
      - `grain` 'day' | 'week' | 'month' | 'quarter' | 'year', nullable
      - `restricted` boolean
    - `rows` ResultRow[]
      - `key` string, required
      - `group` GroupValue[]
        - `id` string, required
        - `value` unknown
        - `gap` 'no_history', nullable
      - `measures` object
      - `record_count` integer
      - `drilldown` union, required
        - GroupTarget: One row of a table, bar or line report: the group values in dimension order. ``gaps[i]`` is ``"no_history"`` when dimension *i* is the history-gap group of an as-of report. A numeric value a JSON number cannot carry exactly (past 15 significant digits) is its exact decimal text here; echo the target unchanged.
          - `kind` 'group'
          - `values` unknown[]
            - unknown
          - `gaps` string[]
        - StageTarget: One stage of a funnel or time-in-stage report.
          - `kind` 'stage'
          - `stage` string, required
        - SnapshotTarget: One cell of a stage-over-time report, on the last day of the period that ends on ``bucket_end``: every record live then (``all``), the records in ``stage`` (``stage``), those with no stage (``unstaged``) or those with no recorded stage history (``no_history``).
          - `kind` 'snapshot'
          - `bucket_end` string, date, required
          - `cell` 'all' | 'stage' | 'unstaged' | 'no_history'
          - `stage` string, nullable
        - AllTarget: Every record behind the report (the totals row).
          - `kind` 'all'
      - `partial` boolean
      - `unstaged` object
    - `totals` ResultTotals
      - `record_count` integer, required
      - `measures` object
    - `total_base_records` integer
    - `total_groups` integer
    - `row_limit` integer
    - `truncated` boolean
    - `chart_limit` integer
    - `chart_truncated` boolean
    - `chart_other` ChartOther: What the chart folds into "Other": every group beyond ``chart_limit``. Only additive measures (count, sum, related_count) are filled in; an average, minimum or maximum cannot be folded and is None.
      - `group_count` integer, required
      - `record_count` integer, required
      - `measures` object, required
    - `gaps` GapNote[]
      - `component` string, required
      - `kind` 'no_history'
      - `records` integer, required
    - `restricted` RestrictedComponent[]
      - `id` string, required
      - `restricted` true
    - `disclosures` string[]
    - `history_supported` boolean
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
