cURL
curl --request PATCH \
--url https://api.cradl.ai/{basePath}/documents/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"groundTruth": [
{
"label": "<string>",
"value": "<string>",
"pages": [
123
],
"rawValue": "<string>",
"confidence": 0.5
}
],
"metadata": {},
"retentionInDays": 913,
"name": "<string>",
"description": "<string>",
"datasetId": "<string>"
}
'import requests
url = "https://api.cradl.ai/{basePath}/documents/{documentId}"
payload = {
"groundTruth": [
{
"label": "<string>",
"value": "<string>",
"pages": [123],
"rawValue": "<string>",
"confidence": 0.5
}
],
"metadata": {},
"retentionInDays": 913,
"name": "<string>",
"description": "<string>",
"datasetId": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
groundTruth: [
{
label: '<string>',
value: '<string>',
pages: [123],
rawValue: '<string>',
confidence: 0.5
}
],
metadata: {},
retentionInDays: 913,
name: '<string>',
description: '<string>',
datasetId: '<string>'
})
};
fetch('https://api.cradl.ai/{basePath}/documents/{documentId}', 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.cradl.ai/{basePath}/documents/{documentId}",
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([
'groundTruth' => [
[
'label' => '<string>',
'value' => '<string>',
'pages' => [
123
],
'rawValue' => '<string>',
'confidence' => 0.5
]
],
'metadata' => [
],
'retentionInDays' => 913,
'name' => '<string>',
'description' => '<string>',
'datasetId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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.cradl.ai/{basePath}/documents/{documentId}"
payload := strings.NewReader("{\n \"groundTruth\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"pages\": [\n 123\n ],\n \"rawValue\": \"<string>\",\n \"confidence\": 0.5\n }\n ],\n \"metadata\": {},\n \"retentionInDays\": 913,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"datasetId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.cradl.ai/{basePath}/documents/{documentId}")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"groundTruth\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"pages\": [\n 123\n ],\n \"rawValue\": \"<string>\",\n \"confidence\": 0.5\n }\n ],\n \"metadata\": {},\n \"retentionInDays\": 913,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"datasetId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cradl.ai/{basePath}/documents/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"groundTruth\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"pages\": [\n 123\n ],\n \"rawValue\": \"<string>\",\n \"confidence\": 0.5\n }\n ],\n \"metadata\": {},\n \"retentionInDays\": 913,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"datasetId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"updatedTime": "<string>",
"metadata": {},
"retentionInDays": 913,
"updatedBy": "<string>",
"description": "<string>",
"createdBy": "<string>",
"name": "<string>",
"createdTime": "<string>",
"documentId": "<string>",
"contentMD5": "<string>",
"ocrFileUrl": "<string>",
"agentRunId": "<string>",
"content": "<string>",
"groundTruth": [
{
"label": "<string>",
"value": "<string>",
"pages": [
123
],
"rawValue": "<string>",
"confidence": 0.5
}
],
"consentId": "<string>",
"datasetId": "<string>",
"fileUrl": "<string>",
"annotationFileUrl": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}API Reference
Update Document
Update Document
PATCH
/
documents
/
{documentId}
cURL
curl --request PATCH \
--url https://api.cradl.ai/{basePath}/documents/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"groundTruth": [
{
"label": "<string>",
"value": "<string>",
"pages": [
123
],
"rawValue": "<string>",
"confidence": 0.5
}
],
"metadata": {},
"retentionInDays": 913,
"name": "<string>",
"description": "<string>",
"datasetId": "<string>"
}
'import requests
url = "https://api.cradl.ai/{basePath}/documents/{documentId}"
payload = {
"groundTruth": [
{
"label": "<string>",
"value": "<string>",
"pages": [123],
"rawValue": "<string>",
"confidence": 0.5
}
],
"metadata": {},
"retentionInDays": 913,
"name": "<string>",
"description": "<string>",
"datasetId": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
groundTruth: [
{
label: '<string>',
value: '<string>',
pages: [123],
rawValue: '<string>',
confidence: 0.5
}
],
metadata: {},
retentionInDays: 913,
name: '<string>',
description: '<string>',
datasetId: '<string>'
})
};
fetch('https://api.cradl.ai/{basePath}/documents/{documentId}', 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.cradl.ai/{basePath}/documents/{documentId}",
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([
'groundTruth' => [
[
'label' => '<string>',
'value' => '<string>',
'pages' => [
123
],
'rawValue' => '<string>',
'confidence' => 0.5
]
],
'metadata' => [
],
'retentionInDays' => 913,
'name' => '<string>',
'description' => '<string>',
'datasetId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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.cradl.ai/{basePath}/documents/{documentId}"
payload := strings.NewReader("{\n \"groundTruth\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"pages\": [\n 123\n ],\n \"rawValue\": \"<string>\",\n \"confidence\": 0.5\n }\n ],\n \"metadata\": {},\n \"retentionInDays\": 913,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"datasetId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.cradl.ai/{basePath}/documents/{documentId}")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"groundTruth\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"pages\": [\n 123\n ],\n \"rawValue\": \"<string>\",\n \"confidence\": 0.5\n }\n ],\n \"metadata\": {},\n \"retentionInDays\": 913,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"datasetId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cradl.ai/{basePath}/documents/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"groundTruth\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"pages\": [\n 123\n ],\n \"rawValue\": \"<string>\",\n \"confidence\": 0.5\n }\n ],\n \"metadata\": {},\n \"retentionInDays\": 913,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"datasetId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"updatedTime": "<string>",
"metadata": {},
"retentionInDays": 913,
"updatedBy": "<string>",
"description": "<string>",
"createdBy": "<string>",
"name": "<string>",
"createdTime": "<string>",
"documentId": "<string>",
"contentMD5": "<string>",
"ocrFileUrl": "<string>",
"agentRunId": "<string>",
"content": "<string>",
"groundTruth": [
{
"label": "<string>",
"value": "<string>",
"pages": [
123
],
"rawValue": "<string>",
"confidence": 0.5
}
],
"consentId": "<string>",
"datasetId": "<string>",
"fileUrl": "<string>",
"annotationFileUrl": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Path Parameters
Body
application/json
Response
200 response
Pattern:
^[0-9]{4}-?[0-9]{2}-?[0-9]{2}( |T)?[0-9]{2}:?[0-9]{2}:?[0-9]{2}(.[0-9]{1,6})?(Z|[+][0-9]{2}(:|)[0-9]{2})$Required range:
1 <= x <= 1825Maximum string length:
4096Maximum string length:
4096Maximum string length:
4096Maximum string length:
4096Pattern:
^[0-9]{4}-?[0-9]{2}-?[0-9]{2}( |T)?[0-9]{2}:?[0-9]{2}:?[0-9]{2}(.[0-9]{1,6})?(Z|[+][0-9]{2}(:|)[0-9]{2})$Pattern:
^(cradl|las):document:[a-f0-9]{32}$Maximum string length:
4096Pattern:
^http://localhost.*|^https://.*Pattern:
^((cradl|las):organization:[a-z0-9-_]+/)?cradl:agent:[a-z0-9-_]+/cradl:run:[a-z0-9-_]+$Required string length:
1 - 6250000Show child attributes
Show child attributes
Pattern:
^las:consent:[a-f0-9]{32}$Pattern:
^(cradl|las):dataset:[a-f0-9]{32}$Pattern:
^http://localhost.*|^https://.*Available options:
application/pdf, image/jpeg, image/png, image/tiff, image/webp, message/rfc822 Pattern:
^http://localhost.*|^https://.*⌘I