Skip to main content
POST
/
v3
/
document-packets
/
{document_packet_id}
/
run
/
curl -X POST 'https://api.anyformat.ai/v3/document-packets/069dcc2c-e14c-7606-8000-2ee4fb17b4e1/run/' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: 9e8d7c6b-5a4f-3e2d-1c0b-a9b8c7d6e5f4'
import requests

document_packet_id = "069dcc2c-e14c-7606-8000-2ee4fb17b4e1"
url = f"https://api.anyformat.ai/v3/document-packets/{document_packet_id}/run/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Idempotency-Key": "9e8d7c6b-5a4f-3e2d-1c0b-a9b8c7d6e5f4",
}

triggered = requests.post(url, headers=headers).json()
print(triggered["run_id"])
interface RunTriggered {
  run_id: string;
  document_packet_id: string;
  workflow_id: string;
  status: 'queued' | 'in_progress' | 'processed' | 'error' | 'cancelled';
}

const packetId = '069dcc2c-e14c-7606-8000-2ee4fb17b4e1';
const response = await fetch(
  `https://api.anyformat.ai/v3/document-packets/${packetId}/run/`,
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Idempotency-Key': crypto.randomUUID(),
    },
  }
);

if (!response.ok) {
  throw new Error(`API error: ${response.status}`);
}

const triggered: RunTriggered = await response.json();
console.log(triggered.run_id);
{
  "run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4fa",
  "document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
  "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
  "status": "queued"
}
Rate limit tier: submission (60 req/min) — see Rate limits. Runs — or re-runs — a document packet on the latest version of its workflow. The path is flat: the packet already knows which workflow it belongs to, so no workflow_id appears in the URL. Every call creates a new run. Re-running after editing the workflow is the intended flow — same document, another attempt — and earlier runs stay readable at GET /v3/runs/{run_id}/ with their own results. Re-runs are metered like fresh runs (see How credits work). The only exception is an Idempotency-Key replay: retrying with the same key returns the original run instead of triggering (and billing) a second extraction. See Idempotency. Unknown ids — including packets belonging to another organization — return 404. An organization without extraction credit receives 402 PAYMENT_REQUIRED.
curl -X POST 'https://api.anyformat.ai/v3/document-packets/069dcc2c-e14c-7606-8000-2ee4fb17b4e1/run/' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: 9e8d7c6b-5a4f-3e2d-1c0b-a9b8c7d6e5f4'
import requests

document_packet_id = "069dcc2c-e14c-7606-8000-2ee4fb17b4e1"
url = f"https://api.anyformat.ai/v3/document-packets/{document_packet_id}/run/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Idempotency-Key": "9e8d7c6b-5a4f-3e2d-1c0b-a9b8c7d6e5f4",
}

triggered = requests.post(url, headers=headers).json()
print(triggered["run_id"])
interface RunTriggered {
  run_id: string;
  document_packet_id: string;
  workflow_id: string;
  status: 'queued' | 'in_progress' | 'processed' | 'error' | 'cancelled';
}

const packetId = '069dcc2c-e14c-7606-8000-2ee4fb17b4e1';
const response = await fetch(
  `https://api.anyformat.ai/v3/document-packets/${packetId}/run/`,
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Idempotency-Key': crypto.randomUUID(),
    },
  }
);

if (!response.ok) {
  throw new Error(`API error: ${response.status}`);
}

const triggered: RunTriggered = await response.json();
console.log(triggered.run_id);
{
  "run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4fa",
  "document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
  "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
  "status": "queued"
}

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Headers

Idempotency-Key
string | null

Optional caller-supplied key (Stripe convention). Retrying the request with the same key returns the original run instead of triggering (and billing) a second extraction.

Path Parameters

document_packet_id
string
required

Response

Successful Response

202 response for both run triggers (upload/run/ and document-packets/{id}/run/).

run_id
string
required

Unique identifier of the new run (hyphenated UUID).

Example:

"069dcc2c-e14c-7606-8000-2ee4fb17b4f9"

document_packet_id
string
required

The document packet the run executes on (hyphenated UUID).

Example:

"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"

workflow_id
string
required

The workflow being run (hyphenated UUID).

Example:

"0686bb97-8c30-70f0-8000-97669e000eb8"

status
enum<string>
required

Status at acceptance time — normally queued.

Available options:
queued,
in_progress,
processed,
error,
cancelled
Example:

"queued"