Table.Query
curl --request POST \
--url https://api.retab.com/v1/tables/{table_id}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": [],
"search": {
"query": "<string>",
"columns": [
"<string>"
]
},
"case_sensitive": false,
"select": [],
"distinct": {
"column": "<string>"
},
"group_by": [],
"aggregations": [],
"sort": [],
"sample": {
"size": 250
},
"tail": {
"size": 250
},
"count_only": false,
"include_explain": false,
"sort_column": "<string>",
"viewer_mode": "windowed",
"offset": 0,
"limit": 250
}
'import requests
url = "https://api.retab.com/v1/tables/{table_id}/query"
payload = {
"filters": [],
"search": {
"query": "<string>",
"columns": ["<string>"]
},
"case_sensitive": False,
"select": [],
"distinct": { "column": "<string>" },
"group_by": [],
"aggregations": [],
"sort": [],
"sample": { "size": 250 },
"tail": { "size": 250 },
"count_only": False,
"include_explain": False,
"sort_column": "<string>",
"viewer_mode": "windowed",
"offset": 0,
"limit": 250
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: [],
search: {query: '<string>', columns: ['<string>']},
case_sensitive: false,
select: [],
distinct: {column: '<string>'},
group_by: [],
aggregations: [],
sort: [],
sample: {size: 250},
tail: {size: 250},
count_only: false,
include_explain: false,
sort_column: '<string>',
viewer_mode: 'windowed',
offset: 0,
limit: 250
})
};
fetch('https://api.retab.com/v1/tables/{table_id}/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.retab.com/v1/tables/{table_id}/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([
'filters' => [
],
'search' => [
'query' => '<string>',
'columns' => [
'<string>'
]
],
'case_sensitive' => false,
'select' => [
],
'distinct' => [
'column' => '<string>'
],
'group_by' => [
],
'aggregations' => [
],
'sort' => [
],
'sample' => [
'size' => 250
],
'tail' => [
'size' => 250
],
'count_only' => false,
'include_explain' => false,
'sort_column' => '<string>',
'viewer_mode' => 'windowed',
'offset' => 0,
'limit' => 250
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.retab.com/v1/tables/{table_id}/query"
payload := strings.NewReader("{\n \"filters\": [],\n \"search\": {\n \"query\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ]\n },\n \"case_sensitive\": false,\n \"select\": [],\n \"distinct\": {\n \"column\": \"<string>\"\n },\n \"group_by\": [],\n \"aggregations\": [],\n \"sort\": [],\n \"sample\": {\n \"size\": 250\n },\n \"tail\": {\n \"size\": 250\n },\n \"count_only\": false,\n \"include_explain\": false,\n \"sort_column\": \"<string>\",\n \"viewer_mode\": \"windowed\",\n \"offset\": 0,\n \"limit\": 250\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.retab.com/v1/tables/{table_id}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": [],\n \"search\": {\n \"query\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ]\n },\n \"case_sensitive\": false,\n \"select\": [],\n \"distinct\": {\n \"column\": \"<string>\"\n },\n \"group_by\": [],\n \"aggregations\": [],\n \"sort\": [],\n \"sample\": {\n \"size\": 250\n },\n \"tail\": {\n \"size\": 250\n },\n \"count_only\": false,\n \"include_explain\": false,\n \"sort_column\": \"<string>\",\n \"viewer_mode\": \"windowed\",\n \"offset\": 0,\n \"limit\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retab.com/v1/tables/{table_id}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": [],\n \"search\": {\n \"query\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ]\n },\n \"case_sensitive\": false,\n \"select\": [],\n \"distinct\": {\n \"column\": \"<string>\"\n },\n \"group_by\": [],\n \"aggregations\": [],\n \"sort\": [],\n \"sample\": {\n \"size\": 250\n },\n \"tail\": {\n \"size\": 250\n },\n \"count_only\": false,\n \"include_explain\": false,\n \"sort_column\": \"<string>\",\n \"viewer_mode\": \"windowed\",\n \"offset\": 0,\n \"limit\": 250\n}"
response = http.request(request)
puts response.read_body{
"table_id": "<string>",
"row_count": 123,
"columns": [],
"rows": [],
"filtered_row_count": 123,
"offset": 0,
"limit": 123,
"has_more": false,
"next_cursor": "<string>",
"previous_cursor": "<string>",
"explain": {
"table_id": "<string>",
"snapshot_file_id": "",
"selected_columns": [],
"filters": [],
"search": {
"query": "<string>",
"columns": [
"<string>"
]
},
"sort": [],
"offset": 0,
"limit": 123,
"distinct": {
"column": "<string>"
},
"group_by": [],
"aggregations": []
}
}{
"detail": []
}Tables
Query Table
POST
/
v1
/
tables
/
{table_id}
/
query
Table.Query
curl --request POST \
--url https://api.retab.com/v1/tables/{table_id}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": [],
"search": {
"query": "<string>",
"columns": [
"<string>"
]
},
"case_sensitive": false,
"select": [],
"distinct": {
"column": "<string>"
},
"group_by": [],
"aggregations": [],
"sort": [],
"sample": {
"size": 250
},
"tail": {
"size": 250
},
"count_only": false,
"include_explain": false,
"sort_column": "<string>",
"viewer_mode": "windowed",
"offset": 0,
"limit": 250
}
'import requests
url = "https://api.retab.com/v1/tables/{table_id}/query"
payload = {
"filters": [],
"search": {
"query": "<string>",
"columns": ["<string>"]
},
"case_sensitive": False,
"select": [],
"distinct": { "column": "<string>" },
"group_by": [],
"aggregations": [],
"sort": [],
"sample": { "size": 250 },
"tail": { "size": 250 },
"count_only": False,
"include_explain": False,
"sort_column": "<string>",
"viewer_mode": "windowed",
"offset": 0,
"limit": 250
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: [],
search: {query: '<string>', columns: ['<string>']},
case_sensitive: false,
select: [],
distinct: {column: '<string>'},
group_by: [],
aggregations: [],
sort: [],
sample: {size: 250},
tail: {size: 250},
count_only: false,
include_explain: false,
sort_column: '<string>',
viewer_mode: 'windowed',
offset: 0,
limit: 250
})
};
fetch('https://api.retab.com/v1/tables/{table_id}/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.retab.com/v1/tables/{table_id}/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([
'filters' => [
],
'search' => [
'query' => '<string>',
'columns' => [
'<string>'
]
],
'case_sensitive' => false,
'select' => [
],
'distinct' => [
'column' => '<string>'
],
'group_by' => [
],
'aggregations' => [
],
'sort' => [
],
'sample' => [
'size' => 250
],
'tail' => [
'size' => 250
],
'count_only' => false,
'include_explain' => false,
'sort_column' => '<string>',
'viewer_mode' => 'windowed',
'offset' => 0,
'limit' => 250
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.retab.com/v1/tables/{table_id}/query"
payload := strings.NewReader("{\n \"filters\": [],\n \"search\": {\n \"query\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ]\n },\n \"case_sensitive\": false,\n \"select\": [],\n \"distinct\": {\n \"column\": \"<string>\"\n },\n \"group_by\": [],\n \"aggregations\": [],\n \"sort\": [],\n \"sample\": {\n \"size\": 250\n },\n \"tail\": {\n \"size\": 250\n },\n \"count_only\": false,\n \"include_explain\": false,\n \"sort_column\": \"<string>\",\n \"viewer_mode\": \"windowed\",\n \"offset\": 0,\n \"limit\": 250\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.retab.com/v1/tables/{table_id}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": [],\n \"search\": {\n \"query\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ]\n },\n \"case_sensitive\": false,\n \"select\": [],\n \"distinct\": {\n \"column\": \"<string>\"\n },\n \"group_by\": [],\n \"aggregations\": [],\n \"sort\": [],\n \"sample\": {\n \"size\": 250\n },\n \"tail\": {\n \"size\": 250\n },\n \"count_only\": false,\n \"include_explain\": false,\n \"sort_column\": \"<string>\",\n \"viewer_mode\": \"windowed\",\n \"offset\": 0,\n \"limit\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retab.com/v1/tables/{table_id}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": [],\n \"search\": {\n \"query\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ]\n },\n \"case_sensitive\": false,\n \"select\": [],\n \"distinct\": {\n \"column\": \"<string>\"\n },\n \"group_by\": [],\n \"aggregations\": [],\n \"sort\": [],\n \"sample\": {\n \"size\": 250\n },\n \"tail\": {\n \"size\": 250\n },\n \"count_only\": false,\n \"include_explain\": false,\n \"sort_column\": \"<string>\",\n \"viewer_mode\": \"windowed\",\n \"offset\": 0,\n \"limit\": 250\n}"
response = http.request(request)
puts response.read_body{
"table_id": "<string>",
"row_count": 123,
"columns": [],
"rows": [],
"filtered_row_count": 123,
"offset": 0,
"limit": 123,
"has_more": false,
"next_cursor": "<string>",
"previous_cursor": "<string>",
"explain": {
"table_id": "<string>",
"snapshot_file_id": "",
"selected_columns": [],
"filters": [],
"search": {
"query": "<string>",
"columns": [
"<string>"
]
},
"sort": [],
"offset": 0,
"limit": 123,
"distinct": {
"column": "<string>"
},
"group_by": [],
"aggregations": []
}
}{
"detail": []
}Read a filtered, sorted, or windowed preview of a CSV table. This route is read-only; table writes replace the whole CSV.
Python
rows = client.tables.query(
table_id="workflow_table_123",
limit=100,
)
TypeScript
const rows = await client.tables.query("workflow_table_123", {
limit: 100,
});
Go
rows, err := client.Tables.Query(ctx, "workflow_table_123", &retab.TablesQueryParams{
Body: map[string]any{"limit": 100},
})
Java
// Query table rows for read-only preview.
cURL
curl -X POST https://api.retab.com/v1/tables/workflow_table_123/query \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit":100}'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
asc, desc Allowed value:
"windowed"Required range:
x >= 0Required range:
1 <= x <= 500Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I