Create Document
curl --request POST \
--url https://api.stax.ai/document/create \
--header 'Content-Type: application/json' \
--cookie authToken= \
--data '
{
"name": "<string>",
"stackId": "<string>",
"source": "<string>",
"metadata": [
{
"key": "<string>",
"value": "<string>",
"expression": "<string>",
"class": "<string>",
"tags": [
123
],
"pages": [
123
],
"ref": "<string>",
"confidence": 123
}
],
"importKey": "<string>"
}
'import requests
url = "https://api.stax.ai/document/create"
payload = {
"name": "<string>",
"stackId": "<string>",
"source": "<string>",
"metadata": [
{
"key": "<string>",
"value": "<string>",
"expression": "<string>",
"class": "<string>",
"tags": [123],
"pages": [123],
"ref": "<string>",
"confidence": 123
}
],
"importKey": "<string>"
}
headers = {
"cookie": "authToken=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'authToken=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
stackId: '<string>',
source: '<string>',
metadata: [
{
key: '<string>',
value: '<string>',
expression: '<string>',
class: '<string>',
tags: [123],
pages: [123],
ref: '<string>',
confidence: 123
}
],
importKey: '<string>'
})
};
fetch('https://api.stax.ai/document/create', 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/create",
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([
'name' => '<string>',
'stackId' => '<string>',
'source' => '<string>',
'metadata' => [
[
'key' => '<string>',
'value' => '<string>',
'expression' => '<string>',
'class' => '<string>',
'tags' => [
123
],
'pages' => [
123
],
'ref' => '<string>',
'confidence' => 123
]
],
'importKey' => '<string>'
]),
CURLOPT_COOKIE => "authToken=",
CURLOPT_HTTPHEADER => [
"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://api.stax.ai/document/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"stackId\": \"<string>\",\n \"source\": \"<string>\",\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"expression\": \"<string>\",\n \"class\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"pages\": [\n 123\n ],\n \"ref\": \"<string>\",\n \"confidence\": 123\n }\n ],\n \"importKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "authToken=")
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://api.stax.ai/document/create")
.header("cookie", "authToken=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"stackId\": \"<string>\",\n \"source\": \"<string>\",\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"expression\": \"<string>\",\n \"class\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"pages\": [\n 123\n ],\n \"ref\": \"<string>\",\n \"confidence\": 123\n }\n ],\n \"importKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stax.ai/document/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'authToken='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"stackId\": \"<string>\",\n \"source\": \"<string>\",\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"expression\": \"<string>\",\n \"class\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"pages\": [\n 123\n ],\n \"ref\": \"<string>\",\n \"confidence\": 123\n }\n ],\n \"importKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"doc": {
"_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>"
},
"uploadUrl": "<string>"
}Document
Create Document
Create a document using presigned URL
POST
/
document
/
create
Create Document
curl --request POST \
--url https://api.stax.ai/document/create \
--header 'Content-Type: application/json' \
--cookie authToken= \
--data '
{
"name": "<string>",
"stackId": "<string>",
"source": "<string>",
"metadata": [
{
"key": "<string>",
"value": "<string>",
"expression": "<string>",
"class": "<string>",
"tags": [
123
],
"pages": [
123
],
"ref": "<string>",
"confidence": 123
}
],
"importKey": "<string>"
}
'import requests
url = "https://api.stax.ai/document/create"
payload = {
"name": "<string>",
"stackId": "<string>",
"source": "<string>",
"metadata": [
{
"key": "<string>",
"value": "<string>",
"expression": "<string>",
"class": "<string>",
"tags": [123],
"pages": [123],
"ref": "<string>",
"confidence": 123
}
],
"importKey": "<string>"
}
headers = {
"cookie": "authToken=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'authToken=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
stackId: '<string>',
source: '<string>',
metadata: [
{
key: '<string>',
value: '<string>',
expression: '<string>',
class: '<string>',
tags: [123],
pages: [123],
ref: '<string>',
confidence: 123
}
],
importKey: '<string>'
})
};
fetch('https://api.stax.ai/document/create', 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/create",
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([
'name' => '<string>',
'stackId' => '<string>',
'source' => '<string>',
'metadata' => [
[
'key' => '<string>',
'value' => '<string>',
'expression' => '<string>',
'class' => '<string>',
'tags' => [
123
],
'pages' => [
123
],
'ref' => '<string>',
'confidence' => 123
]
],
'importKey' => '<string>'
]),
CURLOPT_COOKIE => "authToken=",
CURLOPT_HTTPHEADER => [
"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://api.stax.ai/document/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"stackId\": \"<string>\",\n \"source\": \"<string>\",\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"expression\": \"<string>\",\n \"class\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"pages\": [\n 123\n ],\n \"ref\": \"<string>\",\n \"confidence\": 123\n }\n ],\n \"importKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "authToken=")
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://api.stax.ai/document/create")
.header("cookie", "authToken=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"stackId\": \"<string>\",\n \"source\": \"<string>\",\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"expression\": \"<string>\",\n \"class\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"pages\": [\n 123\n ],\n \"ref\": \"<string>\",\n \"confidence\": 123\n }\n ],\n \"importKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stax.ai/document/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'authToken='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"stackId\": \"<string>\",\n \"source\": \"<string>\",\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"expression\": \"<string>\",\n \"class\": \"<string>\",\n \"tags\": [\n 123\n ],\n \"pages\": [\n 123\n ],\n \"ref\": \"<string>\",\n \"confidence\": 123\n }\n ],\n \"importKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"doc": {
"_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>"
},
"uploadUrl": "<string>"
}Authorizations
cookieAuthbearerAuth
Cookie-based authentication using userId and authToken cookies
Body
application/json
⌘I