Convert natural language to SQL
POST
/v1/requests/{id}/nl-to-sql
const url = 'https://localhost:8080/v1/requests/example/nl-to-sql';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"query":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:8080/v1/requests/example/nl-to-sql \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "query": "example" }'Generates a DuckDB SQL statement for the request’s scope from a natural-language question, using the configured AI pipeline and the relation names of the request’s datasets. The returned SQL is not executed; submit it to POST /v1/requests/{id}/query. 503 when no AI pipeline is configured.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request ID
Request Body
Section titled “Request Body”Natural language query
Media typeapplication/json
object
query
required
string
Example generated
{ "query": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
sql
string
success
boolean
Example generated
{ "sql": "example", "success": true}Bad Request
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Unauthorized
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Not Found
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Internal Server Error
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Service Unavailable
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}