LDX hubLDX hub
  • Pricing
  • Documentation
  • API Reference
Information
Files
    List uploaded filesgetUpload a filepostGet file infogetDownload file contentget
Uploads
    Create an upload sessionpostAppend a chunk to an uploadput
StructFlow Models
    List available modelsget
StructFlow Jobs
    List StructFlow job historygetCreate a StructFlow jobpostGet StructFlow job status and resultsget
RefineLoop Models
    List available modelsget
RefineLoop Jobs
    List RefineLoop job historygetCreate a RefineLoop jobpostGet RefineLoop job status and resultsget
RenderOCR Engines
    List available enginesget
RenderOCR Jobs
    List RenderOCR job historygetCreate a RenderOCR jobpostGet RenderOCR job status and resultsget
CastDoc Engines
    List available enginesget
CastDoc Jobs
    List CastDoc job historygetCreate a CastDoc jobpostGet CastDoc job status and resultsget
ExtractDoc Engines
    List available enginesget
ExtractDoc Jobs
    List ExtractDoc job historygetCreate an ExtractDoc jobpostGet ExtractDoc job status and resultsget
MCP
    MCP Serverpost
Schemas
powered by Zuplo
LDX hub API
LDX hub API

StructFlow Jobs

Create and manage StructFlow structured data extraction jobs


List StructFlow job history

GET
https://gw.ldxhub.io
/structflow/jobs

Returns a list of jobs for the authenticated user, ordered by creation date descending. Results do not include extracted output data. Use GET /structflow/jobs/{job_id} to retrieve full results for a specific job.

List StructFlow job history › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

List StructFlow job history › Responses

A list of jobs

​StructFlowJobSummary[]
GET/structflow/jobs
curl https://gw.ldxhub.io/structflow/jobs \ --header 'Authorization: Bearer <token>'
Example Responses
{ "data": [ { "job_id": "akn08oetutq9jrjk7rwgj6rfehd4kqk4", "model": "google/gemini-3.5-flash", "status": "completed", "progress": 100, "created_at": "2026-04-13T12:33:05Z", "updated_at": "2026-04-13T12:33:12Z", "completed_at": "2026-04-13T12:33:11Z", "expires_at": "2026-04-14T12:33:11Z", "usage": { "total_input_characters": 651, "processed_input_characters": 651, "skipped_characters": 0, "output_characters": 520, "vector_bytes": 0 } } ] }
json
application/json

Create a StructFlow job

POST
https://gw.ldxhub.io
/structflow/jobs

Enqueues an asynchronous structured data extraction job. Returns 202 Accepted immediately with a job_id. Poll GET /structflow/jobs/{job_id} to retrieve results when the job is complete.

Create a StructFlow job › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Create a StructFlow job › Request Body

Either 'inputs' (inline records) or 'file_id' (a pre-uploaded JSONL file) must be provided, but not both. Use 'inputs' for small batches or ad-hoc calls, and 'file_id' for large batches or pipelines where the input is produced by another job.
StructFlowCreateJobRequest
model
​string · required

Model ID obtained from GET /structflow/models

system_prompt
​string · required

Instruction describing what structured data to extract and how

example_output
​object · required

A JSON object showing the desired output structure with example values

​object[]

List of input records to process. Mutually exclusive with 'file_id'.

file_id
​string

File ID of a pre-uploaded JSONL file (one JSON record per line), obtained from POST /files. Mutually exclusive with 'inputs'. When used, results are returned as an 'output_file_id' instead of inline 'results'.

Create a StructFlow job › Responses

Job accepted

Response returned immediately after job submission
JobCreateResponse
job_id
​string

Unique job identifier. Use this to poll for results.

