---
title: "Compare dataviews pairwise"
method: POST
path: "/workspaces/{workspace_id}/dataviews/compare"
tags: ["Dataviews"]
---

# Compare dataviews pairwise

`POST /workspaces/{workspace_id}/dataviews/compare`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/dataviews/compare`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Read-only. For each [view_a, view_b] pair returns row counts, columns present on one side only, order-independent per-column checksums (floats rounded to 6 places) and whether the two views hold the same data. Columns are matched by display name.

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

## Request body

- CompareRequest
  - `pairs` array[], required: Pairs of dataview ids, each exactly [view_a, view_b]
    - integer[]

## Response `200`

One result per requested pair, in request order

- CompareResponse
  - `results` ComparePairResult[], required
    - `view_a` integer, required
    - `view_b` integer, required
    - `status` 'ok' | 'not_ready' | 'not_comparable', required: ok: compared. not_ready: a view's latest data is not materialized (see problem_views). not_comparable: a view has duplicate column display names (see problem_views).
    - `problem_views` integer[]
    - `rows_a` integer, nullable
    - `rows_b` integer, nullable
    - `columns_only_in_a` string[]
    - `columns_only_in_b` string[]
    - `checksum_a` string, nullable
    - `checksum_b` string, nullable
    - `equal` boolean
    - `mismatched_columns` string[]

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
