---
title: "SQL Query"
method: POST
path: "/v1/sql"
tags: ["SQL"]
---

# SQL Query

`POST /v1/sql`

Execute a SQL query and return the results.

This endpoint allows users to execute SQL queries directly from an HTTP request. The SQL query is sent as plain text in the request body.

## Headers

- `Accept` string, required

## Request body

- unknown

## Response `200`

SQL query executed successfully

- unknown[]
  - unknown

## Other responses

- `400` — Invalid SQL query or malformed input
- `500` — Internal server error

## Changes

- **2025-04-23** `739d47312faa` — 1 info
  - added the media type `application/json` to the request body
- **2025-04-16** `a25c7ffc963c` — 1 info
  - added the media type `application/vnd.spiceai.sql.v1+json` for the response with the status `200`
- **2025-03-18** `dd94571fef79` — 2 breaking
  - removed the media type `application/json` from the request body
  - removed the media type `application/vnd.spiceai.sql.v1+json` for the response with the status `200`

[Change history](https://skmtc.dev/spiceai/apis/runtime/changes/v1/sql/post.md)

---

[API](https://skmtc.dev/spiceai/apis/runtime.md) · [All operations](https://skmtc.dev/spiceai/apis/runtime/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spiceai/runtime/revisions/fb597a4eaa56/schema)
