curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/files/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run/' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
file_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" # file_id from upload
url = f"https://api.anyformat.ai/v2/workflows/{workflow_id}/files/{file_id}/run/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.post(url, headers=headers)
print(response.json())
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const fileId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'; // file_id from upload
const response = await fetch(
`https://api.anyformat.ai/v2/workflows/${workflowId}/files/${fileId}/run/`,
{
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const data = await response.json();
console.log(data.id);
{
"id": "c0ffee00-0000-4000-8000-000000000000",
"status": "pending",
"workflow_id": "550e8400-e29b-41d4-a716-446655440000",
"version_id": "FGaV4I2JAA"
}
Run Uploaded File
Process a file you already staged with Upload File
curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/files/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run/' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
file_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" # file_id from upload
url = f"https://api.anyformat.ai/v2/workflows/{workflow_id}/files/{file_id}/run/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.post(url, headers=headers)
print(response.json())
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const fileId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'; // file_id from upload
const response = await fetch(
`https://api.anyformat.ai/v2/workflows/${workflowId}/files/${fileId}/run/`,
{
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const data = await response.json();
console.log(data.id);
{
"id": "c0ffee00-0000-4000-8000-000000000000",
"status": "pending",
"workflow_id": "550e8400-e29b-41d4-a716-446655440000",
"version_id": "FGaV4I2JAA"
}
file_id from the upload response as the file_id path parameter.
The run is asynchronous. Poll GET /v2/workflows/{workflow_id}/files/{collection_id}/results/ for the output, using the collection id from the response below.
file_id is the file_id from the upload response: the individual file handle, not the file_collection_id. See Packets and files. To upload and process in one call, use Run Workflow instead.curl -X POST 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/files/a1b2c3d4-e5f6-7890-abcd-ef1234567890/run/' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
file_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" # file_id from upload
url = f"https://api.anyformat.ai/v2/workflows/{workflow_id}/files/{file_id}/run/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.post(url, headers=headers)
print(response.json())
const workflowId = '550e8400-e29b-41d4-a716-446655440000';
const fileId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'; // file_id from upload
const response = await fetch(
`https://api.anyformat.ai/v2/workflows/${workflowId}/files/${fileId}/run/`,
{
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const data = await response.json();
console.log(data.id);
{
"id": "c0ffee00-0000-4000-8000-000000000000",
"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
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"

