Sync extract
curl --request POST \
--url https://api2.documate.ai/api/v1/queues/{queueId}/extract \
--header 'Content-Type: multipart/form-data' \
--header 'X-Api-Key: <api-key>' \
--form file='@example-file' \
--form 'documentTypeKey=<string>' \
--form documentCount=123import fs from 'fs';
const formData = new FormData();
formData.append('file', await new Response(fs.createReadStream('example-file')).blob());
formData.append('documentTypeKey', '<string>');
formData.append('documentCount', '123');
const url = 'https://api2.documate.ai/api/v1/queues/{queueId}/extract';
const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}, body: formData};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api2.documate.ai/api/v1/queues/{queueId}/extract"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"documentTypeKey": "<string>",
"documentCount": "123"
}
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api2.documate.ai/api/v1/queues/{queueId}/extract");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("X-Api-Key", "<api-key>");
request.AddFile("file", "example-file");
request.AddParameter("documentTypeKey", "<string>");
request.AddParameter("documentCount", "123");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api2.documate.ai/api/v1/queues/{queueId}/extract",
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=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentTypeKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentCount\"\r\n\r\n123\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileStatus": "<string>",
"timedOut": true,
"fileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentTypeId": 123,
"documentTypeKey": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publicStatusKey": "<string>",
"internalStageKey": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"resultJson": null,
"webhookStatusKey": "<string>",
"webhookAttempts": 123,
"webhookLastHttpStatus": 123,
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"downloadUrlExpiresAt": "2023-11-07T05:31:56Z"
}
],
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileStatus": "<string>",
"timedOut": true,
"fileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentTypeId": 123,
"documentTypeKey": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publicStatusKey": "<string>",
"internalStageKey": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"resultJson": null,
"webhookStatusKey": "<string>",
"webhookAttempts": 123,
"webhookLastHttpStatus": 123,
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"downloadUrlExpiresAt": "2023-11-07T05:31:56Z"
}
],
"error": "<string>"
}Uploads
Sync extract
Upload one file and wait for a single-document extract. Does not send webhooks. Prefer async upload for multi-document packs.
POST
/
api
/
v1
/
queues
/
{queueId}
/
extract
Sync extract
curl --request POST \
--url https://api2.documate.ai/api/v1/queues/{queueId}/extract \
--header 'Content-Type: multipart/form-data' \
--header 'X-Api-Key: <api-key>' \
--form file='@example-file' \
--form 'documentTypeKey=<string>' \
--form documentCount=123import fs from 'fs';
const formData = new FormData();
formData.append('file', await new Response(fs.createReadStream('example-file')).blob());
formData.append('documentTypeKey', '<string>');
formData.append('documentCount', '123');
const url = 'https://api2.documate.ai/api/v1/queues/{queueId}/extract';
const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}, body: formData};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api2.documate.ai/api/v1/queues/{queueId}/extract"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"documentTypeKey": "<string>",
"documentCount": "123"
}
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api2.documate.ai/api/v1/queues/{queueId}/extract");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("X-Api-Key", "<api-key>");
request.AddFile("file", "example-file");
request.AddParameter("documentTypeKey", "<string>");
request.AddParameter("documentCount", "123");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api2.documate.ai/api/v1/queues/{queueId}/extract",
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=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentTypeKey\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentCount\"\r\n\r\n123\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileStatus": "<string>",
"timedOut": true,
"fileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentTypeId": 123,
"documentTypeKey": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publicStatusKey": "<string>",
"internalStageKey": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"resultJson": null,
"webhookStatusKey": "<string>",
"webhookAttempts": 123,
"webhookLastHttpStatus": 123,
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"downloadUrlExpiresAt": "2023-11-07T05:31:56Z"
}
],
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileStatus": "<string>",
"timedOut": true,
"fileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentTypeId": 123,
"documentTypeKey": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publicStatusKey": "<string>",
"internalStageKey": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"resultJson": null,
"webhookStatusKey": "<string>",
"webhookAttempts": 123,
"webhookLastHttpStatus": 123,
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"downloadUrlExpiresAt": "2023-11-07T05:31:56Z"
}
],
"error": "<string>"
}Authorizations
API key from the Documate app (Settings → API keys). You may also send Authorization: ApiKey YOUR_API_KEY.
Path Parameters
Body
multipart/form-data