curl --request POST \
--url https://origami.chat/api/v2/workspaces/{workspaceId}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"filename": "<string>",
"content": "<string>",
"tableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
'import requests
url = "https://origami.chat/api/v2/workspaces/{workspaceId}/documents"
payload = { "files": [
{
"filename": "<string>",
"content": "<string>",
"tableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
] }
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({
files: [
{
filename: '<string>',
content: '<string>',
tableId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
})
};
fetch('https://origami.chat/api/v2/workspaces/{workspaceId}/documents', 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://origami.chat/api/v2/workspaces/{workspaceId}/documents",
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([
'files' => [
[
'filename' => '<string>',
'content' => '<string>',
'tableId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]),
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://origami.chat/api/v2/workspaces/{workspaceId}/documents"
payload := strings.NewReader("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"tableId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\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://origami.chat/api/v2/workspaces/{workspaceId}/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"tableId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://origami.chat/api/v2/workspaces/{workspaceId}/documents")
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 \"files\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"tableId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyUpload files into a workspace (the single ingest verb)
The one ingest path for every file type: base64 file bytes inside
JSON (no multipart). CSVs become new tables (mode: "table", the
default for .csv), append into an existing table (mode: "append"
tableId), or store as documents (mode: "document"); any other extension is stored as a document. Preflight validation is all-or-nothing: the whole request is rejected (count cap, per-file mode/extension/append-target) before any file is ingested. Per-file ingestion can still fail after preflight; the response is201when at least one file landed and422 UPLOAD_FAILEDwhen every file errored. Replaces the deprecatedPOST /workspaces/{workspaceId}/uploadsspelling (same contract).
curl --request POST \
--url https://origami.chat/api/v2/workspaces/{workspaceId}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"filename": "<string>",
"content": "<string>",
"tableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
'import requests
url = "https://origami.chat/api/v2/workspaces/{workspaceId}/documents"
payload = { "files": [
{
"filename": "<string>",
"content": "<string>",
"tableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
] }
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({
files: [
{
filename: '<string>',
content: '<string>',
tableId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
})
};
fetch('https://origami.chat/api/v2/workspaces/{workspaceId}/documents', 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://origami.chat/api/v2/workspaces/{workspaceId}/documents",
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([
'files' => [
[
'filename' => '<string>',
'content' => '<string>',
'tableId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]),
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://origami.chat/api/v2/workspaces/{workspaceId}/documents"
payload := strings.NewReader("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"tableId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\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://origami.chat/api/v2/workspaces/{workspaceId}/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"tableId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://origami.chat/api/v2/workspaces/{workspaceId}/documents")
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 \"files\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"tableId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Transport-level replay protection: any v2 POST may send it
(1-255 printable ASCII characters; UUIDs recommended). The first
response for a key is recorded and replayed verbatim for retries
with the same key + method/path/body for 24 hours; replayed
responses carry the Idempotency-Replay: true response header.
Reusing a key with a different request, or retrying while the
original is still in flight, returns 409 IDEMPOTENCY_ERROR.
5xx responses are never recorded (the retry re-executes).
1 - 255^[\x21-\x7e]{1,255}$Path Parameters
Deprecated container id: a legacy workspace id OR a chat-session id (the session-container form is what v2 returns for new agents). Both resolve everywhere this parameter appears.
Body
Per-request file cap enforced (over it → 413 TOO_MANY_FILES).
1Show child attributes
Show child attributes
Response
Per-file ingest results ({ results: [...] }); individual entries may be kind: "error".