Upload Document
curl --request POST \
--url https://api.stax.ai/document/upload \
--header 'Content-Type: multipart/form-data' \
--cookie authToken= \
--form 'files=<string>' \
--form 'stackId=<string>' \
--form source=Uploaded \
--form 'metadata=<string>' \
--form 'importKey=<string>' \
--form skipProcessing=true \
--form files.items='@example-file'import requests
url = "https://api.stax.ai/document/upload"
files = { "files.items": ("example-file", open("example-file", "rb")) }
payload = {
"files": "<string>",
"stackId": "<string>",
"source": "Uploaded",
"metadata": "<string>",
"importKey": "<string>",
"skipProcessing": "true"
}
headers = {"cookie": "authToken="}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('stackId', '<string>');
form.append('source', 'Uploaded');
form.append('metadata', '<string>');
form.append('importKey', '<string>');
form.append('skipProcessing', 'true');
form.append('files.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {cookie: 'authToken='}};
options.body = form;
fetch('https://api.stax.ai/document/upload', 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.stax.ai/document/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_COOKIE => "authToken=",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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.stax.ai/document/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "authToken=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.stax.ai/document/upload")
.header("cookie", "authToken=")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stax.ai/document/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'authToken='
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"uploads": [
{
"_id": "<string>",
"team": "<string>",
"stack": "<string>",
"name": "<string>",
"originalName": "<string>",
"format": "<string>",
"download": "<string>",
"thumbnail": "<string>",
"source": "<string>",
"sourceUrl": "<string>",
"provider": {},
"importKey": "<string>",
"pages": [
"<string>"
],
"rotations": {},
"aspects": {},
"job": {
"upload": "<string>",
"working": true,
"worker": "<string>",
"status": "<string>",
"success": true,
"error": "<string>",
"read": {
"operationUrls": [
"<string>"
],
"fetchTime": "2023-11-07T05:31:56Z"
},
"rc": {
"preproc": "<string>",
"sort": "<string>",
"postproc": "<string>"
}
},
"urgent": true,
"deadline": "2023-11-07T05:31:56Z",
"flagged": true,
"pinned": true,
"flags": [
{
"timestamp": "2023-11-07T05:31:56Z",
"title": "<string>",
"description": "<string>",
"pages": [
123
]
}
],
"reviewed": true,
"archived": true,
"assignee": "<string>",
"sharing": {
"public": true,
"protected": {
"emails": [
"<string>"
],
"teams": [
"<string>"
],
"password": "<string>"
},
"access": [
{
"email": "<string>",
"usage": 123
}
]
},
"checksum": "<string>",
"metadata": [
{
"key": "<string>",
"value": "<string>",
"expression": "<string>",
"class": "<string>",
"tags": [
123
],
"pages": [
123
],
"ref": "<string>",
"confidence": 123
}
],
"fillable": {
"enabled": true,
"fields": [
{
"key": "<string>",
"required": true,
"hint": "<string>",
"fontSize": 123,
"page": 123,
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"recipients": [
{
"document": "<string>",
"email": "<string>",
"name": "<string>",
"sentOn": "2023-11-07T05:31:56Z",
"viewedOn": "2023-11-07T05:31:56Z",
"filledOn": "2023-11-07T05:31:56Z"
}
]
},
"keywords": [
"<string>"
],
"bounds": [
{
"label": "<string>",
"data": {},
"page": 123,
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"tables": [
{
"raw": true,
"title": "<string>",
"lastModified": "2023-11-07T05:31:56Z",
"createdON": "2023-11-07T05:31:56Z",
"page": 123,
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"headers": [
"<string>"
],
"tags": [
{
"row": 123,
"col": 123,
"key": "<string>"
}
],
"rows": [
{
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"page": 123,
"cells": [
{
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"text": "<string>",
"confidence": 123
}
],
"class": "<string>",
"classConfidence": 123
}
]
}
],
"split": [
{
"pages": [
123
],
"toNext": true,
"name": "<string>"
}
],
"notes": [
{
"page": 123,
"thread": [
{
"text": "<string>",
"user": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"tags": [
"<string>"
],
"x": 123,
"y": 123
}
],
"canvas": {},
"bulk": true,
"original": "<string>",
"splitFrom": "<string>",
"attachments": [
{
"filename": "<string>",
"document": "<string>",
"filepath": "<string>"
}
],
"time": [
{
"event": "<string>",
"stamp": "2023-11-07T05:31:56Z",
"user": "<string>"
}
],
"viewed": {},
"sync": [
{
"user": "<string>",
"key": "<string>",
"path": "<string>",
"override": true,
"error": "<string>",
"step": "<string>",
"job": "<string>",
"isSynced": true,
"queuedOn": "2023-11-07T05:31:56Z",
"syncedOn": "2023-11-07T05:31:56Z"
}
],
"receivedOn": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"nextStack": "<string>",
"sender": "<string>"
}
]
}{
"success": false,
"error": "<string>",
"authError": true
}Document
Upload Document
Upload one or more documents (up to 10 files)
POST
/
document
/
upload
Upload Document
curl --request POST \
--url https://api.stax.ai/document/upload \
--header 'Content-Type: multipart/form-data' \
--cookie authToken= \
--form 'files=<string>' \
--form 'stackId=<string>' \
--form source=Uploaded \
--form 'metadata=<string>' \
--form 'importKey=<string>' \
--form skipProcessing=true \
--form files.items='@example-file'import requests
url = "https://api.stax.ai/document/upload"
files = { "files.items": ("example-file", open("example-file", "rb")) }
payload = {
"files": "<string>",
"stackId": "<string>",
"source": "Uploaded",
"metadata": "<string>",
"importKey": "<string>",
"skipProcessing": "true"
}
headers = {"cookie": "authToken="}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('stackId', '<string>');
form.append('source', 'Uploaded');
form.append('metadata', '<string>');
form.append('importKey', '<string>');
form.append('skipProcessing', 'true');
form.append('files.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {cookie: 'authToken='}};
options.body = form;
fetch('https://api.stax.ai/document/upload', 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.stax.ai/document/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_COOKIE => "authToken=",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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.stax.ai/document/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "authToken=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.stax.ai/document/upload")
.header("cookie", "authToken=")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stax.ai/document/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'authToken='
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"stackId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"\r\n\r\nUploaded\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadata\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"skipProcessing\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"uploads": [
{
"_id": "<string>",
"team": "<string>",
"stack": "<string>",
"name": "<string>",
"originalName": "<string>",
"format": "<string>",
"download": "<string>",
"thumbnail": "<string>",
"source": "<string>",
"sourceUrl": "<string>",
"provider": {},
"importKey": "<string>",
"pages": [
"<string>"
],
"rotations": {},
"aspects": {},
"job": {
"upload": "<string>",
"working": true,
"worker": "<string>",
"status": "<string>",
"success": true,
"error": "<string>",
"read": {
"operationUrls": [
"<string>"
],
"fetchTime": "2023-11-07T05:31:56Z"
},
"rc": {
"preproc": "<string>",
"sort": "<string>",
"postproc": "<string>"
}
},
"urgent": true,
"deadline": "2023-11-07T05:31:56Z",
"flagged": true,
"pinned": true,
"flags": [
{
"timestamp": "2023-11-07T05:31:56Z",
"title": "<string>",
"description": "<string>",
"pages": [
123
]
}
],
"reviewed": true,
"archived": true,
"assignee": "<string>",
"sharing": {
"public": true,
"protected": {
"emails": [
"<string>"
],
"teams": [
"<string>"
],
"password": "<string>"
},
"access": [
{
"email": "<string>",
"usage": 123
}
]
},
"checksum": "<string>",
"metadata": [
{
"key": "<string>",
"value": "<string>",
"expression": "<string>",
"class": "<string>",
"tags": [
123
],
"pages": [
123
],
"ref": "<string>",
"confidence": 123
}
],
"fillable": {
"enabled": true,
"fields": [
{
"key": "<string>",
"required": true,
"hint": "<string>",
"fontSize": 123,
"page": 123,
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"recipients": [
{
"document": "<string>",
"email": "<string>",
"name": "<string>",
"sentOn": "2023-11-07T05:31:56Z",
"viewedOn": "2023-11-07T05:31:56Z",
"filledOn": "2023-11-07T05:31:56Z"
}
]
},
"keywords": [
"<string>"
],
"bounds": [
{
"label": "<string>",
"data": {},
"page": 123,
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"tables": [
{
"raw": true,
"title": "<string>",
"lastModified": "2023-11-07T05:31:56Z",
"createdON": "2023-11-07T05:31:56Z",
"page": 123,
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"headers": [
"<string>"
],
"tags": [
{
"row": 123,
"col": 123,
"key": "<string>"
}
],
"rows": [
{
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"page": 123,
"cells": [
{
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"text": "<string>",
"confidence": 123
}
],
"class": "<string>",
"classConfidence": 123
}
]
}
],
"split": [
{
"pages": [
123
],
"toNext": true,
"name": "<string>"
}
],
"notes": [
{
"page": 123,
"thread": [
{
"text": "<string>",
"user": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"tags": [
"<string>"
],
"x": 123,
"y": 123
}
],
"canvas": {},
"bulk": true,
"original": "<string>",
"splitFrom": "<string>",
"attachments": [
{
"filename": "<string>",
"document": "<string>",
"filepath": "<string>"
}
],
"time": [
{
"event": "<string>",
"stamp": "2023-11-07T05:31:56Z",
"user": "<string>"
}
],
"viewed": {},
"sync": [
{
"user": "<string>",
"key": "<string>",
"path": "<string>",
"override": true,
"error": "<string>",
"step": "<string>",
"job": "<string>",
"isSynced": true,
"queuedOn": "2023-11-07T05:31:56Z",
"syncedOn": "2023-11-07T05:31:56Z"
}
],
"receivedOn": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"nextStack": "<string>",
"sender": "<string>"
}
]
}{
"success": false,
"error": "<string>",
"authError": true
}Authorizations
cookieAuthbearerAuthmoduleAuth
Cookie-based authentication using userId and authToken cookies
Body
multipart/form-data
⌘I