---
title: "Preview a vendor estimation run"
method: POST
path: "/v1/integrations/{integrationId}/exceptions/vendor-estimation-runs/preview"
tags: ["Integration Exceptions"]
---

# Preview a vendor estimation run

`POST /v1/integrations/{integrationId}/exceptions/vendor-estimation-runs/preview`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/integrations/{integrationId}/exceptions/vendor-estimation-runs/preview`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Returns how many exceptions and distinct queries a run would cover, and which exceptions cannot be counted because their query never parsed. Writes nothing.

## Path parameters

- `integrationId` string, required

## Request body

- CreateVendorEstimationRunRequest
  - `scopeQuery` string: Vendor query limiting the estimate to part of the customer's traffic. Applied to both the matched count and the total. Leave empty for all logs.
  - `windowEnd` string, date-time, required: Absolute end of the window to count over; must be after the start and not in the future
  - `windowStart` string, date-time, required: Absolute start of the window to count over

## Response `200`

Preview computed

- VendorEstimationRunPreview
  - `distinctQueries` integer, required: Distinct countable predicates among those exceptions, and so the number of vendor calls the run would make. Smaller than the exception count wherever several exceptions carry the same query.
  - `exceptions` integer, required: Exceptions the run would cover: every one the integration has imported
  - `unparseable` UnparseableException[], required: Exceptions whose query could not be parsed at import and so cannot be counted, each with the parse error
    - `exceptionId` string, required: Composite exception id
    - `message` string, required: The parse error recorded when the exception was imported

## Other responses

- `400`: Bad Request - The window is inverted, starts or ends in the future, or is too long.
- `401`: Unauthorized
- `404`: Not Found - Integration not found.

---

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