Validate Document Api
curl --request POST \
--url https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_id": "<string>",
"rules": [
{
"rule_id": "<string>",
"kind": "stored",
"include_violation_details": true
}
],
"llm_model_prefix": "gemini-2.5-pro",
"attachment_filters": [
{
"name": "<string>",
"id": "<string>",
"mime_type": "<string>"
}
],
"whitelist": [
"<string>"
]
}
'import requests
url = "https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate"
payload = {
"document_id": "<string>",
"rules": [
{
"rule_id": "<string>",
"kind": "stored",
"include_violation_details": True
}
],
"llm_model_prefix": "gemini-2.5-pro",
"attachment_filters": [
{
"name": "<string>",
"id": "<string>",
"mime_type": "<string>"
}
],
"whitelist": ["<string>"]
}
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({
document_id: '<string>',
rules: [{rule_id: '<string>', kind: 'stored', include_violation_details: true}],
llm_model_prefix: 'gemini-2.5-pro',
attachment_filters: [{name: '<string>', id: '<string>', mime_type: '<string>'}],
whitelist: ['<string>']
})
};
fetch('https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate', 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://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate",
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([
'document_id' => '<string>',
'rules' => [
[
'rule_id' => '<string>',
'kind' => 'stored',
'include_violation_details' => true
]
],
'llm_model_prefix' => 'gemini-2.5-pro',
'attachment_filters' => [
[
'name' => '<string>',
'id' => '<string>',
'mime_type' => '<string>'
]
],
'whitelist' => [
'<string>'
]
]),
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://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate"
payload := strings.NewReader("{\n \"document_id\": \"<string>\",\n \"rules\": [\n {\n \"rule_id\": \"<string>\",\n \"kind\": \"stored\",\n \"include_violation_details\": true\n }\n ],\n \"llm_model_prefix\": \"gemini-2.5-pro\",\n \"attachment_filters\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"whitelist\": [\n \"<string>\"\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://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_id\": \"<string>\",\n \"rules\": [\n {\n \"rule_id\": \"<string>\",\n \"kind\": \"stored\",\n \"include_violation_details\": true\n }\n ],\n \"llm_model_prefix\": \"gemini-2.5-pro\",\n \"attachment_filters\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"whitelist\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate")
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 \"document_id\": \"<string>\",\n \"rules\": [\n {\n \"rule_id\": \"<string>\",\n \"kind\": \"stored\",\n \"include_violation_details\": true\n }\n ],\n \"llm_model_prefix\": \"gemini-2.5-pro\",\n \"attachment_filters\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"whitelist\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"document_id": "<string>",
"passed": true,
"violations": [
{
"rule_id": "<string>",
"rule_kind": "regex",
"attachment_id": "<string>",
"attachment_name": "<string>",
"matched_text": "<string>",
"snippet": "<string>",
"explanation": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}document_validation
Validate Document Api
Validate a document against regex, blacklist, and LLM-based rules.
POST
/
assistant
/
api
/
v1
/
tenants
/
{tenant}
/
documents:validate
Validate Document Api
curl --request POST \
--url https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_id": "<string>",
"rules": [
{
"rule_id": "<string>",
"kind": "stored",
"include_violation_details": true
}
],
"llm_model_prefix": "gemini-2.5-pro",
"attachment_filters": [
{
"name": "<string>",
"id": "<string>",
"mime_type": "<string>"
}
],
"whitelist": [
"<string>"
]
}
'import requests
url = "https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate"
payload = {
"document_id": "<string>",
"rules": [
{
"rule_id": "<string>",
"kind": "stored",
"include_violation_details": True
}
],
"llm_model_prefix": "gemini-2.5-pro",
"attachment_filters": [
{
"name": "<string>",
"id": "<string>",
"mime_type": "<string>"
}
],
"whitelist": ["<string>"]
}
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({
document_id: '<string>',
rules: [{rule_id: '<string>', kind: 'stored', include_violation_details: true}],
llm_model_prefix: 'gemini-2.5-pro',
attachment_filters: [{name: '<string>', id: '<string>', mime_type: '<string>'}],
whitelist: ['<string>']
})
};
fetch('https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate', 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://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate",
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([
'document_id' => '<string>',
'rules' => [
[
'rule_id' => '<string>',
'kind' => 'stored',
'include_violation_details' => true
]
],
'llm_model_prefix' => 'gemini-2.5-pro',
'attachment_filters' => [
[
'name' => '<string>',
'id' => '<string>',
'mime_type' => '<string>'
]
],
'whitelist' => [
'<string>'
]
]),
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://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate"
payload := strings.NewReader("{\n \"document_id\": \"<string>\",\n \"rules\": [\n {\n \"rule_id\": \"<string>\",\n \"kind\": \"stored\",\n \"include_violation_details\": true\n }\n ],\n \"llm_model_prefix\": \"gemini-2.5-pro\",\n \"attachment_filters\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"whitelist\": [\n \"<string>\"\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://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_id\": \"<string>\",\n \"rules\": [\n {\n \"rule_id\": \"<string>\",\n \"kind\": \"stored\",\n \"include_violation_details\": true\n }\n ],\n \"llm_model_prefix\": \"gemini-2.5-pro\",\n \"attachment_filters\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"whitelist\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://document-assistant.us.aodocs.app/assistant/api/v1/tenants/{tenant}/documents:validate")
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 \"document_id\": \"<string>\",\n \"rules\": [\n {\n \"rule_id\": \"<string>\",\n \"kind\": \"stored\",\n \"include_violation_details\": true\n }\n ],\n \"llm_model_prefix\": \"gemini-2.5-pro\",\n \"attachment_filters\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"whitelist\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"document_id": "<string>",
"passed": true,
"violations": [
{
"rule_id": "<string>",
"rule_kind": "regex",
"attachment_id": "<string>",
"attachment_name": "<string>",
"matched_text": "<string>",
"snippet": "<string>",
"explanation": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The domain of the customer
Example:
"example.com"
Body
application/json
The document ID of the files
rules
(StoredRuleRef · object | RegexRule · object | BlacklistRule · object | LlmRule · object)[]
required
Validation rules to execute against the selected attachments.
Minimum array length:
1- StoredRuleRef
- RegexRule
- BlacklistRule
- LlmRule
Show child attributes
Show child attributes
The LLM provider to use. If not provided, the default provider will be used.
Available options:
OpenAI, Google, Altirnao, MistralAI, Anthropic The prefix of the LLM model name to use. If not provided, the default model will be used.
Example:
"gemini-2.5-pro"
Optional attachment filters. If omitted, all attachments are validated.
Show child attributes
Show child attributes
Values that should be ignored even if one of the rules detects them.