---
title: "Run Ad-hoc Query"
method: POST
path: "/print-mail/v1/reports/samples"
tags: ["Reports"]
---

# Run Ad-hoc Query

`POST /print-mail/v1/reports/samples`

Run an ad-hoc SQL query against your data lake and get a sample of the results.
This is useful for quickly testing queries without saving them as a report.
The query execution time and result size are limited.

## Request body

- AdHocReportSampleCreate — Base properties for creating a report sample.
  - `params` string[] — Optional parameters to bind to the SQL query (e.g., for placeholders like ? or $1).
  - `limit` integer — Maximum number of rows to return in the sample.

## Response `201`

A sample of the query results.

- ReportSample — Represents the result of a report sample query.
  - `id` string, required — Unique identifier for the sample query result.
  - `report` string, nullable, required — The ID of the report this sample was generated from, or null for ad-hoc samples.
  - `records` ReportRecord[], required — The actual data records returned by the sample query.

## Other responses

- `400` — A sample of the query results.
- `401` — A sample of the query results.
- `404` — A sample of the query results.
- `422` — A sample of the query results.
- `429` — A sample of the query results.
- `500` — A sample of the query results.

## Changes

- **2026-05-01** `c8fedcbd705e` — 4 warning, 2 info
  - added the new `internal_server_error` enum value to the `error/type` response property for the response status `500`
  - added the new `not_found_error` enum value to the `error/type` response property for the response status `404`
  - added the new `rate_limit_exceeded_error` enum value to the `error/type` response property for the response status `429`
  - added the new `validation_error` enum value to the `error/type` response property for the response status `400`
  - …2 more

[Change history](https://skmtc.dev/postgrid/apis/postgrid-address-verification-api/changes/print-mail/v1/reports/samples/post.md)

---

[API](https://skmtc.dev/postgrid/apis/postgrid-address-verification-api.md) · [All operations](https://skmtc.dev/postgrid/apis/postgrid-address-verification-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/postgrid/postgrid-address-verification-api/revisions/537d2bbc624a/schema)
