curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/run/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@/path/to/document.pdf'
curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/run/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'text=Invoice #12345 from Acme Corp. Total: $1,250.00'
import requests
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://api.anyformat.ai/v2/workflows/{workflow_id}/run/"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
with open('document.pdf', 'rb') as f:
response = requests.post(
url,
headers=headers,
files={'file': f}
)
print(response.json())
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(`https://api.anyformat.ai/v2/workflows/${workflowId}/run/`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
interface WorkflowRunResponse {
id: string;
status: string;
workflow_id: string;
}
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(
`https://api.anyformat.ai/v2/workflows/${workflowId}/run/`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
}
);
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const data: WorkflowRunResponse = await response.json();
console.log(data.id);
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"workflow_id": "550e8400-e29b-41d4-a716-446655440000",
"version_id": "FGaV4I2JAA"
}
Run Workflow
Submit a file or text for processing using a workflow
curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/run/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@/path/to/document.pdf'
curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/run/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'text=Invoice #12345 from Acme Corp. Total: $1,250.00'
import requests
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://api.anyformat.ai/v2/workflows/{workflow_id}/run/"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
with open('document.pdf', 'rb') as f:
response = requests.post(
url,
headers=headers,
files={'file': f}
)
print(response.json())
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(`https://api.anyformat.ai/v2/workflows/${workflowId}/run/`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
interface WorkflowRunResponse {
id: string;
status: string;
workflow_id: string;
}
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(
`https://api.anyformat.ai/v2/workflows/${workflowId}/run/`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
}
);
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const data: WorkflowRunResponse = await response.json();
console.log(data.id);
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"workflow_id": "550e8400-e29b-41d4-a716-446655440000",
"version_id": "FGaV4I2JAA"
}
id is the file_collection_id, never a file_id. Poll for results with GET /v2/workflows/{workflow_id}/files/{id}/results/. That path segment reads files, but it takes the collection id. The endpoint returns 412 while processing and 200 once results are ready. See Packets and files.
Input Methods
Submit content in one of two ways:- File upload. Send a binary file as multipart form data.
- Text input. Send plain text.
file or text, never both.curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/run/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@/path/to/document.pdf'
curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/run/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'text=Invoice #12345 from Acme Corp. Total: $1,250.00'
import requests
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://api.anyformat.ai/v2/workflows/{workflow_id}/run/"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
with open('document.pdf', 'rb') as f:
response = requests.post(
url,
headers=headers,
files={'file': f}
)
print(response.json())
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(`https://api.anyformat.ai/v2/workflows/${workflowId}/run/`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
interface WorkflowRunResponse {
id: string;
status: string;
workflow_id: string;
}
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(
`https://api.anyformat.ai/v2/workflows/${workflowId}/run/`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
}
);
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const data: WorkflowRunResponse = await response.json();
console.log(data.id);
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"workflow_id": "550e8400-e29b-41d4-a716-446655440000",
"version_id": "FGaV4I2JAA"
}
Authorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Headers
Path Parameters
Body
Response
Successful Response
Response after triggering a workflow run. Contains the collection ID to use for polling extraction results.
The collection UUID for this run. Use this ID to poll for results via GET /v2/workflows/{workflow_id}/files/{id}/results/.
"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"
Initial status of the run: queued (the run was accepted and enqueued, not that extraction is complete). Use GET /v2/workflows/{workflow_id}/files/{id}/results/ to poll the run through its in_progress / processed lifecycle.
not_started, queued, in_progress, processed, error, cancelled "queued"
The UUID of the workflow that was executed.
"0686bb97-8c30-70f0-8000-97669e000eb8"
The workflow version this run was bound to (the latest version at submission time). Lets callers verify which schema produced the results — useful right after an edit.
"FGaV4I2JAA"

