{"openapi":"3.1.0","info":{"title":"Trinity Supplement Pipeline","version":"0.1.0"},"paths":{"/config":{"get":{"summary":"Client Config","description":"Public: tells the frontend whether to use Clerk (publishable keys are\nsafe to expose) or fall back to the shared access-code gate.","operationId":"client_config_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/purge":{"post":{"summary":"Admin Purge","description":"Run the retention purge on demand (dry_run to preview). Token-gated.","operationId":"admin_purge_admin_purge_post","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dry Run"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me":{"get":{"summary":"Whoami","description":"The signed-in user's identity + section permissions — the frontend\nbuilds its nav from this. Also the row upsert point (name, last_seen).","operationId":"whoami_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/audit":{"get":{"summary":"Admin Audit","description":"Admin page: who did what, when (audit_events), newest first, with a\nper-person summary over the same window. Filters: days, actor (email),\njob_id, action slug, q (job name contains).","operationId":"admin_audit_admin_audit_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"actor","in":"query","required":false,"schema":{"type":"string","default":"","title":"Actor"}},{"name":"job_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Job Id"}},{"name":"action","in":"query","required":false,"schema":{"type":"string","default":"","title":"Action"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":300,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/audit":{"get":{"summary":"Job Audit","description":"One job's history from the audit log (saves, exports, re-runs...).","operationId":"job_audit_jobs__job_id__audit_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":365,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"summary":"Admin List Users","operationId":"admin_list_users_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Admin Add User","description":"Pre-provision a user before their first sign-in, with permissions set.","operationId":"admin_add_user_admin_users_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"}}}}}}},"/admin/users/{email}":{"patch":{"summary":"Admin Update User","operationId":"admin_update_user_admin_users__email__patch","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"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":"Admin Delete User","description":"Drop the row — on next sign-in the user re-provisions with defaults.","operationId":"admin_delete_user_admin_users__email__delete","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/jobs":{"get":{"summary":"List Jobs","operationId":"list_jobs_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create Job","operationId":"create_job_jobs_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_job_jobs_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/blank":{"post":{"summary":"Create Blank Job","description":"A blank estimate (feedback B16): no documents, no pipeline run.\n\nTrinity builds preliminary estimates from scratch when a carrier denies a\nclaim (~25% of the senior estimator's workload). The job starts in_review\nwith empty carrier and supplement sections and the full macro checklist\npriced from the chosen region-month, so lines are picked and priced rather\nthan typed. Client name is optional; region and month are required because\nevery added line prices from them.","operationId":"create_blank_job_jobs_blank_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"}}}}}}},"/jobs/{job_id}":{"get":{"summary":"Job Detail","operationId":"job_detail_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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","description":"Permanently delete a job and everything it owns (documents, drafts).\n\nFor test junk and mistaken creations — real jobs that simply don't need\nsupplementing should be ARCHIVED (kept, restorable) instead. The UI puts a\nstrong confirm in front of this; there is no undo.","operationId":"delete_job_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/activity":{"get":{"summary":"Job Activity","description":"Read-only mirror of the JobNimbus activity feed. Display only — no\ninterpretation, no write-back.","operationId":"job_activity_jobs__job_id__activity_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/documents/{doc_id}/file":{"get":{"summary":"Document File","description":"Serve a stored document's bytes (from our DB — no JobNimbus call);\ninline disposition + real media type so the browser renders PDFs and\nimages in its own viewer instead of downloading an unnamed blob.","operationId":"document_file_jobs__job_id__documents__doc_id__file_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/documents/{doc_id}/pages":{"get":{"summary":"Document Pages","description":"Page count, for the page-picker grid (permit packets run 60+ pages\nand only the fee page belongs in what gets sent).","operationId":"document_pages_jobs__job_id__documents__doc_id__pages_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/documents/{doc_id}/pagethumb/{page}":{"get":{"summary":"Document Page Thumb","description":"One page rendered at `w` px wide (1-based): 300 for the page-picker\nthumbnails, ~1100 for its large preview pane.","operationId":"document_page_thumb_jobs__job_id__documents__doc_id__pagethumb__page__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"page","in":"path","required":true,"schema":{"type":"integer","title":"Page"}},{"name":"w","in":"query","required":false,"schema":{"type":"integer","default":300,"title":"W"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/documents/{doc_id}/excerpt":{"post":{"summary":"Document Excerpt","description":"Build a trimmed copy of a PDF containing only the chosen pages and\nstore it as its own document (user request 2026-08-20: send the permit\npage with the number, not the 60-page packet). The ORIGINAL is never\nmodified — extraction (TIPF) still reads the full packet; the excerpt is\nwhat gets attached to the export email.","operationId":"document_excerpt_jobs__job_id__documents__doc_id__excerpt_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/documents/{doc_id}/thumb":{"get":{"summary":"Document Thumb","description":"Small preview for the Documents tab: images downscale server-side\n(stored edited photos are full camera resolution — same fix as the JN\nphoto grid); PDFs render page 1 via PyMuPDF at `w` (default 200) px.","operationId":"document_thumb_jobs__job_id__documents__doc_id__thumb_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"w","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"W"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/review":{"get":{"summary":"Review Payload","operationId":"review_payload_jobs__job_id__review_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/draft":{"put":{"summary":"Save Draft","operationId":"save_draft_jobs__job_id__draft_put","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/jobs/{job_id}/drafts":{"get":{"summary":"List Draft Versions","description":"Version history — one row per saved draft, oldest first. Every save,\nre-run, re-price, and restore is already a new version; this just makes\nthat history visible.","operationId":"list_draft_versions_jobs__job_id__drafts_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/drafts/{version}":{"get":{"summary":"Get Draft Version","operationId":"get_draft_version_jobs__job_id__drafts__version__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/drafts/{version}/restore":{"post":{"summary":"Restore Draft Version","description":"Make an old version current by saving a COPY of it as a new latest\nversion (source='restore') — history is append-only, nothing overwritten.","operationId":"restore_draft_version_jobs__job_id__drafts__version__restore_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/requeue":{"post":{"summary":"Requeue","operationId":"requeue_jobs__job_id__requeue_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/draft/blank":{"post":{"summary":"Start Blank Draft","description":"Start an estimate by hand on a job with no documents (user 2026-09-11):\nseeds an empty estimator draft — same payload shape the pipeline emits, no\nrows — and moves the job to in_review so the editor opens. Only for jobs\nthat never produced a draft; a processed job keeps its pipeline output.","operationId":"start_blank_draft_jobs__job_id__draft_blank_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"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"}}}}}}},"/jobs/{job_id}/export":{"post":{"summary":"Export","operationId":"export_jobs__job_id__export_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"user","in":"query","required":false,"schema":{"type":"string","default":"","title":"User"}},{"name":"fromEmail","in":"query","required":false,"schema":{"type":"string","default":"","title":"Fromemail"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/archive":{"post":{"summary":"Archive Job","description":"Mark a job as not-supplementing (retail / attorney or appraisal settled\n/ RMP / other) — it leaves the active queue and moves to the archive.\nNothing is deleted; unarchive restores it.","operationId":"archive_job_jobs__job_id__archive_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/jobs/{job_id}/unarchive":{"post":{"summary":"Unarchive Job","operationId":"unarchive_job_jobs__job_id__unarchive_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/supplement-pdf":{"post":{"summary":"Regenerate Pdf","description":"Manually (re)generate the supplement PDF — after editing lines or\nswapping evidence photos post-export.","operationId":"regenerate_pdf_jobs__job_id__supplement_pdf_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/email":{"get":{"summary":"Get Email","operationId":"get_email_jobs__job_id__email_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Save Email","operationId":"save_email_jobs__job_id__email_put","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/jobs/{job_id}/email/apply/{template_id}":{"get":{"summary":"Apply Template","description":"Resolve a template against this job — subject/body filled, attachment\ncategories mapped to the job's actual doc ids. The modal calls this when\nthe estimator switches templates.","operationId":"apply_template_jobs__job_id__email_apply__template_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/email/done":{"post":{"summary":"Mark Email Done","description":"Move a job out of the Emails queue into Finished without actually\nsending (e.g. it was emailed elsewhere, or doesn't need one). Reversible\nfrom Finished via reopen -> save.","operationId":"mark_email_done_jobs__job_id__email_done_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/graph-status":{"get":{"summary":"Graph Status","operationId":"graph_status_me_graph_status_get","parameters":[{"name":"addr","in":"query","required":false,"schema":{"type":"string","default":"","title":"Addr"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/graph-connect":{"post":{"summary":"Graph Connect","operationId":"graph_connect_me_graph_connect_post","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","default":"","title":"Company"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Graph Disconnect","operationId":"graph_disconnect_me_graph_connect_delete","parameters":[{"name":"addr","in":"query","required":true,"schema":{"type":"string","title":"Addr"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/graph/callback":{"get":{"summary":"Graph Callback","description":"Where Microsoft's popup lands after sign-in. Unauthenticated by nature;\nthe signed state (10-min HMAC we issued in /me/graph-connect) is the gate.\nReplies with a page that reports back to the opener and closes itself.","operationId":"graph_callback_auth_graph_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/jobs/{job_id}/email/send":{"post":{"summary":"Send Email","description":"Send via Microsoft Graph as the estimator's OWN M365 mailbox when the\nGRAPH_* vars are set (their real From, filed in their Sent Items), else\nplain SMTP (SMTP_HOST/PORT/USER/PASS/FROM). JobNimbus is NOT used here —\napp/jobnimbus.py is read-only by design.","operationId":"send_email_jobs__job_id__email_send_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/invoice/products":{"get":{"summary":"Invoice Products","operationId":"invoice_products_invoice_products_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/jobs/{job_id}/invoice":{"get":{"summary":"Get Invoice","operationId":"get_invoice_jobs__job_id__invoice_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Save Invoice","operationId":"save_invoice_jobs__job_id__invoice_put","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/jobs/{job_id}/invoice/pdf":{"post":{"summary":"Regenerate Invoice Pdf","description":"(Re)render the IC-facing invoice PDF — the real-amount copy that rides\nthe supplement email. Renders on the worker, stored as an 'invoice_pdf'\njob document (one current copy per job).","operationId":"regenerate_invoice_pdf_jobs__job_id__invoice_pdf_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/invoice/jn":{"post":{"summary":"Create Jn Invoice","description":"Push the $0-supplement copy to JobNimbus. Guards: the job must be linked\nto a JN record; a job that already has a tool-created JN invoice never gets\na second; an invoice already on the JN job (hand-made by Mike/Nate) blocks\nwith a 409 unless the estimator confirms with force=true.","operationId":"create_jn_invoice_jobs__job_id__invoice_jn_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"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"}}}}}}},"/jobs/{job_id}/details":{"patch":{"summary":"Edit Details","description":"Estimator corrections to job identity fields. Updates the Job columns\n(job list / dashboard) and writes a new draft version with the same\nfields merged (review screen / export) — one edit, visible everywhere,\nwith the draft history as the audit trail.","operationId":"edit_details_jobs__job_id__details_patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/pricing/options":{"get":{"summary":"Pricing Options","description":"Region codes + months available for the price override dropdowns.\n\nany_month, deliberately: this endpoint feeds the picker an estimator uses to\nfix a job we could not price, so it must not itself require a priced month.\n`codes` is every region held in any month.","operationId":"pricing_options_pricing_options_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/feedback":{"post":{"summary":"Submit Feedback","description":"Store a problem report and file it as a GitHub issue.\n\nThe report is durable the moment it hits the table; the issue is best-effort\nand its URL is recorded when it succeeds. Phase 2 (a GitHub Action running\nClaude Code) drafts a fix PR from the issue for James to review.","operationId":"submit_feedback_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"}}}}}}},"/macros":{"get":{"summary":"List Macros","description":"Every macro with its items. The default one drives Remaining Macro Items.","operationId":"list_macros_macros_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create Macro","operationId":"create_macro_macros_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"}}}}}}},"/macros/{macro_id}":{"patch":{"summary":"Edit Macro","operationId":"edit_macro_macros__macro_id__patch","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro 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 Macro","operationId":"delete_macro_macros__macro_id__delete","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/macros/{macro_id}/items":{"post":{"summary":"Add Macro Item","description":"Add a line to a macro, from the full priced code list (code + act).","operationId":"add_macro_item_macros__macro_id__items_post","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro 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"}}}}}}},"/macros/{macro_id}/items/{item_id}":{"patch":{"summary":"Edit Macro Item","operationId":"edit_macro_item_macros__macro_id__items__item_id__patch","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item 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 Macro Item","operationId":"delete_macro_item_macros__macro_id__items__item_id__delete","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notes":{"get":{"summary":"List Notes","description":"Note snippets — all of them, or only those offered for one item code\n(its prefixes plus the unscoped ones).","operationId":"list_notes_notes_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Note","operationId":"create_note_notes_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"}}}}}}},"/notes/{note_id}":{"patch":{"summary":"Edit Note","operationId":"edit_note_notes__note_id__patch","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note 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 Note","operationId":"delete_note_notes__note_id__delete","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pricing/codes":{"get":{"summary":"Pricing Codes","description":"The full known code list (code, act, desc, unit) — feeds the macro editor's\nadd-item picker. From price_code_acts, which every import keeps current.","operationId":"pricing_codes_pricing_codes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/pricing/coverage":{"get":{"summary":"Pricing Coverage","description":"Region x month grid of loaded price lists, plus the import log.\n\nDoubles as the backfill checklist: an empty cell is a price list nobody has\npulled from Xactimate yet.","operationId":"pricing_coverage_pricing_coverage_get","parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"export","title":"Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pricing/import":{"post":{"summary":"Pricing Import","description":"Land one price-list pull: the pricing template's Rough Draft report PDF.\n\nThe report declares its own price list (region, month, variant) in its\nheader, states every line's activity outright, and carries per-line tax at\nthe template jurisdiction — so there is nothing for the importer to type\nand nothing to mislabel. The old Excel export path remains available as a\nCLI fallback (scripts/import_price_export.py) but not here: it carries no\nprovenance and no activity, both of which this page used to have to ask for.\n\nRefusals come back as 409 with a `reason` the UI turns into a specific\nconfirm (\"replace\" / \"allow duplicate\") rather than a generic retry — each\none is a distinct way to corrupt a month and needs its own decision.","operationId":"pricing_import_pricing_import_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pricing_import_pricing_import_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pricing/zipmap":{"get":{"summary":"Zipmap Stats","description":"Zip-map coverage: zips per region, confidence mix, recent uploads.","operationId":"zipmap_stats_pricing_zipmap_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Zipmap Import","description":"Upload a zip-map sheet.\n\nmode=merge (default) adds and corrects, leaving zips the sheet omits alone — a\nsheet covering three new counties must not delete the other 1,400.\nmode=replace makes the sheet the entire map. dry_run reports what would change.","operationId":"zipmap_import_pricing_zipmap_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_zipmap_import_pricing_zipmap_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pricing/code-acts":{"post":{"summary":"Pricing Declare Code Acts","description":"Declare which legs a new item code carries, once, so imports stop asking.\n\nBody: {\"codes\": {\"RFGNEWCODE\": [\"-\", \"+\"], ...}}. Activities are stored as a\nset — prices are matched to them cheapest-first, since removal is always\nbelow install and R&R (removal + install) is above both.","operationId":"pricing_declare_code_acts_pricing_code_acts_post","parameters":[{"name":"user","in":"query","required":false,"schema":{"type":"string","default":"","title":"User"}}],"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"}}}}}}},"/pricing/imports/{import_id}":{"delete":{"summary":"Pricing Import Undo","description":"Remove one import and its rows — undo for a pull that went in wrong.","operationId":"pricing_import_undo_pricing_imports__import_id__delete","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pricing/items":{"get":{"summary":"Pricing Items","description":"Every priced item for one region+month — feeds the line-item typeahead\nin the review UI. The & (detach & reset) price is derived as + plus -\nwhen both legs exist and the matrix has no explicit & row (never the\nreverse: removal must not borrow install pricing).","operationId":"pricing_items_pricing_items_get","parameters":[{"name":"region","in":"query","required":true,"schema":{"type":"string","title":"Region"}},{"name":"month","in":"query","required":false,"schema":{"type":"string","default":"","title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/reprice":{"post":{"summary":"Reprice","description":"Re-resolve PRICES only, preserving estimator work (user request\n2026-08-20): the latest draft keeps its order, quantities, notes, added\nlines, dividers, and section moves; every Trinity row with an item code\ngets its unit prices, R&R split, and tax re-looked-up at the chosen\nregion + month. Rows without a match keep their numbers and are flagged.\nA job with no draft yet falls back to a full regenerate from the stored\nengine output (the pre-2026-08-20 behaviour).","operationId":"reprice_jobs__job_id__reprice_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/jobs/{job_id}/kpi":{"patch":{"summary":"Set Kpi Fields","description":"The dashboard's manual entries (bulk row editor). Every field set here\nis recorded in kpi_overrides so the UI can render it as hardcoded; clearing\na field removes the mark and falls back to the derived/pipeline value.","operationId":"set_kpi_fields_jobs__job_id__kpi_patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/webhooks/jobnimbus":{"post":{"summary":"Jobnimbus Webhook","description":"JobNimbus Automation -> Send a Webhook lands here. Two hard gates before\nanything is pulled: the job name must contain JOBNIMBUS_TEST_FILTER (safety\nnet while this runs against production) and the status must match\nJOBNIMBUS_TRIGGER_STATUS. Field names are extracted defensively — JobNimbus's\nexact payload shape wasn't available to verify against, so several\ncandidate keys are tried and the raw body is always logged for the first\nreal test to confirm or correct them.","operationId":"jobnimbus_webhook_webhooks_jobnimbus_post","parameters":[{"name":"secret","in":"query","required":false,"schema":{"type":"string","default":"","title":"Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kpi":{"get":{"summary":"Kpi","description":"Supplement-log rows: everything the dashboard derives ($/sq, increase,\nbonus) is computed client-side from these raw values. Archived jobs\n(retail / attorney / appraisal / RMP) aren't supplements, so they're\nexcluded from the supplement metrics.","operationId":"kpi_kpi_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/jobs/{job_id}/photos":{"get":{"summary":"Job Photos","description":"Photos attached to the job in JobNimbus (read-only pull), listed\nlive so the tab is always current.","operationId":"job_photos_jobs__job_id__photos_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/jnfiles":{"get":{"summary":"Job Jn Files","description":"Every non-photo file attached to the job in JobNimbus (read-only pull)\n— the Documents tab lists these alongside the stored/processed docs.\nPhotos are excluded here; the Photos tab serves those.","operationId":"job_jn_files_jobs__job_id__jnfiles_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/jnfiles/{file_id}/categorize":{"post":{"summary":"Categorize Jn File","description":"Assign a category to a JobNimbus file that arrived unlabeled (or\nmislabeled) — pulls its bytes and stores it as a job document, so the job\ncan Re-run without a JobNimbus round-trip. Saves to OUR database only;\nnothing is written back to JobNimbus (app/jobnimbus.py is read-only).","operationId":"categorize_jn_file_jobs__job_id__jnfiles__file_id__categorize_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File 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"}}}}}}},"/jobs/{job_id}/documents/{doc_id}":{"patch":{"summary":"Recategorize Document","description":"Change a stored input document's category (fix a wrong JobNimbus label\nor an in-app mistake). Generated documents (edited photos, the exported\nsupplement PDF) are not recategorizable.","operationId":"recategorize_document_jobs__job_id__documents__doc_id__patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","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":"Remove Document","description":"Undo an in-app categorization: only documents the estimator pulled in\n(category_source='estimator') can be removed — JobNimbus keeps the\noriginal, so nothing is lost. Label-pulled and generated docs stay.","operationId":"remove_document_jobs__job_id__documents__doc_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/photos/{file_id}/file":{"get":{"summary":"Job Photo File","description":"Proxy any JobNimbus file's bytes (photos AND documents — the id is a\nJN file jnid either way). Media type from the JN content type, falling\nback to the filename extension. `w` > 0 = downscaled JPEG thumbnail for\nthe photo grid (cached); the full original stays the no-w path.","operationId":"job_photo_file_jobs__job_id__photos__file_id__file_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"ct","in":"query","required":false,"schema":{"type":"string","default":"","title":"Ct"}},{"name":"name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Name"}},{"name":"w","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"W"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/jnfiles/{file_id}/thumb":{"get":{"summary":"Jn File Thumb","description":"First-page thumbnail for a JobNimbus file (user request 2026-08-20 —\nthe Documents tab's JN list was a wall of identical 'PDF' squares).\nDownloads the file from JN (read-only) and renders page 1 via PyMuPDF;\nimages serve as-is. Anything else 404s and the UI keeps its label.","operationId":"jn_file_thumb_jobs__job_id__jnfiles__file_id__thumb_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/photos/save":{"post":{"summary":"Save Photo Edit","description":"Store an annotated/cropped photo as a job document (category 'photo'),\nremembering any line-item tags placed on it. Editing an ORIGINAL creates\na copy; editing an already-edited photo (replace_id) overwrites it in\nplace. Saves to OUR database only — app/jobnimbus.py is read-only.","operationId":"save_photo_edit_jobs__job_id__photos_save_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_save_photo_edit_jobs__job_id__photos_save_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settings/{key}":{"get":{"summary":"Get Setting","operationId":"get_setting_settings__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Put Setting","description":"value=null clears the setting back to the built-in default.","operationId":"put_setting_settings__key__put","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"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"}}}}}}},"/permits":{"get":{"tags":["permits"],"summary":"List Permits","description":"Active permits by default; archived=1 lists only the archived ones.","operationId":"list_permits_permits_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"archived","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["permits"],"summary":"Create Permit","operationId":"create_permit_permits_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/archive":{"post":{"tags":["permits"],"summary":"Archive Permits","description":"Archive (or with \"archive\": false, unarchive) several permits at once —\nthe list's multi-select. Status and documents are untouched.","operationId":"archive_permits_permits_archive_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"}}}}}}},"/permits/notaries":{"get":{"tags":["permits"],"summary":"Notaries","description":"Notaries whose seal + signature the tool can apply (assets/notaries).","operationId":"notaries_permits_notaries_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/permits/{permit_id}":{"get":{"tags":["permits"],"summary":"Get Permit","operationId":"get_permit_permits__permit_id__get","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["permits"],"summary":"Update Permit","operationId":"update_permit_permits__permit_id__patch","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit 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":{"tags":["permits"],"summary":"Delete Permit","operationId":"delete_permit_permits__permit_id__delete","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/appraisal":{"post":{"tags":["permits"],"summary":"Upload Appraisal","description":"Manual appraisal upload -> store + extract + prefill.","operationId":"upload_appraisal_permits__permit_id__appraisal_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_appraisal_permits__permit_id__appraisal_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/appraisal/from-jn":{"post":{"tags":["permits"],"summary":"Appraisal From Jn","description":"Pick a JobNimbus file as the appraisal: pull its bytes, store, extract.","operationId":"appraisal_from_jn_permits__permit_id__appraisal_from_jn_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit 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"}}}}}}},"/permits/{permit_id}/id-doc":{"post":{"tags":["permits"],"summary":"Upload Id Doc","operationId":"upload_id_doc_permits__permit_id__id_doc_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_id_doc_permits__permit_id__id_doc_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/id-doc/from-jn":{"post":{"tags":["permits"],"summary":"Id Doc From Jn","description":"\"Use as ID\" on a JobNimbus file: pull its bytes and keep them as the\nowner's identification document.","operationId":"id_doc_from_jn_permits__permit_id__id_doc_from_jn_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit 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"}}}}}}},"/permits/{permit_id}/jnfiles":{"get":{"tags":["permits"],"summary":"Permit Jn Files","description":"The JN contact's non-photo files, with their JN labels — both the\nappraisal picker and the mislabeled-docs check (does the record hold a\nlabeled permit packet for the estimating side?).","operationId":"permit_jn_files_permits__permit_id__jnfiles_get","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/generate-noc":{"post":{"tags":["permits"],"summary":"Generate Noc Endpoint","operationId":"generate_noc_endpoint_permits__permit_id__generate_noc_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/notarize":{"post":{"tags":["permits"],"summary":"Notarize Endpoint","description":"Apply a notary's seal, signature, printed name and today's date to the\nlatest generated NOC. The user confirms the NOC first (UI) — this is the\nin-app equivalent of stamping the paper, so it stores a new document\nrather than altering the generated one.","operationId":"notarize_endpoint_permits__permit_id__notarize_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit 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"}}}}}}},"/permits/{permit_id}/recorded-copy":{"post":{"tags":["permits"],"summary":"Upload Recorded Copy","description":"The clerk's recorded NOC back from Simplifile — closes the loop.","operationId":"upload_recorded_copy_permits__permit_id__recorded_copy_post","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_recorded_copy_permits__permit_id__recorded_copy_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/documents/{doc_id}/file":{"get":{"tags":["permits"],"summary":"Permit Document File","operationId":"permit_document_file_permits__permit_id__documents__doc_id__file_get","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/jnfiles/{file_id}/file":{"get":{"tags":["permits"],"summary":"Permit Jn File","description":"Full JobNimbus file for the in-app preview popup — the quick look that\ntells the user which file is the property appraisal before classifying.\nRead-only pull; damaged bytes normalized like everywhere else.","operationId":"permit_jn_file_permits__permit_id__jnfiles__file_id__file_get","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/jnfiles/{file_id}/thumb":{"get":{"tags":["permits"],"summary":"Permit Jn File Thumb","description":"First-page thumbnail for a JobNimbus file (same idea as the estimating\nDocuments tab's JN thumbs). Downloads read-only from JN, normalizes\ndamaged bytes, renders page 1; images serve as-is.","operationId":"permit_jn_file_thumb_permits__permit_id__jnfiles__file_id__thumb_get","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/permits/{permit_id}/documents/{doc_id}/thumb":{"get":{"tags":["permits"],"summary":"Permit Document Thumb","description":"Page-1 preview for the documents list — same rendering as the\nestimating tab's document thumbs.","operationId":"permit_document_thumb_permits__permit_id__documents__doc_id__thumb_get","parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_create_job_jobs_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"},"user":{"type":"string","title":"User","default":""},"display_name":{"type":"string","title":"Display Name","default":""},"categories":{"type":"string","title":"Categories"},"company":{"type":"string","title":"Company","default":"trinity"}},"type":"object","required":["files"],"title":"Body_create_job_jobs_post"},"Body_pricing_import_pricing_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"user":{"type":"string","title":"User","default":""},"replace":{"type":"boolean","title":"Replace","default":false},"allow_duplicate":{"type":"boolean","title":"Allow Duplicate","default":false},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","required":["file"],"title":"Body_pricing_import_pricing_import_post"},"Body_save_photo_edit_jobs__job_id__photos_save_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"tags":{"type":"string","title":"Tags","default":"[]"},"replace_id":{"type":"string","title":"Replace Id","default":""}},"type":"object","required":["file"],"title":"Body_save_photo_edit_jobs__job_id__photos_save_post"},"Body_upload_appraisal_permits__permit_id__appraisal_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_appraisal_permits__permit_id__appraisal_post"},"Body_upload_id_doc_permits__permit_id__id_doc_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_id_doc_permits__permit_id__id_doc_post"},"Body_upload_recorded_copy_permits__permit_id__recorded_copy_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_recorded_copy_permits__permit_id__recorded_copy_post"},"Body_zipmap_import_pricing_zipmap_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"mode":{"type":"string","title":"Mode","default":"merge"},"user":{"type":"string","title":"User","default":""},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","required":["file"],"title":"Body_zipmap_import_pricing_zipmap_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"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}