SQL Console
curl --request POST \
--url https://api.vertracloud.app/v1/databases/{id}/data/query \
--header 'Content-Type: application/json' \
--data '
{
"sql": "<string>",
"limit": 123
}
'import requests
url = "https://api.vertracloud.app/v1/databases/{id}/data/query"
payload = {
"sql": "<string>",
"limit": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({sql: '<string>', limit: 123})
};
fetch('https://api.vertracloud.app/v1/databases/{id}/data/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/databases/{id}/data/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sql' => '<string>',
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/databases/{id}/data/query"
payload := strings.NewReader("{\n \"sql\": \"<string>\",\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/databases/{id}/data/query")
.header("Content-Type", "application/json")
.body("{\n \"sql\": \"<string>\",\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/databases/{id}/data/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sql\": \"<string>\",\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"response": {
"columns": ["id", "email"],
"rows": [[1, "[email protected]"]],
"row_count": 1,
"duration_ms": 12,
"truncated": false
}
}
{ "code": "QUERY_TIMEOUT" }
Data
SQL Console
Runs a SQL statement against your own database, with limits on time, rows, size and concurrency.
POST
/
v1
/
databases
/
{id}
/
data
/
query
SQL Console
curl --request POST \
--url https://api.vertracloud.app/v1/databases/{id}/data/query \
--header 'Content-Type: application/json' \
--data '
{
"sql": "<string>",
"limit": 123
}
'import requests
url = "https://api.vertracloud.app/v1/databases/{id}/data/query"
payload = {
"sql": "<string>",
"limit": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({sql: '<string>', limit: 123})
};
fetch('https://api.vertracloud.app/v1/databases/{id}/data/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/databases/{id}/data/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sql' => '<string>',
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/databases/{id}/data/query"
payload := strings.NewReader("{\n \"sql\": \"<string>\",\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/databases/{id}/data/query")
.header("Content-Type", "application/json")
.body("{\n \"sql\": \"<string>\",\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/databases/{id}/data/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sql\": \"<string>\",\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"response": {
"columns": ["id", "email"],
"rows": [[1, "[email protected]"]],
"row_count": 1,
"duration_ms": 12,
"truncated": false
}
}
{ "code": "QUERY_TIMEOUT" }
Every
/data endpoint needs the Intermediary plan or higher, on the database owner’s
account — not the caller’s. Below that the answer is PLAN_RESTRICTED_FEATURE (403).
It is also dashboard-session only: an API key gets API_KEY_SCOPE_DENIED (403) here, regardless of
its scopes.| Limit | Value |
|---|---|
| Statement timeout | 10 s, applied by the engine itself |
| Rows returned | limit, default 200, maximum 1000 |
| Statement size | 64 KB |
| Result size | 5 MB serialized |
| Concurrency | one console query at a time per database |
| Rate limit | 30 requests/minute per user |
string
required
The ID of the database.
string
required
The statement. Empty bodies are rejected.
number
Row ceiling. The result is truncated, not the statement.
string
Workspace the database belongs to.
Response
object
{
"response": {
"columns": ["id", "email"],
"rows": [[1, "[email protected]"]],
"row_count": 1,
"duration_ms": 12,
"truncated": false
}
}
{ "code": "QUERY_TIMEOUT" }