LensPreview: Untern Lens is in Preview: credits and limits apply

Docs

Docs

API reference

Operations of the HTTP API, generated from the API contract.

This reference is generated from the API contract.

Contract: Document Parser API, version 2.9.0.

API Key Management

POST /api/api-keys/create

Create Api Key

Create a new service API key (Admin only); shown once.

  • Operation ID: create_api_key_api_api_keys_create_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: ApiKeyResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/api-keys/list

List Api Keys

List all API keys (Admin only).

  • Operation ID: list_api_keys_api_api_keys_list_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
include_revokedquerybooleanNoDefault: false.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: array of ApiKeyListResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

DELETE /api/api-keys/{key_id}

Revoke Api Key

Revoke an API key (Admin only).

  • Operation ID: revoke_api_key_api_api_keys__key_id__delete
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
key_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Admin Config

GET /api/admin/config

Get Config

Get current runtime config (cost limits).

  • Operation ID: get_config_api_admin_config_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: ConfigResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

PUT /api/admin/config

Update Config

Update runtime config params (partial update). Changes take effect immediately.

  • Operation ID: update_config_api_admin_config_put
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: ConfigResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/config/costs

Get Costs

Get monthly cost history and current month status for all keys.

  • Operation ID: get_costs_api_admin_config_costs_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: CostsResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/config/costs/reset

Reset Costs

Reset current month costs for all keys (emergency use).

  • Operation ID: reset_costs_api_admin_config_costs_reset_post
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/config/llama-keys

Get Llama Keys

View LlamaParse API key status.

  • Operation ID: get_llama_keys_api_admin_config_llama_keys_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: LlamaKeysResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

PUT /api/admin/config/llama-keys

Update Llama Keys

Replace the LlamaParse API key list. All keys start clean (AVAILABLE).

  • Operation ID: update_llama_keys_api_admin_config_llama_keys_put
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: LlamaKeysResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/config/llama-keys/reset

Reset Llama Keys

Reset stuck LlamaParse keys (EXHAUSTED, ERROR, COOLDOWN) back to AVAILABLE.

  • Operation ID: reset_llama_keys_api_admin_config_llama_keys_reset_post
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/config/services

List Service Configs

List all dynamic service configs.

  • Operation ID: list_service_configs_api_admin_config_services_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/config/services/{service_name}

Get Service Config

Get config for a specific service.

  • Operation ID: get_service_config_api_admin_config_services__service_name__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
service_namepathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

PUT /api/admin/config/services/{service_name}

Update Service Config

Update config for a service. Takes effect on next request (no restart needed).

  • Operation ID: update_service_config_api_admin_config_services__service_name__put
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
service_namepathstringYes

Request body (required)

  • application/json: object

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Admin Files

GET /api/admin/files

List Files Paginated

List files with pagination and filtering (Admin).

Query params:

  • name: Search by file name (case-insensitive partial match)

  • file_type: Filter by file type (exact: pdf, docx, pptx, xlsx)

  • status_filter: Filter by status (uploaded, processing, parsed, failed)

  • md5: Filter by exact MD5 hash

  • project_name: Filter by project name (use "unknown" for files with no project)

  • sub_group: Filter by sub-group (use "unknown" for files with no sub-group)

  • limit: Page size (default 50, max 500)

  • offset: Offset for pagination

  • Operation ID: list_files_paginated_api_admin_files_get

  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
namequerystring or nullNo
file_typequerystring or nullNo
status_filterquerystring or nullNo
md5querystring or nullNo
project_namequerystring or nullNo
sub_groupquerystring or nullNo
limitqueryintegerNoDefault: 50.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/

List Files Paginated

List files with pagination and filtering (Admin).

Query params:

  • name: Search by file name (case-insensitive partial match)

  • file_type: Filter by file type (exact: pdf, docx, pptx, xlsx)

  • status_filter: Filter by status (uploaded, processing, parsed, failed)

  • md5: Filter by exact MD5 hash

  • project_name: Filter by project name (use "unknown" for files with no project)

  • sub_group: Filter by sub-group (use "unknown" for files with no sub-group)

  • limit: Page size (default 50, max 500)

  • offset: Offset for pagination

  • Operation ID: list_files_paginated_api_admin_files__get

  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
namequerystring or nullNo
file_typequerystring or nullNo
status_filterquerystring or nullNo
md5querystring or nullNo
project_namequerystring or nullNo
sub_groupquerystring or nullNo
limitqueryintegerNoDefault: 50.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/files/bulk-delete

Bulk Delete Files

Delete specific files by their IDs. Cascades: deletes all results' S3 artifacts, source file from S3, then File record (cascade handles Result records). Max 100 file IDs per request.

  • Operation ID: bulk_delete_files_api_admin_files_bulk_delete_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/dashboard/summary

Get Dashboard Summary

Aggregated dashboard data in a single call. Optionally filtered by project_name and/or sub_group.

  • Operation ID: get_dashboard_summary_api_admin_files_dashboard_summary_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
project_namequerystring or nullNo
sub_groupquerystring or nullNo

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/groups

Get File Groups

Get distinct project_name and sub_group values with counts for filter dropdowns.

When project_name is provided, sub_groups are filtered to only those within that project.

  • Operation ID: get_file_groups_api_admin_files_groups_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
project_namequerystring or nullNo

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/statuses

Get File Status Counts

Get file count by status for filter dropdown / dashboard.

  • Operation ID: get_file_status_counts_api_admin_files_statuses_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/types

Get File Types

Get distinct file types for filter dropdown (normalized to lowercase).

  • Operation ID: get_file_types_api_admin_files_types_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/{file_id}/download/source

Admin Download Source

  • Operation ID: admin_download_source_api_admin_files__file_id__download_source_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/{file_id}/results/{result_id}/download/markdown

Admin Download Content

  • Operation ID: admin_download_content_api_admin_files__file_id__results__result_id__download_markdown_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/{file_id}/results/{result_id}/download/zip

Admin Download Zip

  • Operation ID: admin_download_zip_api_admin_files__file_id__results__result_id__download_zip_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/files/{file_id}/results/{result_id}/images/{image_path}

Admin Download Image

  • Operation ID: admin_download_image_api_admin_files__file_id__results__result_id__images__image_path__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
image_pathpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Admin Sync

POST /api/admin/sync/bulk

Bulk Sync Documents

Sync metadata without reviving retired object identities.

  • Operation ID: bulk_sync_documents_api_admin_sync_bulk_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: BulkSyncResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/bulk-delete-results

Bulk Delete Results By Ids

Delete specific results by their IDs. Deletes S3 artifacts (if delete_artifacts=true) + PostgreSQL records. Max 200 result IDs per request.

  • Operation ID: bulk_delete_results_by_ids_api_admin_sync_bulk_delete_results_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/bulk-download

Bulk Download Results

Combine exact protected artifacts on disk; never retain entire archives.

  • Operation ID: bulk_download_results_api_admin_sync_bulk_download_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/cleanup-expired

Cleanup Expired Records

Cleanup expired Result records. Set dry_run=false to actually delete.

  • Operation ID: cleanup_expired_records_api_admin_sync_cleanup_expired_post
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
cursorquerystring or nullNo

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: CleanupExpiredResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/delete-by-date

Delete By Date

Xóa Results theo khoảng thời gian.

Có thể filter theo:

  • created_at: Thời điểm tạo Result
  • expire_at: Thời điểm hết hạn

Ít nhất phải có date_from hoặc date_to.

Delete modes:

  • full: Xóa PostgreSQL record + S3 files
  • s3_only: Chỉ xóa S3 files, giữ metadata (clear URLs)
  • metadata_only: Chỉ xóa PostgreSQL record, giữ S3 files

Luôn dùng dry_run=true trước để preview!

  • Operation ID: delete_by_date_api_admin_sync_delete_by_date_post
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
cursorquerystring or nullNo

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: BulkDeleteResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/delete-by-version

Delete By Version

Xóa tất cả Results có version cụ thể.

Delete modes:

  • full: Xóa PostgreSQL record + S3 files
  • s3_only: Chỉ xóa S3 files, giữ metadata (clear URLs)
  • metadata_only: Chỉ xóa PostgreSQL record, giữ S3 files

Luôn dùng dry_run=true trước để preview!

  • Operation ID: delete_by_version_api_admin_sync_delete_by_version_post
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
cursorquerystring or nullNo

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: BulkDeleteResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/sync/history

Query Sync History

Query sync history with filters and pagination.

Returns paginated results with total_count for UI pagination.

  • Operation ID: query_sync_history_api_admin_sync_history_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_md5querystring or nullNo
file_namequerystring or nullNo
versionquerystring or nullNo
sync_sourcequerystring or nullNo
statusquerystring or nullNo
project_namequerystring or nullNo
sub_groupquerystring or nullNo
date_fromquerystring or nullNo
date_toquerystring or nullNo
include_expiredquerybooleanNoDefault: false.
limitqueryintegerNoDefault: 100.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/sync/history/{md5}

