Skip to content

Upload API

Use POST /v1/rewrite/upload when the SQL already lives in a file.

It runs the same rewrite engine as POST /v1/rewrite and returns the same plan shape.

Replace SQLTAMER_BASE_URL with your API base URL before running the example on this page.

Example

curl -X POST "$SQLTAMER_BASE_URL/v1/rewrite/upload?dialect=postgres" \
  -H "Authorization: Bearer $SQLTAMER_API_KEY" \
  -F "file=@query.sql"

Prefer the normal Rewrite API for application integrations that already build JSON requests.