cURL
curl --request POST \
--url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/plain' \
--data '
{
"column_name": "file",
"metadata": {
"_oxen": {
"render": {
"func": "image"
}
}
}
}
'import requests
url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}"
payload = {
"column_name": "file",
"metadata": { "_oxen": { "render": { "func": "image" } } }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "text/plain"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/plain'},
body: JSON.stringify({column_name: 'file', metadata: {_oxen: {render: {func: 'image'}}}})
};
fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}', 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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}",
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([
'column_name' => 'file',
'metadata' => [
'_oxen' => [
'render' => [
'func' => 'image'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: text/plain"
],
]);
$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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}"
payload := strings.NewReader("{\n \"column_name\": \"file\",\n \"metadata\": {\n \"_oxen\": {\n \"render\": {\n \"func\": \"image\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "text/plain")
.body("{\n \"column_name\": \"file\",\n \"metadata\": {\n \"_oxen\": {\n \"render\": {\n \"func\": \"image\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}")
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"] = 'text/plain'
request.body = "{\n \"column_name\": \"file\",\n \"metadata\": {\n \"_oxen\": {\n \"render\": {\n \"func\": \"image\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"status_message": "<string>",
"oxen_version": "<string>"
}Workspace Data Frames
Post apirepos workspaces data framescolumnsschemametadata
Set the metadata on a single column of a data frame, the HTTP equivalent of oxen schemas add <path> -c <column> -m '{...}'. Staged into the workspace, so no commit is required. Replaces that column’s existing metadata wholesale.
POST
/
api
/
repos
/
{namespace}
/
{repo_name}
/
workspaces
/
{workspace_id}
/
data_frames
/
columns
/
schema
/
metadata
/
{path}
cURL
curl --request POST \
--url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/plain' \
--data '
{
"column_name": "file",
"metadata": {
"_oxen": {
"render": {
"func": "image"
}
}
}
}
'import requests
url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}"
payload = {
"column_name": "file",
"metadata": { "_oxen": { "render": { "func": "image" } } }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "text/plain"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/plain'},
body: JSON.stringify({column_name: 'file', metadata: {_oxen: {render: {func: 'image'}}}})
};
fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}', 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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}",
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([
'column_name' => 'file',
'metadata' => [
'_oxen' => [
'render' => [
'func' => 'image'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: text/plain"
],
]);
$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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}"
payload := strings.NewReader("{\n \"column_name\": \"file\",\n \"metadata\": {\n \"_oxen\": {\n \"render\": {\n \"func\": \"image\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "text/plain")
.body("{\n \"column_name\": \"file\",\n \"metadata\": {\n \"_oxen\": {\n \"render\": {\n \"func\": \"image\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/data_frames/columns/schema/metadata/{path}")
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"] = 'text/plain'
request.body = "{\n \"column_name\": \"file\",\n \"metadata\": {\n \"_oxen\": {\n \"render\": {\n \"func\": \"image\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"status_message": "<string>",
"oxen_version": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Namespace of the repository
Name of the repository
ID or name of the workspace
Path to the data frame within the repository
Body
text/plain
The column to annotate and the metadata to store on it. _oxen.render.func controls how oxen renders the column's values.
The body is of type string.
⌘I