Get History By Md5

Get all Result versions for a specific file MD5.

  • Operation ID: get_history_by_md5_api_admin_sync_history__md5__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
md5pathstringYes
limitqueryintegerNoDefault: 100.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/sync/logs

Get Admin Logs

Admin audit log, newest first: imported actions and the new structured rows (N-api-6).

  • Operation ID: get_admin_logs_api_admin_sync_logs_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
action_typequerystring or nullNo
limitqueryintegerNoDefault: 100.
offsetqueryintegerNoDefault: 0.
actorquerystring or nullNooidc:, key:, admin_key, user: or break-glass
outcomequerystring or nullNosuccess, partial, failure or denied
date_fromquerystring (date-time) or nullNoRFC 3339, inclusive
date_toquerystring (date-time) or nullNoRFC 3339, inclusive

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/sync/pending-uploads

Get Pending Uploads

Get results that have been synced but don't have artifacts uploaded yet.

  • Operation ID: get_pending_uploads_api_admin_sync_pending_uploads_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
limitqueryintegerNoDefault: 100.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

DELETE /api/admin/sync/result/{result_id}

Delete Sync Result

Delete a specific Result record.

  • Operation ID: delete_sync_result_api_admin_sync_result__result_id__delete
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
result_idpathstringYes
delete_artifactsquerybooleanNoDefault: true.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/sync/result/{result_id}/preview

Preview Result Content

Bound retained preview text while validating the exact protected body.

  • Operation ID: preview_result_content_api_admin_sync_result__result_id__preview_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
result_idpathstringYes
max_lengthqueryintegerNoDefault: 50000.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/admin/sync/stats

Get Sync Stats

Get sync statistics by version and source.

  • Operation ID: get_sync_stats_api_admin_sync_stats_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/upload-artifacts

Upload Artifacts

Publish a complete immutable bundle for an artifact-less synced Result.

  • Operation ID: upload_artifacts_api_admin_sync_upload_artifacts_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/admin/sync/upload-parsed

Upload Parsed Result

Import final bytes without invoking a parser or inventing another ledger.

  • Operation ID: upload_parsed_result_api_admin_sync_upload_parsed_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Auth

GET /.well-known/oauth-protected-resource

Protected resource metadata (RFC 9728)

  • Operation ID: protected_resource_metadata__well_known_oauth_protected_resource_get
  • Auth scope: Not specified

Responses

StatusDescriptionContent
200Successful Responseapplication/json: ProtectedResourceMetadata

Billing

GET /api/billing/config

Payment provider settings for the portal's checkout script

  • Operation ID: billing_config
  • Auth scope: Any valid credential
  • Surface: user

Responses

StatusDescriptionContent
200Successful Responseapplication/json: BillingConfig
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/billing/estimate

Estimate the credits of files before parsing them

  • Operation ID: billing_estimate
  • Auth scope: Any valid credential
  • Surface: user

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: Estimate
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
402A billing refusal (preview_limit, ...)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
404The credential has no billing accountapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503billing_unavailable while billing is offapplication/json: ErrorResponse

GET /api/billing/plans

The plans offered now (Preview: Free and Starter)

  • Operation ID: billing_plans
  • Auth scope: Any valid credential
  • Surface: user

Parameters

NameInTypeRequiredDescription
includequery"proposal" or nullNo

Responses

StatusDescriptionContent
200Successful Responseapplication/json: PlanList
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403include=proposal without adminapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/billing/webhooks/{provider}

Payment provider webhook (signature only, no bearer credential)

  • Operation ID: billing_webhook
  • Auth scope: Not specified
  • Surface: agent

Parameters

NameInTypeRequiredDescription
providerpathstringYes

Responses

StatusDescriptionContent
204Successful Response
400invalid_signature or invalid_inputapplication/json: ErrorResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
404Not the configured providerapplication/json: ErrorResponse
413Body above 64 KiBapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500Applying failed; the provider retriesapplication/json: ErrorResponse
503provider_unavailableapplication/json: ErrorResponse

GET /api/me/billing

My plan and subscription

  • Operation ID: billing_account
  • Auth scope: Any valid credential
  • Surface: user

Responses

StatusDescriptionContent
200Successful Responseapplication/json: BillingAccount
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403Not a signed-in user (insufficient_scope)application/json: ErrorResponse
409plan_not_approved or not_subscribedapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
502upstream_error from the providerapplication/json: ErrorResponse
503provider_unavailable or billing_unavailableapplication/json: ErrorResponse

POST /api/me/billing/checkout

Start a checkout for a plan (Paddle.js overlay)

  • Operation ID: billing_checkout
  • Auth scope: Any valid credential
  • Surface: user

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: CheckoutSessionOut
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403Not a signed-in user (insufficient_scope)application/json: ErrorResponse
409plan_not_approved or not_subscribedapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
502upstream_error from the providerapplication/json: ErrorResponse
503provider_unavailable or billing_unavailableapplication/json: ErrorResponse

POST /api/me/billing/portal

Link to the payment provider's customer portal (payment method, invoices, cancel)

  • Operation ID: billing_portal
  • Auth scope: Any valid credential
  • Surface: user

Responses

StatusDescriptionContent
200Successful Responseapplication/json: PortalLink
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403Not a signed-in user (insufficient_scope)application/json: ErrorResponse
409plan_not_approved or not_subscribedapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
502upstream_error from the providerapplication/json: ErrorResponse
503provider_unavailable or billing_unavailableapplication/json: ErrorResponse

GET /api/me/usage

Plan and credits of my account

  • Operation ID: billing_usage
  • Auth scope: Any valid credential
  • Surface: user

Parameters

NameInTypeRequiredDescription
periodquerystring, one of current, previousNoDefault: current.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: Usage
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
402A billing refusal (preview_limit, ...)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
404The credential has no billing accountapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503billing_unavailable while billing is offapplication/json: ErrorResponse

Config

GET /api/config/public

Public Config

Upload limit, accepted file types and parsing modes of this server (no secrets).

  • Operation ID: config_public
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: PublicConfig
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Extractions

POST /api/extractions

Create Extraction

Start extracting schema (or the server schema schema_ref) from a finished result.

Pass task_id (a completed parse task) or result_id. Returns 202 with the extraction in pending; read it with GET /api/extractions/{extraction_id}?wait=30 until terminal. With require_evidence (default) a value is kept only when its quote is found in the document.

  • Operation ID: extractions_create
  • Auth scope: Any valid credential
  • Surface: agent

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstring or nullNo8-128 characters [A-Za-z0-9._:-]; the same key returns the first extraction for the same request, a different request is 409 idempotency_conflict

Request body (required)

Responses

StatusDescriptionContent
202Successful Responseapplication/json: Extraction
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
404not_found: no such task or result for this credentialapplication/json: ErrorResponse
409not_ready (task not finished) or idempotency_conflictapplication/json: ErrorResponse
410gone: the result expiredapplication/json: ErrorResponse
422invalid_schema (outside the CLI-CONTRACT §5.6 subset) or invalid_inputapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503service_unavailable: no extraction provider is configuredapplication/json: ErrorResponse

GET /api/extractions/{extraction_id}

Get Extraction

One extraction; wait (up to 30 s) long-polls until it is completed or failed.

  • Operation ID: extractions_get
  • Auth scope: Any valid credential
  • Surface: agent

Parameters

NameInTypeRequiredDescription
extraction_idpathstringYes
waitqueryintegerNoSeconds to wait for a terminal state From 0 to 30. Default: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: Extraction
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
404not_found: no such extraction for this credentialapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/schemas

List Schemas

Server schemas usable as schema_ref (NAME@VERSION).

  • Operation ID: schemas_list
  • Auth scope: Any valid credential
  • Surface: agent

Responses

StatusDescriptionContent
200Successful Responseapplication/json: SchemaList
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

File Mapping

GET /api/mapping/md5-lookup/{md5_hash}

Lookup By Md5

Look up files by MD5 hash with support for both source files and markdown content.

lookup_type options:

  • "auto": Try both source and markdown MD5 (default)
  • "source": Only lookup source file MD5
  • "markdown": Only lookup markdown content MD5

Version filtering:

  • version: Filter by specific version (e.g., "2.5.0")

  • latest_version_only: Return only results from the newest version

  • Operation ID: lookup_by_md5_api_mapping_md5_lookup__md5_hash__get

  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
md5_hashpathstringYes
lookup_typequerystringNoDefault: auto.
versionquerystring or nullNoFilter by specific version (e.g., '2.5.0')
latest_version_onlyquerybooleanNoReturn only results from the latest/newest version Default: false.
include_markdownquerybooleanNoOn cache hit, fetch the latest result's markdown content from S3 and inline it as top-level markdown + markdown_md5 + file_id so a single request can short-circuit the parse pipeline. Default: false.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/mapping/projects

