curl --request PATCH \
--url https://api.galileo.ai/v2/datasets/{dataset_id}/content \
--header 'Content-Type: application/json' \
--header 'Galileo-API-Key: <api-key>' \
--data '
{
"edits": [
{
"values": {},
"edit_type": "prepend_row",
"row_id": "<string>"
}
]
}
'import requests
url = "https://api.galileo.ai/v2/datasets/{dataset_id}/content"
payload = { "edits": [
{
"values": {},
"edit_type": "prepend_row",
"row_id": "<string>"
}
] }
headers = {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Galileo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({edits: [{values: {}, edit_type: 'prepend_row', row_id: '<string>'}]})
};
fetch('https://api.galileo.ai/v2/datasets/{dataset_id}/content', 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.galileo.ai/v2/datasets/{dataset_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'edits' => [
[
'values' => [
],
'edit_type' => 'prepend_row',
'row_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Galileo-API-Key: <api-key>"
],
]);
$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.galileo.ai/v2/datasets/{dataset_id}/content"
payload := strings.NewReader("{\n \"edits\": [\n {\n \"values\": {},\n \"edit_type\": \"prepend_row\",\n \"row_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Galileo-API-Key", "<api-key>")
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.patch("https://api.galileo.ai/v2/datasets/{dataset_id}/content")
.header("Galileo-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": [\n {\n \"values\": {},\n \"edit_type\": \"prepend_row\",\n \"row_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/datasets/{dataset_id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Galileo-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": [\n {\n \"values\": {},\n \"edit_type\": \"prepend_row\",\n \"row_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update Dataset Content
Update the content of a dataset.
The index and column_name fields are treated as keys tied to a specific version of the dataset.
As such, these values are considered immutable identifiers for the dataset’s structure.
Edits are applied sequentially in list order, and each edit sees the table state left by the
previous one. For example, after a rename_column edit renames col_a to col_b, any
subsequent update_row in the same request must reference the column as col_b, not col_a.
The If-Match header is used to ensure that updates are only applied if the client’s version of the dataset
matches the server’s version. This prevents conflicts from simultaneous updates. The ETag header in the response
provides the new version identifier after a successful update.
curl --request PATCH \
--url https://api.galileo.ai/v2/datasets/{dataset_id}/content \
--header 'Content-Type: application/json' \
--header 'Galileo-API-Key: <api-key>' \
--data '
{
"edits": [
{
"values": {},
"edit_type": "prepend_row",
"row_id": "<string>"
}
]
}
'import requests
url = "https://api.galileo.ai/v2/datasets/{dataset_id}/content"
payload = { "edits": [
{
"values": {},
"edit_type": "prepend_row",
"row_id": "<string>"
}
] }
headers = {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Galileo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({edits: [{values: {}, edit_type: 'prepend_row', row_id: '<string>'}]})
};
fetch('https://api.galileo.ai/v2/datasets/{dataset_id}/content', 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.galileo.ai/v2/datasets/{dataset_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'edits' => [
[
'values' => [
],
'edit_type' => 'prepend_row',
'row_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Galileo-API-Key: <api-key>"
],
]);
$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.galileo.ai/v2/datasets/{dataset_id}/content"
payload := strings.NewReader("{\n \"edits\": [\n {\n \"values\": {},\n \"edit_type\": \"prepend_row\",\n \"row_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Galileo-API-Key", "<api-key>")
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.patch("https://api.galileo.ai/v2/datasets/{dataset_id}/content")
.header("Galileo-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": [\n {\n \"values\": {},\n \"edit_type\": \"prepend_row\",\n \"row_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/datasets/{dataset_id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Galileo-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": [\n {\n \"values\": {},\n \"edit_type\": \"prepend_row\",\n \"row_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
ETag of the dataset as a version identifier.
"d89cce33-549d-4b6d-b220-afb641d859c8"
Path Parameters
Body
This structure represent the valid edits operations that can be performed on a dataset. There edit operations are:
- Row edits: These edits are performed on a specific row of the dataset.
- EditMode.id: The edit is performed on the index (numeric index). DEPRECATED
- EditMode.row_id: The edit is performed on the row_id of the row.
- Global edits: These edits are performed on the entire dataset and should not be mixed with row edits.
- EditMode.global_edit
1- DatasetPrependRow
- DatasetAppendRow
- DatasetUpdateRow
- DatasetDeleteRow
- DatasetFilterRows
- DatasetCopyRecordData
- DatasetRemoveColumn
- DatasetRenameColumn
Show child attributes
Show child attributes
Response
Dataset content updated successfully
Was this page helpful?