---
title: "Test Query"
method: POST
path: "/v3/integrations/{id}/test-query"
tags: ["integrations-v3"]
---

# Test Query

`POST /v3/integrations/{id}/test-query`

Execute an ad-hoc query against a saved integration.

Used to test connectivity and queries (logs, metrics, traces, …) with
the live credentials stored for the instance. The query string is
interpreted by the integration in its native language (LogQL, PromQL,
TraceQL, …).

**Permissions**: org admin of the owning org, or platform admin.

Returns HTTP 404 if the instance does not exist, and HTTP 501 if the
integration type does not support ad-hoc query execution.

## Path parameters

- `id` string, required

## Request body

- TestIntegrationQueryRequest — Request body for running an ad-hoc query against an integration. The query string is interpreted by the integration in its native query language (LogQL for Loki, PromQL for Mimir, TraceQL for Tempo, …).
  - `query` string, required — Source-native query string to execute. LogQL for Loki, PromQL for Mimir, TraceQL for Tempo.
  - `start_time` string, date-time, nullable — Lower bound of the query time range (ISO-8601). If omitted, defaults to an integration-appropriate window ending at ``end_time``.
  - `end_time` string, date-time, nullable — Upper bound of the query time range (ISO-8601). If omitted, defaults to the current time.
  - `limit` integer — Maximum number of rows/series/traces to return.

## Response `200`

Successful Response

- TestIntegrationQueryResponse — Response for an ad-hoc integration query.
  - `query` string, required
  - `message` string, required
  - `result_count` integer, required
  - `results` object[], required
  - `details` object
  - `executed_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/traversal/apis/fastapi.md) · [All operations](https://skmtc.net/traversal/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/traversal/fastapi/revisions/2134ebffd1ef/schema)