List Projects

List the distinct project names of the caller's files with file counts.

  • Operation ID: list_projects_api_mapping_projects_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/mapping/projects/{project_name}/files

List Files By Project

List the caller's files belonging to a specific project.

  • Operation ID: list_files_by_project_api_mapping_projects__project_name__files_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
project_namepathstringYes
limitqueryintegerNoAt most 1000. Default: 100.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/mapping/sub-groups

List Sub Groups

List the sub-groups of the caller's files with file counts, optionally for one project.

  • Operation ID: list_sub_groups_api_mapping_sub_groups_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
project_namequerystring or nullNoFilter by project name

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/mapping/sub-groups/{sub_group}/files

List Files By Sub Group

List the caller's files belonging to a specific sub-group.

  • Operation ID: list_files_by_sub_group_api_mapping_sub_groups__sub_group__files_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
sub_grouppathstringYes
limitqueryintegerNoAt most 1000. Default: 100.
offsetqueryintegerNoDefault: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

File Transforms

GET /api/files/{file_id}/kg-ready

Get Kg Ready

Transform a parsed file into KG-ready format with preprocessed markdown, assets, and sheets.

  • Operation ID: get_kg_ready_api_files__file_id__kg_ready_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
versionquerystring or nullNoFilter by parser version
result_idquerystring or nullNoSelect an exact completed result for this file
analyze_imagesquerybooleanNoRun LLM-based image content analysis (V2 dedup) to classify each asset and drop redundant page-screenshots. Default: True. Pass ?analyze_images=false to skip the LLM stage and return deterministic-only output (faster, no LLM cost). Default: true.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: KGReadyResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/kg-ready/assets/{asset_filename}

Get Kg Ready Asset

Download a specific asset (image) from the KG-ready transform.

  • Operation ID: get_kg_ready_asset_api_files__file_id__kg_ready_assets__asset_filename__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
asset_filenamepathstringYes
result_idquerystring or nullNoSelect the exact result containing this asset

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/kg-ready/sheets/{sheet_filename}

Get Kg Ready Sheet

Download a specific sheet CSV from the KG-ready transform.

  • Operation ID: get_kg_ready_sheet_api_files__file_id__kg_ready_sheets__sheet_filename__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
sheet_filenamepathstringYes
result_idquerystring or nullNoSelect the exact result containing this sheet

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Files

GET /api/files/

List Files

List the caller's files (administrators: every file). With limit, newest first, one page at a time: the next page's URL is in the Link: <…>; rel="next" header; the body stays an array.

  • Operation ID: list_files_api_files__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
limitqueryinteger or nullNoPage size; without it every file is returned (legacy behaviour)
cursorquerystring or nullNoOpaque, from the Link header

Responses

StatusDescriptionContent
200Successful Responseapplication/json: array of FileUploadResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/files/convert-preview

Convert File To Pdf Preview

Convert office documents (DOCX, PPTX, XLSX, etc.) to PDF for UI preview.

  • Operation ID: convert_file_to_pdf_preview_api_files_convert_preview_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/download/{task_id}

Download File Results

Download only the durable result linked to this exact completed task.

  • Operation ID: download_file_results_api_files_download__task_id__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
task_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/files/get-markdown-by-file

Get Markdown By File

Upload a file and get its corresponding markdown if it has been processed. Useful for checking if a file has already been parsed and getting the markdown result.

  • Operation ID: get_markdown_by_file_api_files_get_markdown_by_file_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: FileToMarkdownResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/modes

List Parsing Modes

The canonical list of parsing modes (portal, CLI and MCP read it), with availability.

A gated mode stays listed with available: false and its reason (license_gated for Chandra unless the server enables it); it is the only place a gated mode is visible.

  • Operation ID: files_modes
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: ModesResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/files/process

Process File

  • Operation ID: process_file_api_files_process_post
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
X-Credits-Maxheaderstring or nullNoSame as max_credits; the lower value wins

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: FileProcessingResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/status/{task_id}

Get File Processing Status

Return sanitized durable status for exactly one ParseTask.

  • Operation ID: get_file_processing_status_api_files_status__task_id__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
task_idpathstringYes
waitqueryintegerNoSeconds to wait for the task to finish before answering (long poll, max 30) From 0 to 30. Default: 0.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/files/upload

Upload File

Upload a fresh source without holding a DB transaction over storage I/O.

Identical bytes uploaded again by the same owner return the existing file; another owner's upload of the same bytes is a separate file with its own id.

  • Operation ID: upload_file_api_files_upload_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
201Successful Responseapplication/json: FileUploadResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}

Get File Details

Get file details with result versions.

  • Operation ID: get_file_details_api_files__file_id__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: FileUploadResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/download/source

Download Source File

  • Operation ID: download_source_file_api_files__file_id__download_source_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/download/markdown

Download Result Markdown

  • Operation ID: download_result_markdown_api_files__file_id__results__result_id__download_markdown_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/download/zip

Download Result Zip

  • Operation ID: download_result_zip_api_files__file_id__results__result_id__download_zip_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/images/{image_path}

Get Result Image

  • Operation ID: get_result_image_api_files__file_id__results__result_id__images__image_path__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
image_pathpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Health

GET /health/info

Info

Return basic information about the API

  • Operation ID: info_health_info_get
  • Auth scope: Not specified

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any

GET /health/ping

Ping

Simple health check endpoint that doesn't require authentication

  • Operation ID: ping_health_ping_get
  • Auth scope: Not specified

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any

GET /health/ready

Ready

Check dependencies required to serve requests for the selected mode.

  • Operation ID: ready_health_ready_get
  • Auth scope: Not specified

Parameters

NameInTypeRequiredDescription
parsing_modequerystring or nullNo

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
422Validation Errorapplication/json: HTTPValidationError

GET /healthz

Healthz

Liveness: the process serves requests. No database, storage or provider call.

  • Operation ID: healthz_healthz_get
  • Auth scope: Not specified

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any

Markdown

POST /api/markdown/find-by-source

Find Markdown By Source File

Upload a source file and find all related markdown files. Calculates MD5 of source file content and queries database to find all processed markdown results.

Args: include_manual_registration: Include manually registered files (without URLs) version: Filter by specific version (e.g., "2.5.0") latest_version_only: Return only results from the newest version

  • Operation ID: find_markdown_by_source_file_api_markdown_find_by_source_post
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
include_manual_registrationquerybooleanNoDefault: true.
versionquerystring or nullNoFilter by specific version (e.g., '2.5.0')
latest_version_onlyquerybooleanNoReturn only results from the latest/newest version Default: false.

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: SourceToMarkdownMapping
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/markdown/identify-source

Identify Source From Markdown

Upload a markdown file and identify its original source file. Calculates MD5 of markdown content and queries database to find the source file.

Version filtering:

  • version: Filter by specific version (e.g., "2.5.0")

  • latest_version_only: Return result from the newest version (default: True)

  • Operation ID: identify_source_from_markdown_api_markdown_identify_source_post

  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
versionquerystring or nullNoFilter by specific version (e.g., '2.5.0')
latest_version_onlyquerybooleanNoReturn only the result from the latest/newest version (default: True) Default: true.

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: MarkdownIdentificationResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Me

GET /api/me

The caller's identity

  • Operation ID: get_me_api_me_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: MeResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/me/api-keys

List my API keys

  • Operation ID: list_my_keys_api_me_api_keys_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
include_revokedquerybooleanNoDefault: false.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: array of ApiKeySummary
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/me/api-keys

Create a personal API key (shown once)

  • Operation ID: create_my_key_api_me_api_keys_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
201Successful Responseapplication/json: ApiKeyCreated
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

DELETE /api/me/api-keys/{key_id}

Revoke one of my keys

  • Operation ID: revoke_my_key_api_me_api_keys__key_id__delete
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
key_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: RevokeResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Paged Results

GET /api/files/{file_id}/results/{result_id}/document

Get Paged Document

  • Operation ID: get_paged_document_api_files__file_id__results__result_id__document_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document/images/{record_id}

Download Paged Image

  • Operation ID: download_paged_image_api_files__file_id__results__result_id__document_images__record_id__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
record_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document/pages

Get Paged Pages

  • Operation ID: get_paged_pages_api_files__file_id__results__result_id__document_pages_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
cursorquerystring or nullNo
limitqueryintegerNoDefault: 12.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document/pages/{physical_page}/images

Get Paged Images

  • Operation ID: get_paged_images_api_files__file_id__results__result_id__document_pages__physical_page__images_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
physical_pagepathintegerYes
cursorquerystring or nullNo
limitqueryintegerNoDefault: 32.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document/pages/{physical_page}/items

