Skip to content

Python API reference

Package xberg_io_sdk. Every method below is on the client; the async client mirrors the sync one method for method.

Submit documents and wait for results.

Method Description
extract Submit a single document for extraction via POST /v1/extract (multipart).
extract_batch Submit multiple documents in a SINGLE multipart request carrying every file.
extract_and_wait Submit a document and block until extraction completes (raises on failure/timeout).

Poll, read, page through and cancel extraction jobs.

Method Description
list_jobs List jobs via GET /v1/jobs (paginated). Returns the decoded response body.
get_job Fetch a job’s current status and (when terminal) its extraction result.
get_job_result Fetch a job’s stored result envelope (GET /v1/jobs/{id}/result).
get_job_page Enterprise only: fetch a rendered page image (GET /v1/jobs/{id}/pages/{n}, image/png bytes).
cancel_job Cancel an extraction job (DELETE /v1/jobs/{id}, 204 whether pending or already terminal).
wait_for_job Poll GET /v1/jobs/{id} until the job reaches a terminal status or timeout elapses.
wait_for_jobs Wait for multiple jobs sequentially (sync).
audit Fetch audit-log entries via GET /v1/audit. Returns the decoded response body.

Enterprise-only crawl job event stream.

Method Description
stream_crawl_events Enterprise only: stream a crawl job’s events (GET /v1/crawl-jobs/{id}/events).

The curated preset registry, served by both tiers.

Method Description
presets List the curated, read-only managed presets (GET /v1/presets).
get_preset Fetch one managed preset in full (GET /v1/presets/{id}).
get_preset_sample Fetch a preset’s bundled sample document (GET /v1/presets/{id}/sample/{name}, raw bytes).

Project-scoped presets you create and update.

Method Description
list_saved_presets List the project’s saved presets (GET /v1/saved_presets; Pro spells it /v1/saved-presets).
create_saved_preset Create a saved preset (POST /v1/saved_presets; Pro spells it /v1/saved-presets).
get_saved_preset Fetch one saved preset in full (GET /v1/saved_presets/{preset_id}).
update_saved_preset Replace a saved preset’s definition (PATCH /v1/saved_presets/{preset_id}).
delete_saved_preset Delete a saved preset (DELETE /v1/saved_presets/{preset_id}, 204).

Collections, documents and retrieval.

Method Description
list_rag_collections List RAG collections (GET /v1/rag/collections).
create_rag_collection Create a RAG collection (POST /v1/rag/collections).
get_rag_collection Fetch a RAG collection (GET /v1/rag/collections/{name}).
delete_rag_collection Delete a RAG collection (DELETE /v1/rag/collections/{name}, 204).
add_rag_documents Add documents to a RAG collection (POST /v1/rag/collections/{name}/documents).
delete_rag_documents Delete documents from a RAG collection by ID or filter (DELETE .../documents).
reindex_rag_document Reindex a RAG document (POST /v1/rag/collections/{name}/documents/{id}/reindex).
rag_retrieve Retrieve chunks from a RAG collection (POST /v1/rag/collections/{name}/retrieve).
migrate_rag_embeddings Kick off an embedding migration (POST /v1/rag/collections/{name}/migrate-embeddings).
get_rag_migration_job Poll an embedding-migration job (GET .../migrate-embeddings/{job_id}).
get_rag_job Fetch a RAG job’s status (GET /v1/rag/jobs/{job_id}).
get_rag_config Pro only: fetch a project’s RAG config (GET /v1/projects/{project_id}/rag-config).
set_rag_config Pro only: update a project’s RAG config (PUT /v1/projects/{project_id}/rag-config).

Tuning jobs and their results.

Method Description
submit_auto_tune Submit an auto-tune job (POST /v1/auto-tune: a JSON request part plus one file part each).
list_auto_tune_jobs List auto-tune jobs (GET /v1/auto-tune, paginated).
get_auto_tune_status Fetch an auto-tune job’s progress (GET /v1/auto-tune/{id}).
get_auto_tune_result Fetch a finished auto-tune job’s leaderboard and winning profile (GET /v1/auto-tune/{id}/result).
get_auto_tune_capabilities Fetch the tunable knobs and OCR backends this instance offers (GET /v1/auto-tune/capabilities).
promote_auto_tune_profile Promote an auto-tune result to a named tuning profile (POST /v1/auto-tune/{id}/promote).
delete_auto_tune_job Delete an auto-tune job and its artifacts (DELETE /v1/auto-tune/{id}, 204).

Profiles promoted from auto-tune runs.

Method Description
list_tuning_profiles List the promoted tuning profiles (GET /v1/tuning-profiles, paginated).
get_tuning_profile Fetch one tuning profile in full (GET /v1/tuning-profiles/{id}).
delete_tuning_profile Delete a tuning profile (DELETE /v1/tuning-profiles/{id}, 204).

Enterprise-only document history.

Method Description
get_document Enterprise only: fetch a document’s latest version (GET /v1/documents/{document_id}).
versions Enterprise only: list a document’s versions (GET /v1/documents/{id}/versions).
diff Enterprise only: diff document versions (GET /v1/documents/{id}/diff).
get_diff_job Enterprise only: poll a diff job (GET /v1/documents/{id}/diff/{diff_job_id}).

Enterprise-only text enrichment.

Method Description
submit_enrich Enterprise only: submit text for enrichment (POST /v1/enrich, 202 Accepted).
get_enrich_status Enterprise only: poll an enrichment job (GET /v1/enrich/{job_id}).

Enterprise-only upload staging and metering.

Method Description
presign_upload Enterprise only: request a presigned upload URL (POST /v1/uploads/presign).
confirm_upload Enterprise only: confirm a presigned upload (POST /v1/uploads/confirm).
usage Enterprise only: fetch usage/metering data (GET /v1/usage).
list_extraction_events Enterprise only: list recent extraction events (GET /v1/extractions).

Pro-only projects, keys and integrations.

Method Description
list_projects Pro only: list the caller’s projects (GET /v1/projects, paginated).
create_project Pro only: create a project (POST /v1/projects).
list_api_keys Pro only: list a project’s API keys (GET /v1/projects/{project_id}/api-keys).
create_api_key Pro only: mint a project API key (POST /v1/projects/{project_id}/api-keys).
revoke_api_key Pro only: revoke an API key (DELETE /v1/projects/{project_id}/api-keys/{key_id}).
list_integrations Pro only: list a project’s integrations (GET /v1/projects/{project_id}/integrations).
create_integration Pro only: create an integration (POST /v1/projects/{project_id}/integrations).
get_integration Pro only: fetch one integration (GET .../integrations/{integration_id}).
delete_integration Pro only: delete an integration (DELETE .../integrations/{integration_id}).
connect_integration Pro only: begin the OAuth connect flow (POST .../integrations/{integration_id}/connect).
disconnect_integration Pro only: drop an integration’s stored credentials (POST .../disconnect).
list_integration_documents Pro only: list documents visible through an integration (GET .../documents).
fetch_integration_document Pro only: download one document through an integration (GET .../documents/{document_id}).

Pro-only session and configuration reads.

Method Description
auth_config Pro only: fetch the instance’s accepted auth methods (unauthenticated GET /auth/config).
login Pro only: exchange a verified OIDC ID token for a Pro session JWT (POST /auth/login).