Endpoint
Authentication
Requires an API key withflows:execute scope.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
flowId | string | Required. The flow identifier |
Request Body
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
version | string | No | Flow version to use (default: latest) |
wait | boolean | No | Wait for completion (default: false) |
timeout | number | No | Sync wait timeout in ms (default: 30000, max: 60000) |
idempotencyKey | string | No | Unique key for request deduplication |
webhookUrl | string | No | URL to receive completion webhook |
webhookSecret | string | No | Secret for webhook signature verification |
metadata | object | No | Custom metadata (returned in results) |
input | object | Yes | Flow input data |
input.document | object | Yes | Document to process |
input.document.base64 | string | Yes | Base64-encoded document (with or without data URL prefix) |
input.document.filename | string | No | Original filename |
input.document.mimeType | string | No | MIME type (auto-detected if omitted) |
input.variables | object | No | Flow-specific variables |
Response
Async Response (200 OK)
Whenwait: false (default), returns immediately with execution ID:
Sync Response (200 OK)
Whenwait: true, waits for completion (up to timeout):
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique execution identifier |
flowId | string | Flow that was executed |
version | string | Flow version used |
status | string | pending, running, completed, failed, cancelled |
createdAt | string | ISO 8601 start timestamp |
completedAt | string | ISO 8601 completion timestamp (if finished) |
output | object | Extracted data (when completed) |
error | object | Error details (when failed) |
metrics | object | Execution metrics (when completed) |
metrics.durationMs | number | Processing time in milliseconds |
metrics.pageCount | number | Number of pages processed |
metrics.creditsUsed | number | Credits consumed |
metadata | object | Custom metadata from request |
Examples
Basic Async Execution
Sync Execution
With Webhook
TypeScript
With Idempotency
Errors
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | Invalid JSON or missing required fields |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 402 | INSUFFICIENT_CREDITS | Not enough credits |
| 403 | FORBIDDEN | API key missing flows:execute scope |
| 404 | FLOW_NOT_FOUND | Flow doesn’t exist |
| 404 | VERSION_NOT_FOUND | Requested version doesn’t exist |
| 422 | VALIDATION_ERROR | Input doesn’t match schema |
| 422 | INVALID_DOCUMENT | Document is corrupted or unsupported format |
| 429 | RATE_LIMITED | Rate limit exceeded |
| 429 | CONCURRENT_LIMIT | Too many concurrent executions |
| 504 | EXECUTION_TIMEOUT | Sync wait timeout exceeded |
Sync vs Async
| Mode | Use When | Timeout | Result |
|---|---|---|---|
Async (wait: false) | Large documents, background processing | None | Poll or webhook |
Sync (wait: true) | Small documents, immediate response | Max 60s | Direct response |