Get Paged Items

  • Operation ID: get_paged_items_api_files__file_id__results__result_id__document_pages__physical_page__items_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
physical_pagepathintegerYes
cursorquerystring or nullNo
limitqueryintegerNoDefault: 32.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document/records/{record_id}

Download Paged Record

  • Operation ID: download_paged_record_api_files__file_id__results__result_id__document_records__record_id__get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
record_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Registration

POST /api/registration/clean-duplicates

Clean Duplicate Registrations

  • Operation ID: clean_duplicate_registrations_api_registration_clean_duplicates_post
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
dry_runquerybooleanNoDefault: true.
batch_limitqueryintegerNoFrom 1 to 200. Default: 100.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

DELETE /api/registration/external-file/{file_id}

Remove External Registration

  • Operation ID: remove_external_registration_api_registration_external_file__file_id__delete
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/registration/external-files

Register External Parsed Files

  • Operation ID: register_external_parsed_files_api_registration_external_files_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: BulkRegistrationResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/registration/single-file

Register Single External File

  • Operation ID: register_single_external_file_api_registration_single_file_post
  • Auth scope: Any valid credential

Request body (required)

Responses

StatusDescriptionContent
200Successful Responseapplication/json: RegistrationResult
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/registration/stats

Get Registration Stats

  • Operation ID: get_registration_stats_api_registration_stats_get
  • Auth scope: Any valid credential

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Results

GET /api/files/{file_id}/results/{result_id}/chunks

Get Result Chunks

Heading-aware retrieval chunks as NDJSON, one untern_docai.Chunk per line.

Each chunk carries its heading path, pages, block ids and block boxes, so a citation can be shown on the Pages view. Same lookup and errors as document.json.

  • Operation ID: results_chunks
  • Auth scope: Any valid credential
  • Surface: agent

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
max_chunk_charsqueryintegerNoLargest chunk in characters (a single long word may exceed it) From 200 to 4000. Default: 1500.

Responses

StatusDescriptionContent
200One Chunk per lineapplication/x-ndjson
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
409not_ready: the result is not finished yetapplication/json: ErrorResponse
410gone: the result expired or was removedapplication/json: ErrorResponse
413result_too_large: the page JSON is above the server's limitapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document.html

Get Result Document Html

The result as a standalone HTML5 page (one <section> per page; all text escaped).

Rendered by untern_docai.export.to_html from the same Document as document.json, with the same errors. Sent with a restrictive Content-Security-Policy.

  • Operation ID: results_document_html
  • Auth scope: Any valid credential
  • Surface: user

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes
langquerystringNoBCP 47 tag Default: en.

Responses

StatusDescriptionContent
200Standalone HTML5 pagetext/html
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
409not_ready: the result is not finished yetapplication/json: ErrorResponse
410gone: the result expired or was removedapplication/json: ErrorResponse
413result_too_large: the page JSON is above the server's limitapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/files/{file_id}/results/{result_id}/document.json

Get Result Document

The result's pages with their blocks (type, text, heading level, box) as Document 1.0.

Page images are listed in metadata as page_image:<n> paths (relative to the API base, served by …/images/page_<n>.jpg); metadata.page_count is the number of pages. A result that is still running answers 409 not_ready, an expired one 410 gone, one whose stored page JSON is above UNTERN_LENS_DOCUMENT_JSON_MAX_BYTES 413 result_too_large (use the ZIP download).

  • Operation ID: results_document
  • Auth scope: Any valid credential
  • Surface: user

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
result_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: Document
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
409not_ready: the result is not finished yetapplication/json: ErrorResponse
410gone: the result expired or was removedapplication/json: ErrorResponse
413result_too_large: the page JSON is above the server's limitapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/results/{file_id}

Get Latest Result

Get the latest parsing result for a file.

Version filtering:

  • version: Filter by specific version (e.g., "2.5.0")

  • latest_version_only: Return result from the newest version (default: True)

  • Operation ID: get_latest_result_api_results__file_id__get

  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes
versionquerystring or nullNoFilter by specific version (e.g., '2.5.0')
latest_version_onlyquerybooleanNoReturn only the result from the latest/newest version (default: True) Default: true.

Responses

StatusDescriptionContent
200Successful Responseapplication/json: ResultResponse
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/results/{file_id}/versions

Get All Versions

Get all available versions for a file's parsing results.

Returns a list of all versions with their result details.

  • Operation ID: get_all_versions_api_results__file_id__versions_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
file_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Tasks

GET /api/tasks

List Tasks

The caller's parse tasks, newest first, limit per page with an opaque next_cursor.

Owner-scoped: a caller sees its own tasks; the global view (admin portal) sees every task.

  • Operation ID: tasks_list
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
statusqueryarray of string, one of pending, processing, completed, failed or nullNo
limitqueryintegerNoFrom 1 to 100. Default: 20.
cursorquerystring or nullNo

Responses

StatusDescriptionContent
200Successful Responseapplication/json: JobList
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

GET /api/tasks/{task_id}

Get Task

One parse task as a Job.

  • Operation ID: tasks_get
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
task_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: Job
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

POST /api/tasks/{task_id}/cancel

Cancel Task

Cancel a task that has not started yet (pending); it ends as failed with cancelled.

A task that is already running answers 409 not_cancellable, a finished one 409 conflict; both carry details.status. Cancelling twice is harmless (the second call is a 409 conflict with status failed).

  • Operation ID: tasks_cancel
  • Auth scope: Any valid credential

Parameters

NameInTypeRequiredDescription
task_idpathstringYes

Responses

StatusDescriptionContent
200Successful Responseapplication/json: Job
401Missing or failed credential (unauthenticated)application/json: ErrorResponse
403forbidden or insufficient_scopeapplication/json: ErrorResponse
422Validation Errorapplication/json: HTTPValidationError
429rate_limited; see Retry-Afterapplication/json: ErrorResponse
500internal_error; quote the request_idapplication/json: ErrorResponse
503busy, storage_unavailable or idp_unavailable; see Retry-Afterapplication/json: ErrorResponse

Other operations

GET /

Root

API information and health check.

  • Operation ID: root__get
  • Auth scope: Not specified

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any

GET /health

Health Check

Simple health check endpoint.

  • Operation ID: health_check_health_get
  • Auth scope: Not specified

Responses

StatusDescriptionContent
200Successful Responseapplication/json: any

Schemas

ApiKeyCreate

PropertyTypeRequiredDescription
account_idstring or nullNoBilling account the service key's usage is charged to
allowed_endpointsstring or nullNoComma-separated list of allowed endpoints
descriptionstring or nullNoDescription of the key's purpose
expires_in_daysintegerNoNumber of days until expiration (0 for never) Default: 365.
namestringYesName for the API key
rate_limitinteger or nullNoRequest rate limit per minute
scopesarray of string, one of documents:read, documents:writeNoDocument scopes of the service key (never admin)

ApiKeyCreateRequest

PropertyTypeRequiredDescription
expires_in_daysintegerNoDefault 90, maximum 365 From 1.0 to 365.0. Default: 90.
namestringYesShown in the key list
scopesarray of string, one of documents:read, documents:writeNoPass only documents:read for a read-only agent key

ApiKeyCreated

PropertyTypeRequiredDescription
created_atstring or nullYes
expires_atstring or nullYes
idstringYes
keystringYesThe key itself, shown once; use it as UNTERN_PARSING_TOKEN
key_previewstringYesulk_… and the last four characters; never the key
last_used_atstring or nullYes
namestringYes
scopesarray of stringYes
statusstringYes

ApiKeyListResponse

PropertyTypeRequiredDescription
account_idstring or nullNoBilling account of a service key, if assigned
created_atstringYes
descriptionstring or nullYes
expires_atstring or nullYes
idstringYes
is_adminbooleanYes
key_previewstringYes
last_used_atstring or nullYes
namestringYes
ownerstring or nullNoThe owner's sub, or service for a service key
scopesarray of stringNoDocument scopes of the key
statusstringYes
usage_countintegerYes

ApiKeyResponse

PropertyTypeRequiredDescription
created_atstringYes
descriptionstring or nullYes
expires_atstring or nullYes
idstringYes
keystringYes
namestringYes
statusstringYes

ApiKeySummary

PropertyTypeRequiredDescription
created_atstring or nullYes
expires_atstring or nullYes
idstringYes
key_previewstringYesulk_… and the last four characters; never the key
last_used_atstring or nullYes
namestringYes
scopesarray of stringYes
statusstringYes

AssetInfo

PropertyTypeRequiredDescription
analysisImageAnalysisInfo or nullNo
download_urlstringYes
extensionstringYes
md5stringYes
original_namestringYes
pageinteger or nullNo

BillingAccount

GET /api/me/billing: plan and subscription state; never payment data.

