TypeScript SDK
import { Orchata } from '@orchata-ai/sdk';
const client = new Orchata({ apiKey: 'oai_your_api_key' });
const { space } = await client.spaces.update('space_123', {
name: 'Updated Name',
description: 'New description'
});curl --request PATCH \
--url https://api.orchata.ai/api/spaces/{id} \
--header 'Content-Type: application/json' \
--header 'Oai-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"slug": "<string>",
"isArchived": true,
"metadata": {}
}
'import requests
url = "https://api.orchata.ai/api/spaces/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"slug": "<string>",
"isArchived": True,
"metadata": {}
}
headers = {
"Oai-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Oai-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
slug: '<string>',
isArchived: true,
metadata: {}
})
};
fetch('https://api.orchata.ai/api/spaces/{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://api.orchata.ai/api/spaces/{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([
'name' => '<string>',
'description' => '<string>',
'slug' => '<string>',
'isArchived' => true,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Oai-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.orchata.ai/api/spaces/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"slug\": \"<string>\",\n \"isArchived\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Oai-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.orchata.ai/api/spaces/{id}")
.header("Oai-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"slug\": \"<string>\",\n \"isArchived\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orchata.ai/api/spaces/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Oai-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"slug\": \"<string>\",\n \"isArchived\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"space": {
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"slug": "<string>",
"icon": "folder",
"description": "<string>",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {}
}
}Spaces
Update Space
Update an existing space’s name, description, icon, slug, or archive status
PATCH
/
api
/
spaces
/
{id}
TypeScript SDK
import { Orchata } from '@orchata-ai/sdk';
const client = new Orchata({ apiKey: 'oai_your_api_key' });
const { space } = await client.spaces.update('space_123', {
name: 'Updated Name',
description: 'New description'
});curl --request PATCH \
--url https://api.orchata.ai/api/spaces/{id} \
--header 'Content-Type: application/json' \
--header 'Oai-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"slug": "<string>",
"isArchived": true,
"metadata": {}
}
'import requests
url = "https://api.orchata.ai/api/spaces/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"slug": "<string>",
"isArchived": True,
"metadata": {}
}
headers = {
"Oai-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Oai-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
slug: '<string>',
isArchived: true,
metadata: {}
})
};
fetch('https://api.orchata.ai/api/spaces/{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://api.orchata.ai/api/spaces/{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([
'name' => '<string>',
'description' => '<string>',
'slug' => '<string>',
'isArchived' => true,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Oai-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.orchata.ai/api/spaces/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"slug\": \"<string>\",\n \"isArchived\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Oai-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.orchata.ai/api/spaces/{id}")
.header("Oai-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"slug\": \"<string>\",\n \"isArchived\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orchata.ai/api/spaces/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Oai-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"slug\": \"<string>\",\n \"isArchived\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"space": {
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"slug": "<string>",
"icon": "folder",
"description": "<string>",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {}
}
}Authorizations
Path Parameters
Example:
"space_123"
Body
application/json
Space update data
Required string length:
1 - 100Available options:
folder, book, file-text, database, package, archive, briefcase, inbox, layers, box Required string length:
1 - 500Required string length:
1 - 100Pattern:
^[a-z0-9]+(?:-[a-z0-9]+)*$Show child attributes
Show child attributes
Response
Space updated successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I