Client constructor
Your FlexOrch API key. Format:
dfx_<random_string>. Defaults to the
FLEXORCH_API_KEY environment variable if not provided.Override the API base URL. Defaults to
https://api.flexorch.com/v1. Useful
for testing against a staging environment.HTTP request timeout in seconds. Defaults to
30.client.documents
upload(file_path)
Uploads a single file and returns a Job object.
Path to the local file to upload. Accepts absolute or relative paths.
Job
upload_many(file_paths)
Uploads multiple files concurrently. Returns a list of Job objects in the same order as the input.
List of local file paths to upload.
list[Job]
upload_from_connector(connector_id, keys)
Pulls files from a connected storage source and creates one job per key.
Numeric ID of the connector. Find this in Settings → Connectors.
Object keys (paths) within the connector’s storage source.
list[Job]
client.jobs
get(job_id)
Fetches the current state of a job.
The unique identifier of the job.
Job
list(limit, offset)
Returns a paginated list of jobs for the authenticated workspace, newest first.
Maximum number of jobs to return. Defaults to
20. Maximum 100.Number of jobs to skip for pagination. Defaults to
0.list[Job]
submit_feedback(job_id, rating, issue)
Submits human feedback on a job’s extraction quality.
The unique identifier of the job.
"positive" or "negative".Short code describing the problem. Common values:
"wrong_fields",
"missed_pii", "incorrect_summary", "poor_extraction".None
client.datasets
build(job_ids, name)
Assembles a dataset from a list of completed job IDs.
IDs of the completed jobs to include in the dataset.
Human-readable name for the dataset. Must be unique within the workspace.
Dataset
export(dataset_id, format)
Exports a dataset and returns its contents as bytes.
The unique identifier of the dataset.
Export format. One of:
"jsonl", "csv", "parquet", "markdown",
"arrow".bytes
profile(dataset_id)
Returns statistical metadata about the dataset.
The unique identifier of the dataset.
DatasetProfile
delete(dataset_id)
Permanently deletes the dataset export artifact. Underlying jobs are not affected.
The unique identifier of the dataset to delete.
None
Object fields
Job
| Field | Type | Description |
|---|---|---|
id | str | Unique job identifier (job_…). |
status | str | Current state: queued, running, completed, or failed. |
quality_grade | str | None | Letter grade: "A", "B", "C", or "D". None until completed. |
quality_score | float | None | Numeric score from 0.0 to 1.0. None until completed. |
pii_findings_count | int | None | Number of PII entities detected. None until completed. |
privacy_applied | bool | True if redaction or masking was applied during processing. |
is_duplicate | bool | True if the file matches a previously processed document. |
original_job_id | str | None | Job ID of the original upload when is_duplicate is True. |
processing_summary | str | None | Human-readable description of the pipeline result or failure reason. |
created_at | datetime | UTC timestamp when the job was created. |
Dataset
| Field | Type | Description |
|---|---|---|
id | str | Unique dataset identifier (ds_…). |
name | str | Human-readable name provided at creation. |
status | str | "building" or "ready". |
job_count | int | Number of jobs included in the dataset. |
created_at | datetime | UTC timestamp when the dataset was created. |
DatasetProfile
| Field | Type | Description |
|---|---|---|
record_count | int | Total number of records in the dataset. |
total_tokens | int | Estimated total token count across all records. |
avg_quality_score | float | Mean quality score across included jobs. |
grade_counts | dict[str, int] | Record counts keyed by grade ("A", "B", "C", "D"). |
pii_type_count | int | Number of distinct PII entity types detected. |
Exceptions
| Exception | Raised when |
|---|---|
AuthenticationError | API key is missing, malformed, or revoked. |
FileTooLargeError | Uploaded file exceeds the plan’s size limit. |
JobTimeoutError | wait_until_done() exceeded the configured timeout. |
IncompleteJobError | datasets.build() called with strict=True and a non-completed job. |
NotFoundError | The requested job or dataset ID does not exist. |
RateLimitError | API rate limit exceeded; retry after the indicated interval. |
Related guides
Quickstart
Get up and running in five minutes.
Upload
Single, batch, and connector upload patterns.
Jobs
Polling, filtering, and feedback submission.
Datasets
Building, exporting, and profiling datasets.