PropertyTypeRequiredDescription
account_idstringYes
cancel_atstring (date-time) or nullNoWhen the subscription ends, if a cancellation is scheduled
environmentstring, one of sandbox, production or nullNo
period_endstring (date-time)Yes
period_startstring (date-time)Yes
planPlanSummaryYes
providerstring or nullNo
scheduled_changeScheduledChange or nullNo
statusstring, one of active, past_due, suspended, closedYes
subscribedbooleanYes

BillingConfig

GET /api/billing/config: what the portal's Paddle.js needs; no secret in it.

PropertyTypeRequiredDescription
client_tokenstring or nullNoPaddle.js client-side token (public by design); null when unset
environmentstring, one of sandbox, production or nullNo
providerstring or nullNo

BillingSummary

Part of GET /api/me; null while billing is off or for callers that are never billed.

PropertyTypeRequiredDescription
modestring, one of meter, enforceYes
planPlanRefYes
previewPreviewStateYes

Body_convert_file_to_pdf_preview_api_files_convert_preview_post

PropertyTypeRequiredDescription
filestringYes

Body_find_markdown_by_source_file_api_markdown_find_by_source_post

PropertyTypeRequiredDescription
source_filestringYes

Body_get_markdown_by_file_api_files_get_markdown_by_file_post

PropertyTypeRequiredDescription
filestringYes
include_contentbooleanNoInclude inline markdown content in response Default: false.

Body_identify_source_from_markdown_api_markdown_identify_source_post

PropertyTypeRequiredDescription
markdown_filestringYes

Body_process_file_api_files_process_post

PropertyTypeRequiredDescription
custom_promptstring or nullNo
filestringYes
force_reparsebooleanNoDefault: false.
max_creditsinteger or nullNoRefuse the parse (402 max_credits_exceeded) when its credit hold would be larger
parsing_modeParsingModeNoDefault: Local.
presetstring or nullNoDocument-type preset from GET /api/files/modes; sets the mode, never the price
project_namestring or nullNo
response_formatstringNoDefault: zip.
sub_groupstring or nullNo
target_pagesstring or nullNo
version_checkbooleanNoDefault: false.
wait_for_resultbooleanNoDefault: true.

Body_upload_artifacts_api_admin_sync_upload_artifacts_post

PropertyTypeRequiredDescription
content_formatstringNoDefault: markdown.
file_idstringYes
markdown_filestring or nullNo
overwrite_objectbooleanNoDefault: false.
result_idstringYes
zip_filestring or nullNo

Body_upload_file_api_files_upload_post

PropertyTypeRequiredDescription
filestringYes
project_namestring or nullNo
sub_groupstring or nullNo

Body_upload_parsed_result_api_admin_sync_upload_parsed_post

PropertyTypeRequiredDescription
content_filestring or nullNo
content_formatstring or nullNo
expire_daysintegerNoDefault: 30.
file_md5stringYes
file_namestringYes
file_sizeinteger or nullNo
file_typestringYes
overwrite_metadatabooleanNoDefault: false.
project_namestring or nullNo
skip_if_existsbooleanNoDefault: true.
source_folderstring or nullNo
sub_groupstring or nullNo
versionstringNoDefault: 2.9.0.
zip_filestring or nullNo

BulkDeleteByIdsRequest

Delete specific results by their IDs

PropertyTypeRequiredDescription
delete_artifactsbooleanNoAlso delete S3 artifacts Default: true.
result_idsarray of stringYesList of result IDs to delete (max 200)

BulkDeleteFilesRequest

Delete specific files by their IDs (cascades to results + S3)

PropertyTypeRequiredDescription
delete_artifactsbooleanNoAlso delete S3 artifacts before cascade Default: true.
file_idsarray of stringYesList of file IDs to delete (max 100)

BulkDeleteResponse

Response chung cho cả 2 delete routes

PropertyTypeRequiredDescription
affected_resultsarray of DeletedResultInfoYes
delete_modestringYes
deleted_countintegerYes
dry_runbooleanYes
duration_msintegerYes
errorsarray of stringYes
filter_descriptionstringYes
s3_deleted_countintegerYes
total_matchedintegerYes
urls_cleared_countintegerYes

BulkDownloadRequest

Download multiple results as one ZIP

PropertyTypeRequiredDescription
formatstringNoDownload format: 'zip' or 'markdown' Default: zip.
result_idsarray of stringYesList of result IDs to download (max 50)

BulkExternalRegistration

Request đăng ký bulk multiple files

PropertyTypeRequiredDescription
batch_metadataobject or nullNoMetadata cho batch
entriesarray of ExternalRegistrationEntry or nullNo
filesarray of ClientRegistrationEntry or nullNo
metadataobject or nullNoAlternative metadata field
sample_entriesarray of ClientRegistrationEntry or nullNo

BulkRegistrationResponse

Response cho bulk registration

PropertyTypeRequiredDescription
batch_metadataobject or nullNo
errorsintegerYes
resultsarray of RegistrationResultYes
skippedintegerYes
successfulintegerYes
total_entriesintegerYes

BulkSyncRequest

Phase 1: Batch metadata sync request (JSON only, no files)

PropertyTypeRequiredDescription
batch_metadataobject or nullNo
default_expire_daysintegerNoDefault days until expiration Default: 30.
default_project_namestring or nullNoDefault project name for all entries
default_sub_groupstring or nullNoDefault sub-group for all entries
default_versionstringNoDefault parser version Default: 2.3.0.
entriesarray of SyncDocumentEntryYes
overwrite_metadatabooleanNoOverwrite existing Result record if (md5, version) exists Default: false.
skip_duplicatesbooleanNoSkip if (md5, version) exists Default: true.

BulkSyncResponse

Batch sync response

PropertyTypeRequiredDescription
batch_idstringYes
batch_metadataobject or nullNo
createdintegerYes
errorsintegerYes
resultsarray of SyncResultEntryYes
skippedintegerYes
sync_time_msintegerYes
total_entriesintegerYes
updatedintegerNoDefault: 0.

CheckoutBody

PropertyTypeRequiredDescription
intervalstring, one of month, yearNoDefault: month.
planstringYesPlan id, e.g. starter

CheckoutSessionOut

PropertyTypeRequiredDescription
checkout_urlstring or nullNoHosted checkout page, if any
client_tokenstring or nullNoPaddle.js client-side token of this environment (public by design); null when the server has none (the portal then uses its build-time token)
environmentstring, one of sandbox, productionYes
price_idstring or nullNoThe provider's price id (never hard-coded)
providerstringYes
transaction_idstringYesOpen it with Paddle.Checkout.open({transactionId})

CleanupExpiredRequest

Cleanup expired records request

PropertyTypeRequiredDescription
before_datestring (date-time) or nullNoClean expired before this date
delete_artifactsbooleanNoAlso delete S3 artifacts Default: true.
dry_runbooleanNoPreview only, don't delete Default: true.
project_namestring or nullNoFilter by project name
sub_groupstring or nullNoFilter by sub-group

CleanupExpiredResponse

Cleanup result

PropertyTypeRequiredDescription
affected_file_idsarray of stringYes
affected_result_idsarray of stringYes
cleaned_countintegerYes
dry_runbooleanYes
storage_freed_bytesintegerYes
total_expiredintegerYes

ClientFileData

Client format for file_data

PropertyTypeRequiredDescription
file_sizeintegerYes
md5stringYes
namestringYes
processing_timestampstringYes
statusstringNoDefault: parsed.
typestringYes

ClientRegistrationEntry

Client format entry - different structure

PropertyTypeRequiredDescription
file_dataClientFileDataYes
metadataobject or nullNo
result_dataClientResultDataYes

ClientResultData

Client format for result_data

PropertyTypeRequiredDescription
content_formatstringNoDefault: markdown_bundle.
markdown_filesarray of objectYes
markdown_files_countintegerYes
markdown_md5stringYes
markdown_sizeintegerYes
markdown_total_sizeintegerYes
output_folder_pathstringYes
primary_markdown_filestringYes
statusstringNoDefault: done.

ConfigResponse

PropertyTypeRequiredDescription
gemini_cost_limitnumberYes
gemini_service_account_cost_limitnumberYes
sourcestringYes

ConfigUpdate

PropertyTypeRequiredDescription
gemini_cost_limitnumber or nullNo
gemini_service_account_cost_limitnumber or nullNo

CostInfo

PropertyTypeRequiredDescription
api_callsinteger or nullNoDefault: 0.
errorstring or nullNo
gemini_costnumber or nullNoDefault: 0.0.
gpt_costnumber or nullNoDefault: 0.0.
gpt_input_tokensinteger or nullNoDefault: 0.
gpt_output_tokensinteger or nullNoDefault: 0.
gpt_tokensinteger or nullNoDefault: 0.
input_tokensinteger or nullNoDefault: 0.
mistral_costnumber or nullNoDefault: 0.0.
mistral_input_tokensinteger or nullNoDefault: 0.
mistral_output_tokensinteger or nullNoDefault: 0.
mistral_tokensinteger or nullNoDefault: 0.
output_tokensinteger or nullNoDefault: 0.
parser_modestring or nullNo
parser_versionstring or nullNo
skeleton_costnumber or nullNoDefault: 0.0.
skeleton_cost_per_pagenumber or nullNo
skeleton_creditsinteger or nullNoDefault: 0.
skeleton_credits_per_pagenumber or nullNo
total_costnumber or nullNoDefault: 0.0.

