{"openapi":"3.1.0","info":{"title":"HMS Doc Processing Service","description":"PDF analysis, table extraction, document classification, and merchant statement parsing.","version":"0.5.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/analyze":{"post":{"summary":"Analyze","operationId":"analyze_analyze_post","parameters":[{"name":"ocr","in":"query","required":false,"schema":{"type":"string","description":"off|auto|force","default":"auto","title":"Ocr"},"description":"off|auto|force"},{"name":"max_pages","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Max Pages"}},{"name":"return_provenance","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Return Provenance"}},{"name":"profile","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"e.g., merchant_statement_v1","title":"Profile"},"description":"e.g., merchant_statement_v1"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Skip-Cache","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Skip-Cache"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_analyze_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract-tables":{"post":{"summary":"Extract Tables","operationId":"extract_tables_extract_tables_post","parameters":[{"name":"ocr","in":"query","required":false,"schema":{"type":"string","description":"off|auto|force","default":"auto","title":"Ocr"},"description":"off|auto|force"},{"name":"max_pages","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Max Pages"}},{"name":"page_range","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"e.g., 1-3,5,8-10","title":"Page Range"},"description":"e.g., 1-3,5,8-10"},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"json|csv|xlsx|html","default":"json","title":"Format"},"description":"json|csv|xlsx|html"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Skip-Cache","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Skip-Cache"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_tables_extract_tables_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pipedrive/sync":{"post":{"summary":"Pipedrive Sync","operationId":"pipedrive_sync_pipedrive_sync_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pipedrive/sync/status":{"get":{"summary":"Pipedrive Sync Status","operationId":"pipedrive_sync_status_pipedrive_sync_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pipedrive/deals":{"get":{"summary":"Pipedrive Deals","operationId":"pipedrive_deals_pipedrive_deals_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classify":{"post":{"summary":"Classify File","description":"Upload a file for classification.\n- With doc_type: human-labels the file, teaches the classifier\n- Without doc_type: auto-classifies using learned patterns","operationId":"classify_file_classify_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_classify_file_classify_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doc-types":{"get":{"summary":"List Doc Types","operationId":"list_doc_types_doc_types_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Doc Type","operationId":"create_doc_type_doc_types_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_create_doc_type_doc_types_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classify/stats":{"get":{"summary":"Classify Stats","operationId":"classify_stats_classify_stats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys":{"post":{"summary":"Create Api Key","description":"Create a new sub API key. Master key required. The full key is only shown once.","operationId":"create_api_key_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_create_api_key_keys_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Api Keys","description":"List all sub API keys with usage summaries. Master key required.","operationId":"list_api_keys_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/{key_id}/usage":{"get":{"summary":"Get Key Usage","description":"Get usage details for a specific key. Master key required.","operationId":"get_key_usage_keys__key_id__usage_get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/{key_id}":{"delete":{"summary":"Revoke Api Key","description":"Revoke (deactivate) a sub API key. Master key required.","operationId":"revoke_api_key_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_analyze_analyze_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","title":"Body_analyze_analyze_post"},"Body_classify_file_classify_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"doc_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Type","description":"Human-provided label, e.g. 'voided_check'"}},"type":"object","title":"Body_classify_file_classify_post"},"Body_create_api_key_keys_post":{"properties":{"label":{"type":"string","title":"Label","description":"Name for this key, e.g. 'Portal Backend'"},"scopes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scopes","description":"Comma-separated endpoints: 'analyze,extract-tables' or '*' for all"},"rate_limit_rpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Limit Rpm","description":"Max requests per minute (null=unlimited)"}},"type":"object","required":["label"],"title":"Body_create_api_key_keys_post"},"Body_create_doc_type_doc_types_post":{"properties":{"name":{"type":"string","title":"Name","description":"Machine name, e.g. 'w9_form'"},"label":{"type":"string","title":"Label","description":"Human label, e.g. 'W-9 Form'"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","label"],"title":"Body_create_doc_type_doc_types_post"},"Body_extract_tables_extract_tables_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","title":"Body_extract_tables_extract_tables_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"}}}}