---
title: "Perform SQL requests"
method: POST
path: "/sql"
tags: ["Utils"]
---

# Perform SQL requests

`POST /sql`

Run a query in SQL format.
Expects a query string passed through `body` parameter and optional `raw_response` parameter that defines a format of response.
`raw_response` can be set to `False` for Select queries only, e.g., `SELECT * FROM mytable`
The query string must stay as it is, no URL encoding is needed.
The response object depends on the query executed. In select mode the response has same format as `/search` operation.

## Query parameters

- `raw_response` boolean

## Response `200`

In case of SELECT-only in mode none the response schema is the same as of `search`.
In case of `mode=raw` or `raw_response=true` the response depends on the query executed.

- union — List of responses from executed SQL queries
  - object[]
  - SqlObjResponse
    - `hits` object, required
    - `took` number
    - `timed_out` boolean

## Other responses

- `default` — error

## Changes

- **2026-07-15** `2fd450aa5f07` — 2 info
  - api tag `Utils` added
  - api tag `utils` removed
- **2025-04-01** `0e6cccea382d` — 1 breaking, 1 info
  - added `#/components/schemas/sqlRawResponse, #/components/schemas/sqlObjResponse` to the response body `oneOf` list for the response status `200`
  - removed `#/components/schemas/sqlRawResponse, #/components/schemas/sqlObjResponse` from the response body `anyOf` list for the response status `200`
- **2025-02-13** `8f90aac993c7` — 1 warning, 1 info
  - removed the optional property `error/oneOf[#/components/schemas/responseErrorDetails]/index` from the response with the `default` status
  - added the optional property `error/oneOf[#/components/schemas/responseErrorDetails]/table` to the response with the `default` status
- **2025-02-03** `d0e0656ff879` — 2 info
  - added `#/components/schemas/sqlRawResponse, #/components/schemas/sqlObjResponse` to the response body `anyOf` list for the response status `200`
  - removed `#/components/schemas/sqlRawResponse, #/components/schemas/sqlObjResponse` from the response body `oneOf` list for the response status `200`
- **2025-02-03** `b392becda096` — 1 breaking, 1 info
  - added `#/components/schemas/sqlRawResponse, #/components/schemas/sqlObjResponse` to the response body `oneOf` list for the response status `200`
  - removed `#/components/schemas/sqlRawResponse, #/components/schemas/sqlObjResponse` from the response body `anyOf` list for the response status `200`

[Full history](https://skmtc.dev/manticoresoftware/apis/manticore-search-client/changes/sql/post.md)

---

[API](https://skmtc.dev/manticoresoftware/apis/manticore-search-client.md) · [All operations](https://skmtc.dev/manticoresoftware/apis/manticore-search-client/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/manticoresoftware/manticore-search-client/revisions/eb39c8083035/schema)
