> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# About Validio API

> Interact with the Validio platform programmatically through the GraphQL API, and export Validio data as CSV through the CSV Export API.

Validio has two APIs:

* **The GraphQL API** is built using [GraphQL](https://graphql.org/) and enables interaction with the Validio platform through any GraphQL client. It exposes the same functionality as the Validio UI, so you can read, create, update, and delete resources programmatically.
* **The CSV Export API** is a set of read-only REST endpoints that return Validio data as CSV, for reporting, archival, and ingestion into BI tools or data warehouses.

> **[GraphQL API reference](https://docs.validio.io/api-reference.md)**
>
> Every query, mutation, and type in the GraphQL API.

> **[GraphQL basics](https://docs.validio.io/v10.2/developer/validio-api/graphql-api/graphql-basics.md)**
>
> If you're unfamiliar with GraphQL, start with the basics.

> **[CSV Export API](https://docs.validio.io/v10.2/developer/validio-api/csv-export-api.md)**
>
> Export sources, validators, incidents, and more as CSV.

## Which API to use

Use the **GraphQL API** by default. It covers the whole platform, and it's the only option for changes, such as creating a source, updating a validator's threshold, or muting an incident.

Use the **CSV Export API** when you want rows rather than objects: to feed a BI tool, to archive incident or activity history beyond your retention window, or to hand data to someone who works in spreadsheets. The same endpoints back the **Export** buttons in the Validio UI.

## Endpoints

Both APIs are served from your Validio instance. The base URL, written `https://your-validio-instance` on these pages, is the URL you use to access Validio. An installation that Validio hosts is on a `validio.io` address, while a VPC installation uses your own domain.

| API | Endpoint |
| :- | :- |
| GraphQL API | `POST https://your-validio-instance/api` |
| CSV Export API | `GET https://your-validio-instance/api/export/v1/<resource>` |

When you configure the [Validio SDK](https://docs.validio.io/v10.2/developer/validio-sdk.md) or [CLI](https://docs.validio.io/v10.2/developer/validio-cli.md), you give the base URL, and the client adds the `/api` path.

## Authentication

Both APIs use the same `Authorization` header, with the value `<access-key>:<access-secret>`. For how to create an API key, and how the CLI and SDK find credentials, see [Authentication](https://docs.validio.io/v10.2/developer/getting-started/authentication.md).

## Working with the GraphQL API

These pages cover the concepts that apply to GraphQL API requests:

* **[GraphQL basics](https://docs.validio.io/v10.2/developer/validio-api/graphql-api/graphql-basics.md):** The GraphQL concepts to know before you start.
* **[Namespaces](https://docs.validio.io/v10.2/developer/getting-started/namespaces.md):** Target the namespace your resources live in.
* **[API integration patterns](https://docs.validio.io/v10.2/developer/validio-api/graphql-api/api-integration-patterns.md):** Synchronize data quality information with the rest of your stack.
* **[Pagination and rate limits](https://docs.validio.io/v10.2/developer/validio-api/graphql-api/pagination-and-rate-limits.md):** Page through large result sets, and stay within the request budget.
* **[API errors](https://docs.validio.io/v10.2/developer/validio-api/graphql-api/api-errors.md):** The stable error codes to branch on.

## Query examples

By inspecting the GraphQL schema, you can find the data you're interested in and how to get, create, or update it. For how the schema is organized, see the [Validio GraphQL API reference](https://docs.validio.io/api-reference.md). For common operations and how to use them, see the [SDK recipes](https://docs.validio.io/v10.2/developer/validio-sdk/sdk-recipes.md).

### Templated debug queries

The [`validatorMetricDebugInfo`](https://docs.validio.io/api-reference/graphql/queries/validatorMetricDebugInfo) query returns the SQL that reproduces an incident. Set `templated: true` on its input to receive that SQL with `{{ validio_... }}` placeholders in place of the incident's literal values, so one query can be re-bound to other incidents. The default is `false`.

A templated query is expanded automatically when it is executed, so it can be passed straight to [`validatorMetricDebugRecords`](https://docs.validio.io/api-reference/graphql/queries/validatorMetricDebugRecords) without being resolved first. For the placeholders themselves, see [Debug query syntax](https://docs.validio.io/v10.2/docs/incidents-and-errors/incidents/debug-query-syntax.md).
