Update the visibility or metadata or document list of an AI table
curl --request POST \
--url https://cite.petal.org/api/ai/table/{ai_table_id}/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
123
],
"meta": {},
"visibility": "shared"
}
'import requests
url = "https://cite.petal.org/api/ai/table/{ai_table_id}/update"
payload = {
"document_ids": [123],
"meta": {},
"visibility": "shared"
}
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({document_ids: [123], meta: {}, visibility: 'shared'})
};
fetch('https://cite.petal.org/api/ai/table/{ai_table_id}/update', 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://cite.petal.org/api/ai/table/{ai_table_id}/update",
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([
'document_ids' => [
123
],
'meta' => [
],
'visibility' => 'shared'
]),
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://cite.petal.org/api/ai/table/{ai_table_id}/update"
payload := strings.NewReader("{\n \"document_ids\": [\n 123\n ],\n \"meta\": {},\n \"visibility\": \"shared\"\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://cite.petal.org/api/ai/table/{ai_table_id}/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n 123\n ],\n \"meta\": {},\n \"visibility\": \"shared\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cite.petal.org/api/ai/table/{ai_table_id}/update")
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 \"document_ids\": [\n 123\n ],\n \"meta\": {},\n \"visibility\": \"shared\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "<string>",
"id": 123,
"meta": {},
"organization_id": 123,
"user_id": 123,
"visibility": "shared",
"document_ids": [
123
]
}[
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {}
}
]AI Table
Update an AI Table
Change visibility or Document list of AI Table
POST
/
api
/
ai
/
table
/
{ai_table_id}
/
update
Update the visibility or metadata or document list of an AI table
curl --request POST \
--url https://cite.petal.org/api/ai/table/{ai_table_id}/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
123
],
"meta": {},
"visibility": "shared"
}
'import requests
url = "https://cite.petal.org/api/ai/table/{ai_table_id}/update"
payload = {
"document_ids": [123],
"meta": {},
"visibility": "shared"
}
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({document_ids: [123], meta: {}, visibility: 'shared'})
};
fetch('https://cite.petal.org/api/ai/table/{ai_table_id}/update', 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://cite.petal.org/api/ai/table/{ai_table_id}/update",
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([
'document_ids' => [
123
],
'meta' => [
],
'visibility' => 'shared'
]),
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://cite.petal.org/api/ai/table/{ai_table_id}/update"
payload := strings.NewReader("{\n \"document_ids\": [\n 123\n ],\n \"meta\": {},\n \"visibility\": \"shared\"\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://cite.petal.org/api/ai/table/{ai_table_id}/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n 123\n ],\n \"meta\": {},\n \"visibility\": \"shared\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cite.petal.org/api/ai/table/{ai_table_id}/update")
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 \"document_ids\": [\n 123\n ],\n \"meta\": {},\n \"visibility\": \"shared\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "<string>",
"id": 123,
"meta": {},
"organization_id": 123,
"user_id": 123,
"visibility": "shared",
"document_ids": [
123
]
}[
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {}
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique ID of the AI Table
Body
application/json
List of Document IDs in this Table. If an ID is removed, all its associated cells will be automatically deleted
Metadata, for internal use
Whether this Table can only be seen by its creator, or by the whole Workspace
Available options:
shared, private Response
OK
Time of Table creation, in UTC
Unique ID of Table
Metadata, for internal use
Unique ID of Organization the Table belongs to
Unique ID of user the Table belongs to
Whether this Table can only be seen by its creator, or by the whole Workspace
Available options:
shared, private List of Document IDs in this Table
