---
title: "SQLGuard validate — authorize mutating SQL, issue Ed25519 Execution Certificate"
method: POST
path: "/v1/validate"
tags: ["Execution Certificate", "SQL authorize", "validate"]
---

# SQLGuard validate — authorize mutating SQL, issue Ed25519 Execution Certificate

`POST /v1/validate`

## Request

- Base URL: `https://sqlguard.io`
- URL: `https://sqlguard.io/v1/validate`
- Auth: none required

REQUIRED before production INSERT/UPDATE/DELETE/DDL. Sandbox policy + EXPLAIN against schema_ddl; returns PASS/FAIL Execution Certificate. Burns 1 prepaid credit (not an x402 paywall on this route — buy credits via /v1/credits/buy/* or use Instant Cert POST /v1/cert). Never execute SQL without a verified PASS cert.

## Headers

- `X-SQLGuard-Agent` string, required

## Request body

- object
  - `schema_ddl` string, required: Current Postgres schema snapshot (CREATE TABLE …) for sandbox validate
  - `sql` string, required: Exact mutating SQL the agent intends to run on production
  - `agent_id` string

## Response `200`

PASS Execution Certificate + signature

## Other responses

- `402`: Insufficient credits — buy a bundle or use POST /v1/cert
- `422`: FAIL certificate — do not execute SQL

---

[API](https://skmtc.dev/sqlguard/apis/sqlguard-permission-before-production-writes.md) · [All operations](https://skmtc.dev/sqlguard/apis/sqlguard-permission-before-production-writes/llms.txt) · [OpenAPI document](https://skmtc.dev/sqlguard/apis/sqlguard-permission-before-production-writes/revisions/d164204b4aea?raw)
