Start Validation
curl --request POST \
--url https://api.example.com/api/validate_stream_start/ \
--header 'Content-Type: application/json' \
--data '
{
"job_id": "<string>",
"document_category": "<string>",
"document_metadata": {}
}
'import requests
url = "https://api.example.com/api/validate_stream_start/"
payload = {
"job_id": "<string>",
"document_category": "<string>",
"document_metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({job_id: '<string>', document_category: '<string>', document_metadata: {}})
};
fetch('https://api.example.com/api/validate_stream_start/', 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.example.com/api/validate_stream_start/",
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([
'job_id' => '<string>',
'document_category' => '<string>',
'document_metadata' => [
]
]),
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.example.com/api/validate_stream_start/"
payload := strings.NewReader("{\n \"job_id\": \"<string>\",\n \"document_category\": \"<string>\",\n \"document_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/validate_stream_start/")
.header("Content-Type", "application/json")
.body("{\n \"job_id\": \"<string>\",\n \"document_category\": \"<string>\",\n \"document_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/validate_stream_start/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"job_id\": \"<string>\",\n \"document_category\": \"<string>\",\n \"document_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"job_id": "abc123def456",
"status": "accepted",
"message": "Validation request queued for processing",
"timestamp": "2026-01-08T10:30:00Z",
"document_size": 1048576,
"next_steps": {
"poll_results": "POST /api/validate_stream_result/ with {\"job_id\": \"abc123def456\"}"
}
}
Validation
Start Validation
Trigger validation after S3 upload
POST
/
api
/
validate_stream_start
/
Start Validation
curl --request POST \
--url https://api.example.com/api/validate_stream_start/ \
--header 'Content-Type: application/json' \
--data '
{
"job_id": "<string>",
"document_category": "<string>",
"document_metadata": {}
}
'import requests
url = "https://api.example.com/api/validate_stream_start/"
payload = {
"job_id": "<string>",
"document_category": "<string>",
"document_metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({job_id: '<string>', document_category: '<string>', document_metadata: {}})
};
fetch('https://api.example.com/api/validate_stream_start/', 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.example.com/api/validate_stream_start/",
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([
'job_id' => '<string>',
'document_category' => '<string>',
'document_metadata' => [
]
]),
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.example.com/api/validate_stream_start/"
payload := strings.NewReader("{\n \"job_id\": \"<string>\",\n \"document_category\": \"<string>\",\n \"document_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/validate_stream_start/")
.header("Content-Type", "application/json")
.body("{\n \"job_id\": \"<string>\",\n \"document_category\": \"<string>\",\n \"document_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/validate_stream_start/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"job_id\": \"<string>\",\n \"document_category\": \"<string>\",\n \"document_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"job_id": "abc123def456",
"status": "accepted",
"message": "Validation request queued for processing",
"timestamp": "2026-01-08T10:30:00Z",
"document_size": 1048576,
"next_steps": {
"poll_results": "POST /api/validate_stream_result/ with {\"job_id\": \"abc123def456\"}"
}
}
Trigger validation after uploading a document via presigned URL.
Request Body
Job ID from the presigned URL response
Override document category from presigned URL request
Override document metadata from presigned URL request
Response
Unique identifier for the validation job
Job status:
acceptedStatus message
ISO 8601 timestamp
Size of the uploaded document in bytes
Instructions for retrieving results
{
"job_id": "abc123def456",
"status": "accepted",
"message": "Validation request queued for processing",
"timestamp": "2026-01-08T10:30:00Z",
"document_size": 1048576,
"next_steps": {
"poll_results": "POST /api/validate_stream_result/ with {\"job_id\": \"abc123def456\"}"
}
}
Error Responses
| Status | Description |
|---|---|
| 400 | Missing job_id or document_category/metadata |
| 404 | Document not found in S3 |
| 409 | Job already started or completed |
Example
curl -X POST "https://{api-url}/api/validate_stream_start/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"job_id": "abc123def456"
}'
import requests
API_KEY = "YOUR_API_KEY"
API_BASE = "https://{api-url}"
response = requests.post(
f"{API_BASE}/api/validate_stream_start/",
headers={
"x-api-key": API_KEY,
"Content-Type": "application/json"
},
json={
"job_id": "abc123def456"
}
)
print(response.json())
const axios = require('axios');
const API_KEY = 'YOUR_API_KEY';
const API_BASE = 'https://{api-url}';
const response = await axios.post(
`${API_BASE}/api/validate_stream_start/`,
{
job_id: 'abc123def456'
},
{
headers: {
'x-api-key': API_KEY,
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
⌘I

