Skip to main content
PATCH
/
api
/
datasets
/
{id}
/
rows
/
{row-id}
Update a Single Row
curl --request PATCH \
  --url https://app.baseplate.ai/api/datasets/{id}/rows/{row-id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": {},
  "metadata": {}
}
'
import requests

url = "https://app.baseplate.ai/api/datasets/{id}/rows/{row-id}"

payload = {
"data": {},
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {}, metadata: {}})
};

fetch('https://app.baseplate.ai/api/datasets/{id}/rows/{row-id}', 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://app.baseplate.ai/api/datasets/{id}/rows/{row-id}",
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([
'data' => [

],
'metadata' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://app.baseplate.ai/api/datasets/{id}/rows/{row-id}"

payload := strings.NewReader("{\n \"data\": {},\n \"metadata\": {}\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "<authorization>")
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://app.baseplate.ai/api/datasets/{id}/rows/{row-id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.baseplate.ai/api/datasets/{id}/rows/{row-id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {},\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body

Path Parameters

id
string
required
Dataset ID
row-id
string
required
Row ID
Authorization
string
required
Baseplate API key. Must be in the format β€œBearer $BASEPLATE_API_KEY”
Content-Type
string
Use application/json

Body

data
object
required
Updated data. Each key in this object should match a column in your dataset. Format is same as above example for insertion. One of metadata or data is required.
metadata
object
required
Updated metadata. One of metadata or data is required.

Responses

🟒 200: OK
{
  "id": 949495,
  "dataset_id": "354ee3c7-891b-4635-9613-857debf92233",
  "data": {
    "text": "Example"
  },
  "metadata": {
    "url": "/354ee3c7-891b-4635-9613-857debf92233/Example.pdf",
    "rowId": 949495,
    "documentId": "dad19711-b4b8-4e75-8944-2939bfeb06db"
  },
  "document_id": "dad19711-b4b8-4e75-8944-2939bfeb06db",
  "image_paths": {
    "img": "354ee3c7-891b-4635-9613-857debf92233/dad19711-b4b8-4e75-8944-2939bfeb06db/949495/img"
  }
}