CostsResponse

PropertyTypeRequiredDescription
current_monthstringYes
keysarray of KeyCostInfoYes

DateFilterField

Field để filter theo date

Type: string, one of created_at, expire_at.

DeleteByDateRequest

Request xóa theo date range

PropertyTypeRequiredDescription
date_fieldDateFilterFieldNoField để filter: created_at hoặc expire_at Default: created_at.
date_fromstring (date-time) or nullNoTừ ngày (>=)
date_tostring (date-time) or nullNoĐến ngày (<=)
delete_modeDeleteModeNoDefault: s3_only.
dry_runbooleanNoPreview trước khi xóa Default: true.
project_namestring or nullNoFilter by project name
sub_groupstring or nullNoFilter by sub-group

DeleteByVersionRequest

Request xóa theo version

PropertyTypeRequiredDescription
delete_modeDeleteModeNoDefault: s3_only.
dry_runbooleanNoPreview trước khi xóa Default: true.
project_namestring or nullNoFilter by project name
sub_groupstring or nullNoFilter by sub-group
versionstringYesVersion cần xóa (required)

DeleteMode

Delete mode options

Type: string, one of full, s3_only, metadata_only.

DeletedResultInfo

Thông tin 1 result bị xóa

PropertyTypeRequiredDescription
action_takenstringYes
created_atstringYes
file_idstringYes
file_namestringYes
result_idstringYes
versionstringYes

Document

A parsed document: pages with their blocks and boxes (untern_docai.Document 1.0).

