{"openapi":"3.1.0","info":{"title":"Trinity Material Orders","version":"0.1.0"},"paths":{"/api/auth/config":{"get":{"summary":"Auth Config","description":"Public: tells the UI how to sign in. The publishable key is public by\ndesign; no secrets here.","operationId":"auth_config_api_auth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/active":{"get":{"summary":"Active Users","description":"Signed-in users whose browser talked to the server in the last\n5 minutes — the pre-deploy 'is anyone on?' glance.","operationId":"active_users_api_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/schema":{"get":{"summary":"Schema","operationId":"schema_api_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/jobs/counts":{"get":{"summary":"Job Counts","description":"Queue sizes for the dashboard tab labels (test jobs count separately).","operationId":"job_counts_api_jobs_counts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/jobs":{"get":{"summary":"List Jobs","operationId":"list_jobs_api_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Archived"}},{"name":"test","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Test"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Job","operationId":"create_job_api_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/pull":{"post":{"summary":"Pull Job","description":"'+ New job': fetch ONE job from JobNimbus by its number and process it.","operationId":"pull_job_api_jobs_pull_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/jn-list":{"post":{"summary":"Jn List","description":"'Pull List from JN': every contact in the chosen statuses, marked\nwith whether it already exists here — feeds the selection pop-up.","operationId":"jn_list_api_jobs_jn_list_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/pull-selected":{"post":{"summary":"Pull Selected Jobs","description":"Run the jobs picked in the Pull List pop-up as a batch. Each entry\ncarries an overwrite flag; existing jobs without it are skipped.","operationId":"pull_selected_jobs_api_jobs_pull_selected_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/bulk":{"post":{"summary":"Bulk Action","description":"Selected-rows actions: archive / delete / set a status. The UI shows a\nconfirmation prompt before archive and delete; this endpoint trusts it.","operationId":"bulk_action_api_jobs_bulk_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/names":{"get":{"summary":"Preview Names","description":"Both candidate file names per job — the download pop-up's preview.\ncoded is null when the job's location isn't in the naming guide.","operationId":"preview_names_api_jobs_names_get","parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","title":"Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/download.zip":{"get":{"summary":"Bulk Download","description":"Zip of the latest-draft workbook for each selected job, named by the\nhouse convention. fmt='pdf' ships the Material Order tab printed to PDF\ninstead of the workbook, same naming rules with a .pdf extension.","operationId":"bulk_download_api_jobs_download_zip_get","parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","title":"Ids"}},{"name":"naming_style","in":"query","required":false,"schema":{"type":"string","default":"coded","title":"Naming Style"}},{"name":"fmt","in":"query","required":false,"schema":{"type":"string","default":"xlsx","title":"Fmt"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}":{"get":{"summary":"Get Job","operationId":"get_job_api_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Job","operationId":"delete_job_api_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/status":{"post":{"summary":"Set Status","operationId":"set_status_api_jobs__job_id__status_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/flagged":{"post":{"summary":"Set Flagged","description":"The Review Checklist clears the flag when every item is checked off.\n`done` (the checked-off item texts) persists in the report JSON so the\nchecks survive a reload and the dashboard counts only what's left; a\nre-extraction rebuilds the report and so resets them with the flags.","operationId":"set_flagged_api_jobs__job_id__flagged_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/documents":{"post":{"summary":"Upload Documents","description":"Upload PDFs. `categories` is a JSON object {filename: category};\nanything unmapped is classified by filename/content.","operationId":"upload_documents_api_jobs__job_id__documents_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_documents_api_jobs__job_id__documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}":{"get":{"summary":"Get Document","operationId":"get_document_api_documents__doc_id__get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Recategorize Document","operationId":"recategorize_document_api_documents__doc_id__patch","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Document","operationId":"delete_document_api_documents__doc_id__delete","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/highlighted":{"get":{"summary":"Get Document Highlighted","description":"A throwaway copy of the document with every occurrence of `q` on\n`page` highlighted — the provenance tooltip's jump-and-glow. Read-only\nby construction: the stored PDF is never modified. If the text isn't\nfound, the plain document comes back and the viewer still lands on the\nright page — never an error in the reviewer's face.","operationId":"get_document_highlighted_api_documents__doc_id__highlighted_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/process":{"post":{"summary":"Process","operationId":"process_api_jobs__job_id__process_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/refetch":{"post":{"summary":"Refetch","description":"JobNimbus jobs: re-pull newly labeled files, then re-process.","operationId":"refetch_api_jobs__job_id__refetch_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/run/config":{"get":{"summary":"Run Config","description":"Statuses available to the Run button's selector.","operationId":"run_config_api_run_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/run/cancel":{"post":{"summary":"Cancel Run","description":"Cancel a batch clicked erroneously. Three-part stop:\n1. a cancel flag the batch-lister checks every contact, so a run\n   that's still listing/creating stops adding more;\n2. every queued extraction is dropped;\n3. empty shells are deleted — including EXTRACTING corpses whose\n   worker died (a killed deploy leaves those frozen forever).\nA live mid-extraction job finishes on its own; anything with\ndocuments or drafts is untouched.","operationId":"cancel_run_api_run_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/run":{"post":{"summary":"Run Intake","description":"The manual Run button: poll JobNimbus and pull new jobs.\nOptional body {\"statuses\": [...]} narrows the pull; default is all\nconfigured target statuses.","operationId":"run_intake_api_run_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/run/last":{"get":{"summary":"Last Run","operationId":"last_run_api_run_last_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/notes":{"get":{"summary":"Get Notes","operationId":"get_notes_api_notes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"summary":"Save Notes","operationId":"save_notes_api_notes_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/draft":{"get":{"summary":"Get Draft","operationId":"get_draft_api_jobs__job_id__draft_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Save Draft","operationId":"save_draft_api_jobs__job_id__draft_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/export.xlsx":{"get":{"summary":"Export Xlsx","operationId":"export_xlsx_api_jobs__job_id__export_xlsx_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"naming_style","in":"query","required":false,"schema":{"type":"string","default":"coded","title":"Naming Style"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/export.pdf":{"get":{"summary":"Export Pdf","description":"One job's Material Order tab printed to PDF — the bare file, no zip\n(a single selection deserves a single file).","operationId":"export_pdf_api_jobs__job_id__export_pdf_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"naming_style","in":"query","required":false,"schema":{"type":"string","default":"coded","title":"Naming Style"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback":{"post":{"summary":"Submit Feedback","operationId":"submit_feedback_api_feedback_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/purge":{"post":{"summary":"Admin Purge","description":"Wipe ALL jobs, documents, and drafts (testing-phase reset tool — every\nJobNimbus job is re-pullable with the Run button). Requires the literal\nconfirm string so it can never be triggered by accident.","operationId":"admin_purge_api_admin_purge_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_upload_documents_api_jobs__job_id__documents_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"},"categories":{"type":"string","title":"Categories","default":"{}"}},"type":"object","required":["files"],"title":"Body_upload_documents_api_jobs__job_id__documents_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}