---
title: "SQL Formatter"
method: POST
path: "/api/v1/tools/sql-formatter"
tags: ["tools"]
---

# SQL Formatter

`POST /api/v1/tools/sql-formatter`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/sql-formatter`
- Auth: HTTP bearer

Pretty-print a SQL statement: keywords in upper case, each major clause (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY and so on) on its own line, and indentation inside CASE and parentheses. String literals are left untouched. A formatter, not a parser: it does not check that the SQL is valid.

## Request body

- object
  - `sql` string

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `sql` string

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

[API](https://skmtc.dev/toolforte/apis/toolforte-api.md) · [All operations](https://skmtc.dev/toolforte/apis/toolforte-api/llms.txt) · [OpenAPI document](https://skmtc.dev/toolforte/apis/toolforte-api/revisions/4d814d484dfc?raw)