metadata (strings only) carries file_id, result_id, parsing_mode, parser_version, page_count, page_image:<n> (path of page n's image, relative to the API base) for every page that has one, and page_size_unknown (comma-separated page numbers whose size the bundle did not record; those pages report 1 x 1).

PropertyTypeRequiredDescription
idstringYes
metadatamap of stringNo
pagesarray of DocumentPageNo
schema_version"1.0"NoDefault: 1.0.
sourceDocumentSourceYes

DocumentBBox

Axis-aligned box, top-left origin, in the page's unit.

PropertyTypeRequiredDescription
x0numberYes
x1numberYes
y0numberYes
y1numberYes

DocumentBlock

One layout element. A table block (and only it) carries table; its text is the table's Markdown.

PropertyTypeRequiredDescription
bboxDocumentBBox or nullNo
childrenarray of DocumentBlockNo
confidencenumber or nullNo
idstringNoDefault: ``.
keystring or nullNo
levelinteger or nullNo
pageintegerYesAt least 1.0.
tableDocumentTable or nullNo
textstringNoDefault: ``.
typestring, one of heading, paragraph, list, list_item, table, figure, key_value, signature, stampYes
valuestring or nullNo

DocumentPage

A page; its rendered image (when the bundle has one) is named in Document.metadata.

PropertyTypeRequiredDescription
blocksarray of DocumentBlockNo
dpinumber or nullNo
enginestringYes
heightnumberYes
numberintegerYesAt least 1.0.
rotationinteger, one of 0, 90, 180, 270NoDefault: 0.
unitstring, one of pt, pxNoDefault: pt.
widthnumberYes

DocumentSource

PropertyTypeRequiredDescription
mime_typestringYes
namestringYes
size_bytesinteger or nullNo

DocumentTable

A grid of cells; spanned positions are covered by exactly one anchor cell.

PropertyTypeRequiredDescription
cellsarray of DocumentTableCellNo
n_colsintegerYesAt least 0.0.
n_rowsintegerYesAt least 0.0.

DocumentTableCell

PropertyTypeRequiredDescription
bboxDocumentBBox or nullNo
colintegerYesAt least 0.0.
col_spanintegerNoAt least 1.0. Default: 1.
confidencenumber or nullNo
is_headerbooleanNoDefault: false.
rowintegerYesAt least 0.0.
row_spanintegerNoAt least 1.0. Default: 1.
textstringNoDefault: ``.

ErrorDetail

The machine-readable part of an error (stable field names, see module docstring).

PropertyTypeRequiredDescription
codestringYesStable error code from the API's closed list
detailsobjectNoIdentifiers, limits or states that explain the error
messagestringYesOne sentence for people; never contains submitted values
request_idstring or nullNoAlso sent as the X-Request-ID header
retryablebooleanNoTrue when the same request may succeed later Default: false.

ErrorResponse

Body of every error response.

PropertyTypeRequiredDescription
detailanyYesKept from the original API for compatibility
errorErrorDetailYes

Estimate

POST /api/billing/estimate: per-item ceilings; free, nothing is held.

PropertyTypeRequiredDescription
completebooleanYesFalse when an item could not be priced (see its error)
credits_remaininginteger or nullNo
itemsarray of EstimateItemYes
kind"estimate"NoDefault: estimate.
quote_expires_atstring (date-time)YesUntil when these rates apply (15 minutes); estimate again after it
rates_versionstringYes
schema_version"1"NoDefault: 1.
total_creditsintegerYes
within_balanceboolean or nullNo

EstimateFile

Metadata of a file that is not uploaded yet (never its bytes; the name is not used).

PropertyTypeRequiredDescription
mimestringYesMedia type, e.g. application/pdf
namestring or nullNoAccepted, never stored
page_countinteger or nullNoPDF pages or slides
sha256string or nullNoAccepted, not used yet
sheet_cellsarray of integer or nullNoNon-empty cells per sheet (XLSX)
size_bytesinteger or nullNo
text_charsinteger or nullNoCharacters of text (DOCX, TXT)
text_pagesinteger or nullNoPages with a usable text layer, when known

EstimateFileRef

A file already uploaded by the caller.

PropertyTypeRequiredDescription
file_idstringYes

EstimateItem

PropertyTypeRequiredDescription
basisstring or nullNoHow the credits were computed
cachedbooleanNoDefault: false.
creditsinteger or nullYesThe ceiling: the most this item can cost
credits_expectedinteger or nullNoThe likely cost: pages whose text layer is not known are priced as text pages (where the mode has a text rate); equal to credits when every page is known
errorEstimateItemError or nullNo
exactnessstring, one of exact, upper_bound or nullNo
modestring or nullNo
pagesinteger or nullNo

EstimateItemError

PropertyTypeRequiredDescription
codestringYes
messagestring or nullNo

EstimateRequest

PropertyTypeRequiredDescription
itemsarray of EstimateFile or EstimateFileRefYes
modestring or nullNoMode id (fast, auto, precise, expert) or the API spelling (Local); default: the catalog's default mode
optionsobject or nullNoReserved; ignored for now
pagesstring or nullNoPage selection applied to every item, e.g. 1-5,8

Evidence

A quote that was found in the document (untern_docai.extract.Evidence).

PropertyTypeRequiredDescription
bboxDocumentBBox or nullNo
block_idstringYes
pageintegerYes
quotestringYes
reanchoredbooleanNoFound in another block than the cited one Default: false.

ExternalFileInfo

Thông tin file gốc được parse bên ngoài

PropertyTypeRequiredDescription
external_pathstring or nullNoĐường dẫn file gốc bên ngoài
md5stringYesMD5 hash của file gốc
namestringYesTên file gốc
project_namestring or nullNoProject name for grouping
size_bytesinteger or nullNoKích thước file gốc
sub_groupstring or nullNoSub-group within project
typestringYesLoại file (pdf, docx, etc.)

ExternalRegistrationEntry

Entry đăng ký một file đã parse bên ngoài

PropertyTypeRequiredDescription
file_infoExternalFileInfoYes
result_infoExternalResultInfoYes
skip_if_existsbooleanNoBỏ qua nếu file đã tồn tại Default: true.

ExternalResultInfo

Thông tin kết quả parse bên ngoài

PropertyTypeRequiredDescription
content_formatstring or nullNoOutput format: 'markdown' or 'parquet' Default: markdown.
expire_daysinteger or nullNoDays until expiration; local storage cleanup may remove results sooner Default: 30.
external_markdown_pathstring or nullNoĐường dẫn markdown/parquet bên ngoài
external_result_pathstring or nullNoĐường dẫn result ZIP bên ngoài
markdown_md5stringYesMD5 hash của markdown/parquet content
markdown_sizeintegerYesKích thước markdown/parquet content
metadataobject or nullNoMetadata bổ sung
parsing_modestringNoMode parsing đã sử dụng Default: EXTERNAL.
processing_timestampstring (date-time) or nullNoThời gian parse
versionstringNoParser version Default: 2.3.0.

ExtractedField

PropertyTypeRequiredDescription
confidencenumberYesFrom 0.0 to 1.0.
evidencearray of EvidenceNo
messagestring or nullNo
namestringYes
statusstring, one of ok, missing, unsupported, invalidYes
valueJsonValueNo

Extraction

An extraction job and, once completed, its result.

PropertyTypeRequiredDescription
datamap of JsonValue or nullNo
errorServerError or nullNo
errorsarray of stringNo
fieldsmap of ExtractedFieldNo
idstringYes
job_idstring or nullYes
kind"extraction"NoDefault: extraction.
needs_reviewarray of stringNo
prompt_refstring or nullNo
result_idstringYes
schema_refstringYes"invoice@1" or "inline:sha256:<12 hex>"
schema_version"1"NoDefault: 1.
statusstring, one of pending, processing, completed, failedYes
terminalbooleanYes

ExtractionCreate

POST /api/extractions: one source (task_id or result_id) and one schema.

PropertyTypeRequiredDescription
instructionsstring or nullNo
max_creditsinteger or nullNoRefuse when the reservation would be larger (billing)
require_evidencebooleanNoA value without a verified quote from the document is dropped Default: true.
result_idstring or nullNoA result the caller can read
schemaobject or nullNoInline JSON Schema in the CLI-CONTRACT §5.6 subset
schema_refstring or nullNoA server schema NAME@VERSION from GET /api/schemas
task_idstring or nullNoA completed parse task (job id)

FileMetadata

PropertyTypeRequiredDescription
file_typestringYes
parser_versionstringYes
source_md5stringYes
titlestringYes

FileProcessingResponse

PropertyTypeRequiredDescription
cache_hitbooleanNoDefault: false.
cost_infoCostInfo or nullNo
errorstring or nullNo
file_idstring or nullNo
file_namestringYes
markdown_contentstring or nullNo
markdown_urlstring or nullNo
output_folderstring or nullNo
output_typestringNoDefault: markdown.
paged_documentPagedDocumentDescriptor or nullNo
parsed_documentParsedDocument or nullNo
result_format"chandra_paged_v1" or nullNo
result_idstring or nullNo
result_urlstring or nullNo
retryablebooleanNoDefault: false.
statusProcessingStatusYes
task_idstringYes

FileStatusEnum

Type: string, one of uploaded, processing, parsed, completed, failed.

FileToMarkdownResponse

PropertyTypeRequiredDescription
file_md5stringYes
file_namestringYes
foundbooleanYes
markdown_dataMarkdownData or nullYes
messagestringYes
source_file_infoSourceFileInfo or nullYes

FileUploadResponse

PropertyTypeRequiredDescription
file_idstringYes
md5stringYes
namestringYes
project_namestring or nullNo
resultsarray of ResultResponseNoDefault: [].
source_urlstring or nullYes
statusFileStatusEnumYes
sub_groupstring or nullNo
typestringYes

HTTPValidationError

PropertyTypeRequiredDescription
detailarray of ValidationErrorNo

ImageAnalysisInfo

Image content analysis result (only present when analyze_images=True).

PropertyTypeRequiredDescription
content_summarystringYes
content_typestringYes
is_usefulbooleanYes
reasonstringYes
skip_reasonstring or nullNo
skippedbooleanNoDefault: false.
text_in_imagestring or nullNo

ImageData

PropertyTypeRequiredDescription
base64_datastringYes
bboxmap of number or string or nullNo
mime_typestringYes
namestringYes
page_numberintegerYes

Job

PropertyTypeRequiredDescription
cache_hitbooleanNoDefault: false.
created_atstring (date-time)Yes
creditsJobCredits or nullNoCredits of this task; null while billing is off
errorJobError or nullNo
file_idstringYes
idstringYesTask id (task_id of POST /api/files/process)
modestring or nullNoParsing mode
pagesstring or nullNoRequested pages, normalised
response_formatstring or nullNo
result_idstring or nullNoSet once the task has completed
retryablebooleanNoDefault: false.
sourceJobSourceNo
statusstring, one of pending, processing, completed, failedYes
terminalbooleanYesTrue for completed and failed
updated_atstring (date-time)Yes

JobCredits

Credits of one task (billing on); the same numbers as the X-Credits-* headers.

PropertyTypeRequiredDescription
chargedinteger or nullNoCharged once the task is terminal
refundedinteger or nullNoReleased back (failed pages, own cache, estimate above actual)
reservedinteger or nullNoCredits held when the task was created

JobError

PropertyTypeRequiredDescription
codestringYesFailure code of the task (closed list of the API)
messagestring or nullNoShort reason; no document content
retryablebooleanYesTrue when submitting the same work again may succeed

JobList

PropertyTypeRequiredDescription
itemsarray of JobYes
next_cursorstring or nullNoOpaque; pass as cursor for the next page, null at the end

JobSource

PropertyTypeRequiredDescription
md5string or nullNoMD5 of the uploaded bytes
namestring or nullNoName of the uploaded file
size_bytesinteger or nullNoSize of the stored source, if known

JsonResultFormat

PropertyTypeRequiredDescription
metadataobjectNoDefault: {}.
pagesarray of ParsedPageNoDefault: [].

JsonValue

Type: any.

KGReadyResponse

PropertyTypeRequiredDescription
assetsarray of AssetInfoNoDefault: [].
export_typestring, one of document, sheetYes
file_idstringYes
file_namestringYes
markdownMarkdownContentYes
metadataFileMetadataYes
result_idstring or nullNo
sheetsarray of SheetInfoNoDefault: [].

KeyCostInfo

PropertyTypeRequiredDescription
cost_limitnumber or nullYes
cumulative_costnumberYes
current_monthstringYes
current_month_costnumberYes
key_suffixstringYes
key_typestringYes
monthly_historyarray of MonthlyCostEntryYes
statusstringYes

LlamaKeyInfo

PropertyTypeRequiredDescription
error_countintegerYes
indexintegerYes
key_suffixstringYes
statusstringYes
success_countintegerYes

LlamaKeysResponse

PropertyTypeRequiredDescription
active_workersintegerYes
keysarray of LlamaKeyInfoYes
status_summaryobjectYes
total_keysintegerYes

LlamaKeysUpdate

PropertyTypeRequiredDescription
keysarray of stringYes

MarkdownContent

PropertyTypeRequiredDescription
contentstringYes
filenamestringYes
md5stringYes

MarkdownData

PropertyTypeRequiredDescription
contentstring or nullNoOptional inline markdown content
markdown_md5stringYes
markdown_sizeintegerYes
markdown_urlstringYes
result_zip_urlstring or nullNoZIP download URL

MarkdownIdentificationResponse

PropertyTypeRequiredDescription
found_sourcebooleanYes
messagestringYes
source_mappingMarkdownSourceMapping or nullYes
uploaded_markdown_md5stringYes

MarkdownSourceMapping

PropertyTypeRequiredDescription
cost_infoobject or nullYes
is_latest_versionbooleanNoWhether this is the latest version Default: false.
markdown_md5stringYes
markdown_sizeintegerYes
markdown_urlstringYes
parsing_modestringYes
processing_datestring (date-time)Yes
project_namestring or nullNo
result_idstringYes
result_zip_urlstring or nullNo
source_file_idstringYes
source_file_md5stringYes
source_file_namestringYes
source_file_typestringYes
source_file_urlstring or nullNo
source_upload_datestring (date-time)Yes
sub_groupstring or nullNo
versionstringNoParser version Default: 2.3.0.

MeResponse

PropertyTypeRequiredDescription
billingBillingSummary or nullNoPlan, allowed modes and the Preview meter; null while billing is off
emailstring or nullNo
expires_atstring (date-time) or nullNo
key_idstring or nullNo
kindstring, one of oidc, api_key, admin_keyYes
namestring or nullNo
principalstringYesoidc:<sub>, key:<id> or admin_key
rolesarray of stringYes
scopesarray of stringYes

ModeInfo

PropertyTypeRequiredDescription
alias_ofstring or nullNoThe catalog mode a legacy spelling means
availablebooleanYesFalse when this server or the caller's plan does not allow it
best_forstring or nullNoDocuments the mode suits
creditsmap of integer or number or nullNoCredits per billable page by page class (text, recognized, vlm)
defaultbooleanYesTrue only for the mode used when none is given
descriptionstring or nullNoWhat the mode does
idstringYesA parsing_mode value of POST /api/files/process
includesarray of stringNoAdd-ons included in the price
kindstring, one of mode, legacyNomode: a catalog mode (fast, auto, precise, expert); legacy: older Default: legacy.
labelstring or nullNoDisplay name, e.g. Auto
messagestring or nullNoThe reason as one plain sentence a portal or agent may show
preset_idsarray of stringNoPresets that use this mode
reasonstring or nullNoWhy the mode is unavailable: license_gated, not_offered, engine_not_configured (this server: the mode's parsing engine has no key) or not_in_plan (the caller's plan); else null
upgrade_tostring or nullNoWith not_in_plan: the plan that includes this mode

ModePlan

PropertyTypeRequiredDescription
idstringYes
modes_allowedarray of string or nullYesNull means every mode
upgrade_tostring or nullNo

ModesResponse

PropertyTypeRequiredDescription
default_modestring or nullNoCatalog mode used when none is given
modesarray of ModeInfoYes
planModePlan or nullNoThe caller's plan while billing is on; null otherwise
presetsarray of PresetInfoNoDocument-type presets
rates_versionstring or nullNoCatalog version of the credits

MonthlyCostEntry

PropertyTypeRequiredDescription
costnumberYes
monthstringYes

OfferedPlan

PropertyTypeRequiredDescription
descriptionstringYes
idstringYes
included_creditsintegerYes
intervalstring or nullNo
modes_allowedarray of string or nullNo
namestringYes
orderinteger or nullNo
pages_per_monthinteger or nullNo
pricePlanPrice or nullNoOnly when the plan and the rates are approved; else null
statusstringYesproposal until the founder approves it (G11)
upgrade_tostring or nullNo

PageItem

PropertyTypeRequiredDescription
bboxmap of number or string or nullNo
mdstringYes
typestringYes
valuestringYes

PagedDocumentDescriptor

PropertyTypeRequiredDescription
document_urlstringYes
file_idstring (uuid)Yes
format"chandra_paged_v1"NoDefault: chandra_paged_v1.
manifest_sha256stringYes
pages_urlstringYes
producer_task_idstring (uuid)Yes
result_idstring (uuid)Yes
selected_page_countintegerYesAt least 1.0.
source_page_countintegerYesAt least 1.0.
total_blocksintegerYesAt least 0.0.
total_imagesintegerYesAt least 0.0.
total_itemsintegerYesAt least 0.0.
total_tokensintegerYesAt least 0.0.
zip_urlstringYes

ParsedDocument

PropertyTypeRequiredDescription
cost_infoCostInfoYes
dict_resultJsonResultFormatYes
job_metadataobjectNoDefault: {}.
markdown_resultstringYes

ParsedPage

PropertyTypeRequiredDescription
chartsarray of ImageDataNoDefault: [].
imagesarray of ImageDataNoDefault: [].
itemsarray of PageItemNoDefault: [].
page_numberintegerYes

ParsingMode

Type: string, one of Local, fast, auto, precise, expert.

PlanList

PropertyTypeRequiredDescription
itemsarray of OfferedPlanYes
previewbooleanYesTrue while only the Preview lineup is offered
rates_versionstringYes

PlanPrice

PropertyTypeRequiredDescription
amountstringYesDecimal string in the catalog's base currency
annual_amountstring or nullNo
currencystringYes
intervalstringYes

PlanRef

PropertyTypeRequiredDescription
idstringYes
modes_allowedarray of string or nullNoModes the plan includes; null means every mode
namestringYes
statusstringYesproposal until the founder approves the plan (G11)
upgrade_tostring or nullNoThe plan that includes more (modes, pages), if any

PlanSummary

PropertyTypeRequiredDescription
idstringYes
namestringYes
statusstringYes
PropertyTypeRequiredDescription
urlstringYesShort-lived link to the provider's customer portal

PresetInfo

PropertyTypeRequiredDescription
idstringYesPass as preset to POST /api/files/process
labelstringYes
modestringYesThe mode the preset runs in; a preset never changes the price
optionsmap of string or integer or booleanNoOptions the preset sets (not applied by the engine yet)

PreviewState

Preview allowance for the portal's credit meter, the CLI and MCP whoami (SPEC §5.8).

PropertyTypeRequiredDescription
activebooleanYesTrue while the product is in Preview
credits_limitintegerYesThe plan's credits for this period
credits_remainingintegerYes
period_endstring (date-time)Yes

ProcessingStatus

Type: string, one of pending, processing, completed, failed.

ProtectedResourceMetadata

PropertyTypeRequiredDescription
authorization_serversarray of stringYesIssuer of realm untern
bearer_methods_supportedarray of stringYes
resourcestring or nullYesCanonical URL of this API (null until configured)
resource_namestringYes
scopes_supportedarray of stringYes

PublicConfig

PropertyTypeRequiredDescription
accepted_extensionsarray of stringYesFile extensions /api/files/process takes
accepted_mime_typesarray of stringYesMedia types of those extensions
max_upload_bytesintegerYesLargest accepted upload in bytes (100 MB at launch)
modesarray of ModeInfoYesSame items as GET /api/files/modes

RegistrationResult

Kết quả đăng ký một entry

PropertyTypeRequiredDescription
file_idstring or nullNo
file_namestringYes
messagestringYes
result_idstring or nullNo
statusstringYes

ResultResponse

PropertyTypeRequiredDescription
content_formatstring or nullNo
created_atstring (date-time)Yes
expire_atstring (date-time) or nullNo
file_idstringYes
markdown_urlstring or nullYes
parsing_modestring or nullNo
result_idstringYes
result_urlstring or nullYes
statusResultStatusEnumYes
sync_sourcestring or nullNo
target_pagesstring or nullNo
versionstringNoDefault: 2.9.0.

ResultStatusEnum

Type: string, one of processing, done, failed, completed.

RevokeResponse

PropertyTypeRequiredDescription
messagestringYes

ScheduledChange

PropertyTypeRequiredDescription
actionstringYescancel, pause or resume (the provider's scheduled change)
effective_atstring (date-time) or nullNo
plan_idstring or nullNoSet when the change switches plans

SchemaInfo

PropertyTypeRequiredDescription
descriptionstringYes
json_schemamap of JsonValueYes
refstringYes
titlestringYes

SchemaList

PropertyTypeRequiredDescription
itemsarray of SchemaInfoYes

ServerError

PropertyTypeRequiredDescription
codestringYes
messagestringYes
retryablebooleanNoDefault: false.

SheetInfo

PropertyTypeRequiredDescription
column_countintegerYes
download_urlstringYes
filenamestringYes
md5stringYes
row_countintegerYes
semantic_summarystringYes
sheet_namestringYes

SourceFileInfo

PropertyTypeRequiredDescription
created_atstring (date-time)Yes
file_idstringYes
namestringYes
project_namestring or nullNo
sub_groupstring or nullNo
typestringYes

SourceToMarkdownMapping

PropertyTypeRequiredDescription
available_versionsarray of stringNoAll available versions for this file
last_processing_datestring (date-time)Yes
latest_versionstring or nullNoThe latest/newest version available
related_markdown_filesarray of MarkdownSourceMappingYes
source_file_md5stringYes
source_file_namestringYes
total_markdown_filesintegerYes

SyncDocumentEntry

Entry for Phase 1 metadata sync - no artifact data

PropertyTypeRequiredDescription
file_infoExternalFileInfoYes
result_infoExternalResultInfoYes
skip_if_existsbooleanNoSkip if (md5, version) exists Default: true.
source_folderstring or nullNoOriginal folder path

SyncResultEntry

Per-entry sync result

PropertyTypeRequiredDescription
file_idstring or nullNo
file_md5stringYes
file_namestringYes
markdown_urlstring or nullNo
messagestringYes
result_idstring or nullNo
result_zip_urlstring or nullNo
statusstringYes
versionstringYes

TokenBudget

PropertyTypeRequiredDescription
limitintegerYes
periodstringYes
remainingintegerYes
usedintegerYes

Usage

GET /api/me/usage: the caller's plan and credits of one period.

PropertyTypeRequiredDescription
as_ofstring (date-time)Yes
credits_includedintegerYes
credits_remainingintegerYesAvailable now (holds taken off), without overage
credits_topup_remainingintegerYes
credits_usedintegerYes
kind"usage"NoDefault: usage.
overage_allowedbooleanYes
overage_capinteger or nullNo
overage_usedintegerYes
pages_includedinteger or nullNoPage cap of the period (Free: 50); null without a page cap
pages_remaininginteger or nullNo
pages_usedinteger or nullNoPages used, open holds included
period_endstring (date-time)Yes
period_startstring (date-time)Yes
planPlanRefYes
previewUsagePreview or nullNo
schema_version"1"NoDefault: 1.
token_budgetTokenBudget or nullNoThe calling key's own budget, when one is set

UsagePreview

PropertyTypeRequiredDescription
enabledbooleanYesTrue while the product is in Preview
poolstring or nullNoThe capacity pool (tier) of the account

ValidationError

PropertyTypeRequiredDescription
ctxobjectNo
inputanyNo
locarray of string or integerYes
msgstringYes
typestringYes