model
​string
status
​string · enum
Enum values:
queued
progress
​number · float
created_at
​string · date-time
updated_at
​string · date-time
expires_at
​string · date-time
POST/structflow/jobs
curl https://gw.ldxhub.io/structflow/jobs \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "model": "google/gemini-3.5-flash", "system_prompt": "Extract the customer name, email, and intent from the message.", "example_output": { "name": "John Doe", "email": "[email protected]", "intent": "quote_request" }, "inputs": [ { "id": "1", "data": { "message": "Hi, I am Sarah Chen ([email protected]). We need a quote for 50 seats." } }, { "id": "2", "data": { "message": "Hey, Mike from BetaCorp here, [email protected]. Can you send pricing?" } } ] }'
Example Request Body
{ "model": "google/gemini-3.5-flash", "system_prompt": "Extract the customer name, email, and intent from the message.", "example_output": { "name": "John Doe", "email": "[email protected]", "intent": "quote_request" }, "inputs": [ { "id": "1", "data": { "message": "Hi, I am Sarah Chen ([email protected]). We need a quote for 50 seats." } }, { "id": "2", "data": { "message": "Hey, Mike from BetaCorp here, [email protected]. Can you send pricing?" } } ] }
json
application/json
Example Responses
{ "job_id": "akn08oetutq9jrjk7rwgj6rfehd4kqk4", "model": "google/gemini-3.5-flash", "status": "queued", "progress": 0, "created_at": "2026-04-13T12:33:04Z", "updated_at": "2026-04-13T12:33:04Z", "expires_at": "2026-04-14T12:33:04Z" }
json
application/json

Get StructFlow job status and results

GET
https://gw.ldxhub.io
/structflow/jobs/{job_id}

Returns the current status and full results of a job. Poll this endpoint until status is completed or failed. Recommended polling interval: 1-5 seconds. Results are retained for a limited period after completion (expires_at).

Note: A job with status: completed may still contain individual records with status: failed. Always check summary.failed_count and each results[].status to detect partial failures.

Get StructFlow job status and results › path Parameters

job_id
​string · required

The unique identifier of the job

Get StructFlow job status and results › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Get StructFlow job status and results › Responses

Job details

Full job details including results. Returned by GET /structflow/jobs/{job_id}.
StructFlowJobDetail
job_id
​string
model
​string
status
​string · enum
Enum values:
queued
processing
completed
failed
progress
​number · float
​object

Result summary. Present only when status is completed AND the job was submitted with 'inputs' (inline).

​object[]

Extracted data per input record. Present only when status is completed AND the job was submitted with 'inputs' (inline). Each record may independently succeed or fail. For jobs submitted with 'file_id', use 'output_file_id' to download the results as a JSONL file.

​JobError

Job-level error. Present only when job status is failed.

created_at
​string · date-time
updated_at
​string · date-time
completed_at
​string · date-time
expires_at
​string · date-time
output_file_id
​string

File ID of the output JSONL file. Present only when status is completed AND the job was submitted with 'file_id' input. Each line contains either the extracted JSON for a successful record, or an object with a reserved '$error' key (e.g. {"$error":{"code":"...","message":"..."}}) for a failed record. Download via GET /files/{output_file_id}/content.

​Usage
GET/structflow/jobs/{job_id}
curl https://gw.ldxhub.io/structflow/jobs/:job_id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "job_id": "akn08oetutq9jrjk7rwgj6rfehd4kqk4", "model": "google/gemini-3.5-flash", "status": "completed", "progress": 100, "summary": { "total": 2, "succeeded_count": 2, "failed_count": 0 }, "results": [ { "id": "1", "status": "succeeded", "output": { "name": "Sarah Chen", "email": "[email protected]", "intent": "quote_request" } }, { "id": "2", "status": "succeeded", "output": { "name": "Mike", "email": "[email protected]", "intent": "pricing_request" } } ], "created_at": "2026-04-13T12:33:05Z", "updated_at": "2026-04-13T12:33:12Z", "completed_at": "2026-04-13T12:33:11Z", "expires_at": "2026-04-14T12:33:11Z", "usage": { "total_input_characters": 140, "processed_input_characters": 140, "skipped_characters": 0, "output_characters": 95, "vector_bytes": 0 } }
json
application/json

StructFlow ModelsRefineLoop Models