{"openapi":"3.1.0","info":{"title":"OneBiz Hub API","description":"\n**OneBiz Hub** — ระบบข้อมูลกลางสำหรับ OneBiz ERP, OneBiz Go และแอปเฉพาะทาง (OB-HUB-SPEC-001)\n\n* ทุก record ห่อด้วย **envelope** เดียวกัน (`dataset`, `key`, `payload`, `version`, `valid_from/valid_to`, `source`,\n  `fetched_at`, `checksum`, `stale`, `deleted`)\n* ส่ง `Authorization: Bearer obh_live_…` ทุกคำขอ; สิทธิ์ตาม **scope** ของ plan\n* วันที่รับได้ทั้ง ค.ศ. และ พ.ศ. (`2569-09-28`) — ขอผลลัพธ์เป็น พ.ศ. ด้วย `?date_system=be`\n* Delta sync: `GET /v1/datasets/{name}/changes?since=<cursor>`; bootstrap: `/snapshot`\n* Error: `{\"error\": {\"code\": \"SCOPE_DENIED\", \"message\": \"...\", \"request_id\": \"...\"}}`\n","version":"1.0.0"},"paths":{"/v1/datasets":{"get":{"tags":["core"],"summary":"Datasets accessible to this API key","operationId":"list_datasets_v1_datasets_get","parameters":[{"name":"layer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer"}},{"name":"sub_module","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Module"}},{"name":"include_schema","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Schema"}},{"name":"include_inaccessible","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inaccessible"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}":{"get":{"tags":["core"],"summary":"Dataset metadata, schema and cadence","operationId":"get_dataset_info_v1_datasets__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetInfo"}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}/records/{key}":{"get":{"tags":["core"],"summary":"Read one record (supports ?as_of= for effective-dated lookups)","operationId":"get_record_v1_datasets__name__records__key__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"As Of"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}/records/{key}/history":{"get":{"tags":["core"],"summary":"All published versions of a record","operationId":"get_record_history_v1_datasets__name__records__key__history_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}/records":{"get":{"tags":["core"],"summary":"List records in effect on a date (paged)","operationId":"list_records_v1_datasets__name__records_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"As Of"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"},{"name":"prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}/changes":{"get":{"tags":["core"],"summary":"Delta feed since a cursor (omit `since` to start from the beginning, `since=latest` for the head)","operationId":"get_changes_v1_datasets__name__changes_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangesResponse"}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}/snapshot":{"get":{"tags":["core"],"summary":"Latest full snapshot (download links + SHA-256) for initial load","operationId":"get_snapshot_v1_datasets__name__snapshot_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotInfo"}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/datasets/{name}/snapshot/download":{"get":{"tags":["core"],"summary":"Download snapshot file (gzip JSON or Parquet)","operationId":"download_snapshot_v1_datasets__name__snapshot_download_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/events":{"get":{"tags":["core"],"summary":"Change feed (dataset.changed, rule changes, announcements, alerts)","operationId":"get_events_v1_events_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}},{"name":"dataset","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/announcements":{"get":{"tags":["core"],"summary":"Announcements addressed to this tenant's plan","operationId":"get_announcements_v1_announcements_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List Webhooks","operationId":"list_webhooks_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["webhooks"],"summary":"Register a webhook (HMAC-SHA256 signed)","operationId":"create_webhook_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{sub_id}":{"delete":{"tags":["webhooks"],"summary":"Delete Webhook","operationId":"delete_webhook_v1_webhooks__sub_id__delete","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{sub_id}/test":{"post":{"tags":["webhooks"],"summary":"Send a signed test event now","operationId":"test_webhook_v1_webhooks__sub_id__test_post","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{sub_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"Webhook Deliveries","operationId":"webhook_deliveries_v1_webhooks__sub_id__deliveries_get","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/usage":{"get":{"tags":["core"],"summary":"Usage of this tenant in a billing period (YYYY-MM)","operationId":"get_usage_v1_usage_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/me":{"get":{"tags":["core"],"summary":"Tenant, plan, scopes and limits of the calling key","operationId":"me_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/status":{"get":{"tags":["core"],"summary":"Public service status and dataset freshness (no key required)","operationId":"status_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/provinces":{"get":{"tags":["address"],"summary":"All provinces (cascading select step 1)","operationId":"provinces_v1_address_provinces_get","parameters":[{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/provinces/{code}/districts":{"get":{"tags":["address"],"summary":"Districts of a province (step 2)","operationId":"districts_v1_address_provinces__code__districts_get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/districts/{code}/subdistricts":{"get":{"tags":["address"],"summary":"Sub-districts of a district with postal codes (step 3–4)","operationId":"subdistricts_v1_address_districts__code__subdistricts_get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/subdistricts/{code}":{"get":{"tags":["address"],"summary":"Full address entry; `format=etax` returns the ETDA e-Tax structure","operationId":"subdistrict_v1_address_subdistricts__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}},{"name":"postal_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"}},{"name":"house_no","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"House No"}},{"name":"building","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Building"}},{"name":"street","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"}},{"name":"line1","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line1"}},{"name":"line2","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line2"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/postcodes/{postcode}":{"get":{"tags":["address"],"summary":"Reverse lookup: postal code → possible sub-districts (HUB-ADDR-008)","operationId":"postcode_v1_address_postcodes__postcode__get","parameters":[{"name":"postcode","in":"path","required":true,"schema":{"type":"string","title":"Postcode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/suggest":{"get":{"tags":["address"],"summary":"Autocomplete by prefix of sub-district / district / province / postal code (HUB-ADDR-007)","operationId":"suggest_v1_address_suggest_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"level","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/validate":{"post":{"tags":["address"],"summary":"Check province/district/sub-district/postal-code consistency (HUB-ADDR-004)","operationId":"validate_v1_address_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/parse":{"post":{"tags":["address"],"summary":"Parse free-text Thai address into structured fields (HUB-ADDR-009)","operationId":"parse_v1_address_parse_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__address__TextIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/normalize":{"post":{"tags":["address"],"summary":"Expand abbreviations (ถ.→ถนน, ต.→ตำบล, กทม.→กรุงเทพมหานคร) and tidy spacing (HUB-ADDR-010)","operationId":"normalize_v1_address_normalize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__address__TextIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/regions":{"get":{"tags":["address"],"summary":"Regional grouping of provinces (HUB-ADDR-012)","operationId":"regions_v1_address_regions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/address/delivery-zone":{"get":{"tags":["address"],"summary":"Delivery zone hint for onebiz_tms (HUB-ADDR-014)","operationId":"delivery_zone_v1_address_delivery_zone_get","parameters":[{"name":"postal_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"}},{"name":"subdistrict_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subdistrict Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/checksum/{tax_id}":{"get":{"tags":["registry"],"summary":"Offline 13-digit checksum validation (no lookup, no quota)","operationId":"checksum_v1_registry_checksum__tax_id__get","parameters":[{"name":"tax_id","in":"path","required":true,"schema":{"type":"string","title":"Tax Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/verify/{tax_id}":{"get":{"tags":["registry"],"summary":"Verify juristic person + VAT status + branches (partner autofill payload)","operationId":"verify_v1_registry_verify__tax_id__get","parameters":[{"name":"tax_id","in":"path","required":true,"schema":{"type":"string","title":"Tax Id"}},{"name":"branch","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch"}},{"name":"country","in":"query","required":false,"schema":{"type":"string","default":"TH","title":"Country"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}},{"name":"include_directors","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Directors"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/search":{"get":{"tags":["registry"],"summary":"Fuzzy company-name search (Thai / English)","operationId":"search_v1_registry_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/{tax_id}/financials":{"get":{"tags":["registry"],"summary":"Financial statements (3–5 years) with basic ratios (HUB-REG-013)","operationId":"financials_v1_registry__tax_id__financials_get","parameters":[{"name":"tax_id","in":"path","required":true,"schema":{"type":"string","title":"Tax Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/bulk":{"post":{"tags":["registry"],"summary":"Verify up to 1,000 tax IDs as a batch job","operationId":"bulk_v1_registry_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/bulk/{job_id}":{"get":{"tags":["registry"],"summary":"Bulk Status","operationId":"bulk_status_v1_registry_bulk__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":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/watchlist":{"get":{"tags":["registry"],"summary":"List Watch","operationId":"list_watch_v1_registry_watchlist_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["registry"],"summary":"Watch a partner for status / name / address / VAT changes","operationId":"add_watch_v1_registry_watchlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__registry__WatchIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/registry/watchlist/{watch_id}":{"delete":{"tags":["registry"],"summary":"Del Watch","operationId":"del_watch_v1_registry_watchlist__watch_id__delete","parameters":[{"name":"watch_id","in":"path","required":true,"schema":{"type":"string","title":"Watch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/select":{"post":{"tags":["rates"],"summary":"Choose the exchange rate for a document per Revenue Code s.79/4 (HUB-RATE-002)","operationId":"select_rate_v1_rates_select_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/currencies":{"get":{"tags":["rates"],"summary":"Currencies with published BOT / customs rates","operationId":"currencies_v1_rates_currencies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/{currency}":{"get":{"tags":["rates"],"summary":"Rate of a date with previous-working-day fallback (HUB-RATE-004/006)","operationId":"rate_on_v1_rates__currency__get","parameters":[{"name":"currency","in":"path","required":true,"schema":{"type":"string","title":"Currency"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Date"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"},{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"bot","title":"Source"}},{"name":"rate_type","in":"query","required":false,"schema":{"type":"string","default":"mid","title":"Rate Type"}},{"name":"fallback","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Fallback"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/{currency}/history":{"get":{"tags":["rates"],"summary":"Historical rates (up to 10 years) for backdating / revaluation (HUB-RATE-008)","operationId":"history_v1_rates__currency__history_get","parameters":[{"name":"currency","in":"path","required":true,"schema":{"type":"string","title":"Currency"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/month-end/{period}":{"get":{"tags":["rates"],"summary":"Month-end revaluation rates for OB-FX (HUB-RATE-010)","operationId":"month_end_v1_rates_month_end__period__get","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/policy-rate/current":{"get":{"tags":["rates"],"summary":"BOT policy rate and history (HUB-RATE-011)","operationId":"policy_rate_v1_rates_policy_rate_current_get","parameters":[{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"As Of"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/late-interest":{"post":{"tags":["rates"],"summary":"Late-payment interest across statutory rate changes (HUB-RATE-013/014)","operationId":"late_interest_v1_rates_late_interest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LateIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/policy/tenant":{"get":{"tags":["rates"],"summary":"This tenant's rate policy per scenario","operationId":"get_policy_v1_rates_policy_tenant_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["rates"],"summary":"Set the tenant's rate policy (BOT / Customs / manual)","operationId":"put_policy_v1_rates_policy_tenant_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/overrides":{"post":{"tags":["rates"],"summary":"Manual override rate with audit","operationId":"add_override_v1_rates_overrides_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__rates__OverrideIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/alerts":{"post":{"tags":["rates"],"summary":"Notify (event + webhook) when a rate moves more than X% day-on-day","operationId":"add_alert_v1_rates_alerts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/alerts/list":{"get":{"tags":["rates"],"summary":"List Alerts","operationId":"list_alerts_v1_rates_alerts_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rates/alerts/{alert_id}":{"delete":{"tags":["rates"],"summary":"Del Alert","operationId":"del_alert_v1_rates_alerts__alert_id__delete","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/working-day":{"get":{"tags":["calendar"],"summary":"Next/previous working day, add N working days (HUB-CAL-004)","operationId":"working_day_v1_calendar_working_day_get","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Date"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"},{"name":"add","in":"query","required":false,"schema":{"type":"integer","maximum":366,"minimum":-366,"default":0,"title":"Add"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","default":"next","title":"Direction"}},{"name":"calendar","in":"query","required":false,"schema":{"type":"string","default":"bank","title":"Calendar"}},{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/working-days/count":{"get":{"tags":["calendar"],"summary":"Count working days in an inclusive date range","operationId":"count_v1_calendar_working_days_count_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"To"}},{"name":"calendar","in":"query","required":false,"schema":{"type":"string","default":"bank","title":"Calendar"}},{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/holidays":{"get":{"tags":["calendar"],"summary":"Holidays of a year (gov = มติ ครม., bank = ธปท.)","operationId":"holidays_v1_calendar_holidays_get","parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"calendar","in":"query","required":false,"schema":{"type":"string","default":"gov","title":"Calendar"}},{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/convert":{"get":{"tags":["calendar"],"summary":"พ.ศ. ↔ ค.ศ. and Thai date formats (HUB-CAL-007)","operationId":"convert_v1_calendar_convert_get","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Date"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/fiscal-year":{"get":{"tags":["calendar"],"summary":"Map a date to the tenant's fiscal year / period (HUB-CAL-009)","operationId":"fiscal_year_v1_calendar_fiscal_year_get","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Date"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"},{"name":"start_month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Start Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/deadlines":{"get":{"tags":["calendar"],"summary":"Tax / SSO filing deadlines of a year (HUB-CAL-005/006/008)","operationId":"deadlines_v1_calendar_deadlines_get","parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"form","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Form"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"fiscal_year_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Fiscal Year End"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/dbd-deadlines":{"get":{"tags":["calendar"],"summary":"AGM / financial statements / บอจ.5 deadlines (HUB-CAL-011)","operationId":"dbd_deadlines_v1_calendar_dbd_deadlines_get","parameters":[{"name":"fiscal_year_end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Fiscal Year End"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"},{"name":"agm_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Agm Date"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/reminders":{"get":{"tags":["calendar"],"summary":"Deadlines due within N days, for creating Odoo activities (HUB-CAL-012)","operationId":"reminders_v1_calendar_reminders_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":1,"default":14,"title":"Days"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"Start"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"},{"name":"form","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Form"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/ical":{"get":{"tags":["calendar"],"summary":"iCalendar export (.ics) for Google / Outlook (HUB-CAL-013)","operationId":"ical_v1_calendar_ical_get","parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"calendars","in":"query","required":false,"schema":{"type":"string","default":"gov,tax","title":"Calendars"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calendar/today":{"get":{"tags":["calendar"],"summary":"Business date in Asia/Bangkok with Thai formats","operationId":"today_info_v1_calendar_today_get","parameters":[{"name":"calendar","in":"query","required":false,"schema":{"type":"string","default":"bank","title":"Calendar"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules":{"get":{"tags":["rules"],"summary":"Rule sets available (rules-as-data)","operationId":"list_rules_v1_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/{rule}/evaluate":{"post":{"tags":["rules"],"summary":"Evaluate a rule as of a document date; returns the result + rule ID + legal refs","operationId":"evaluate_v1_rules__rule__evaluate_post","parameters":[{"name":"rule","in":"path","required":true,"schema":{"type":"string","title":"Rule"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/{rule}/records":{"get":{"tags":["rules"],"summary":"All entries of a rule set in effect on a date","operationId":"rule_records_v1_rules__rule__records_get","parameters":[{"name":"rule","in":"path","required":true,"schema":{"type":"string","title":"Rule"}},{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)","title":"As Of"},"description":"YYYY-MM-DD (ค.ศ. or พ.ศ.)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/changes/feed":{"get":{"tags":["rules"],"summary":"Rule change feed: new/changed rules with Thai summary, effective date and reference link","operationId":"change_feed_v1_rules_changes_feed_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/golden/cases":{"get":{"tags":["rules"],"summary":"Golden test cases published by OneBiz for self-checks (HUB-RULE-016)","operationId":"golden_cases_v1_rules_golden_cases_get","parameters":[{"name":"rule","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/golden/run":{"post":{"tags":["rules"],"summary":"Run golden cases against the Hub's current rules (incl. this tenant's overrides)","operationId":"golden_run_v1_rules_golden_run_post","parameters":[{"name":"rule","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule"}},{"name":"include_overrides","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Overrides"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/overrides":{"post":{"tags":["rules"],"summary":"Tenant-specific rule value with mandatory reason + audit trail","operationId":"create_override_v1_rules_overrides_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__rules__OverrideIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/overrides/list":{"get":{"tags":["rules"],"summary":"This tenant's overrides (including revoked, for audit)","operationId":"list_overrides_v1_rules_overrides_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rules/overrides/{override_id}/revoke":{"post":{"tags":["rules"],"summary":"Revoke Override","operationId":"revoke_override_v1_rules_overrides__override_id__revoke_post","parameters":[{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__rules__RevokeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/banks":{"get":{"tags":["bank"],"summary":"Banks in Thailand: BOT code, SWIFT/BIC, status (HUB-BANK-001)","operationId":"banks_v1_bank_banks_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/banks/{code}":{"get":{"tags":["bank"],"summary":"One bank by BOT code, SWIFT or short name","operationId":"get_bank_v1_bank_banks__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/promptpay/validate":{"post":{"tags":["bank"],"summary":"Validate a PromptPay ID and detect its type (HUB-BANK-002)","operationId":"promptpay_validate_v1_bank_promptpay_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptPayIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/promptpay/qr":{"post":{"tags":["bank"],"summary":"EMVCo Thai QR payload for PromptPay (HUB-BANK-004)","operationId":"promptpay_qr_v1_bank_promptpay_qr_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/accounts/validate":{"post":{"tags":["bank"],"summary":"Account-number length/format check per bank (HUB-BANK-007)","operationId":"account_validate_v1_bank_accounts_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/clearing-date":{"get":{"tags":["bank"],"summary":"Clearing / value date across bank holidays (HUB-BANK-003, HUB-BANK-010)","operationId":"clearing_v1_bank_clearing_date_get","parameters":[{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":0,"default":1,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/formats":{"get":{"tags":["bank"],"summary":"Bulk payment / statement file formats (HUB-BANK-006/008)","operationId":"formats_v1_bank_formats_get","parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"payment","title":"Kind"}},{"name":"bank_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/gateways":{"get":{"tags":["bank"],"summary":"Payment gateway directory (HUB-BANK-012)","operationId":"gateways_v1_bank_gateways_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/fees":{"get":{"tags":["bank"],"summary":"Reference transfer fees (HUB-BANK-011)","operationId":"fees_v1_bank_fees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank/branches":{"get":{"tags":["bank"],"summary":"Bank branch master (HUB-BANK-005)","operationId":"branches_v1_bank_branches_get","parameters":[{"name":"bank_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/etax/units/map":{"get":{"tags":["etax"],"summary":"Map a Thai unit name (ชิ้น, กิโลกรัม, ชั่วโมง, ชุด …) to a UN/ECE Rec.20 code (HUB-ETAX-001)","operationId":"map_unit_v1_etax_units_map_get","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":60,"title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/etax/codes/{name}":{"get":{"tags":["etax"],"summary":"Code list: unit_code, document_type, tax_type, reason_code, country, currency, schema_version …","operationId":"codes_v1_etax_codes__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/etax/reason-codes/{doc_type}":{"get":{"tags":["etax"],"summary":"Reason codes valid for a debit/credit note or replacement invoice","operationId":"reason_codes_v1_etax_reason_codes__doc_type__get","parameters":[{"name":"doc_type","in":"path","required":true,"schema":{"type":"string","title":"Doc Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/etax/schema/current":{"get":{"tags":["etax"],"summary":"ETDA schema version in force (HUB-ETAX-006)","operationId":"schema_v1_etax_schema_current_get","parameters":[{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/etax/validate-xml":{"post":{"tags":["etax"],"summary":"Basic structural + code-list check of an e-Tax XML (HUB-ETAX-010)","operationId":"validate_xml_v1_etax_validate_xml_post","requestBody":{"content":{"application/xml":{"schema":{"type":"string","title":"Xml"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/ocr":{"post":{"tags":["ai"],"summary":"Thai tax invoice / receipt OCR → structured fields with per-field confidence (HUB-AI-003)","operationId":"ocr_v1_ai_ocr_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ocr_v1_ai_ocr_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/address-normalize":{"post":{"tags":["ai"],"summary":"Normalise a messy Thai address, anchored on HUB-ADDR (HUB-AI-004)","operationId":"address_normalize_v1_ai_address_normalize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__ai__TextIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/partner-dedup":{"post":{"tags":["ai"],"summary":"Fuzzy duplicate detection of partners (HUB-AI-005)","operationId":"partner_dedup_v1_ai_partner_dedup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/law-summarize":{"post":{"tags":["ai"],"summary":"Plain-Thai summary of a new announcement — always queued for expert review (HUB-AI-006)","operationId":"law_summarize_v1_ai_law_summarize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__ai__TextIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/hs-suggest":{"post":{"tags":["ai"],"summary":"HS code suggestions with confidence (HUB-AI-008 / HUB-HS-007)","operationId":"hs_suggest_v1_ai_hs_suggest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/tax-qa":{"post":{"tags":["ai"],"summary":"Tax Q&A grounded only on HUB-RULE records, citing rule IDs (HUB-AI-009)","operationId":"tax_qa_v1_ai_tax_qa_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QaIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/categorize":{"post":{"tags":["ai"],"summary":"Product category + VAT-exempt category suggestion (HUB-AI-010)","operationId":"categorize_v1_ai_categorize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/reviews":{"get":{"tags":["ai"],"summary":"This tenant's low-confidence results awaiting / after human review (HUB-AI-007)","operationId":"reviews_v1_ai_reviews_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/hs/search":{"get":{"tags":["hs"],"summary":"Keyword search (Thai / English / code prefix) ranked by relevance (HUB-HS-002)","operationId":"hs_search_v1_hs_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/hs/codes/{code}":{"get":{"tags":["hs"],"summary":"One tariff line with its hierarchy path and children (HUB-HS-001/003/004)","operationId":"hs_get_v1_hs_codes__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/hs/browse":{"get":{"tags":["hs"],"summary":"Browse chapter → heading → subheading (HUB-HS-004)","operationId":"hs_browse_v1_hs_browse_get","parameters":[{"name":"parent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/hs/mappings":{"put":{"tags":["hs"],"summary":"Save the tenant's product ↔ HS code mapping for reuse (HUB-HS-006)","operationId":"put_mapping_v1_hs_mappings_put","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["hs"],"summary":"List Mappings","operationId":"list_mappings_v1_hs_mappings_get","parameters":[{"name":"product_ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/check/{tax_id}":{"post":{"tags":["radar"],"summary":"One-click KYC report + explainable risk score (HUB-RADAR-001..007, 011, 012)","operationId":"check_v1_radar_check__tax_id__post","parameters":[{"name":"tax_id","in":"path","required":true,"schema":{"type":"string","title":"Tax Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/reports/{report_id}":{"get":{"tags":["radar"],"summary":"Get Report","operationId":"get_report_v1_radar_reports__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/reports/{report_id}/pdf":{"get":{"tags":["radar"],"summary":"KYC report as PDF with timestamp + hash (HUB-RADAR-014)","operationId":"report_pdf_v1_radar_reports__report_id__pdf_get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/audit":{"get":{"tags":["radar"],"summary":"Who checked whom, when and why — this tenant (HUB-RADAR-002)","operationId":"audit_log_v1_radar_audit_get","parameters":[{"name":"tax_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/settings":{"get":{"tags":["radar"],"summary":"Get Settings","operationId":"get_settings_v1_radar_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["radar"],"summary":"Tenant-specific factor weights (HUB-RADAR-013)","operationId":"put_settings_v1_radar_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeightsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/watchlist":{"post":{"tags":["radar"],"summary":"Monthly automatic re-check + status alerts (HUB-RADAR-006/008)","operationId":"watch_v1_radar_watchlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__hs_radar__WatchIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/duplicates":{"post":{"tags":["radar"],"summary":"Find duplicate partners within the tenant (HUB-RADAR-009)","operationId":"dups_v1_radar_duplicates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DupIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/batch":{"post":{"tags":["radar"],"summary":"Screen a whole debtor/creditor list (HUB-RADAR-010)","operationId":"batch_v1_radar_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__api__v1__hs_radar__BatchIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/radar/batch/{job_id}":{"get":{"tags":["radar"],"summary":"Batch Status","operationId":"batch_status_v1_radar_batch__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":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/directory":{"put":{"tags":["network"],"summary":"Opt in / update this tenant's directory entry (HUB-NET-001)","operationId":"opt_in_v1_net_directory_put","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["network"],"summary":"Opt out (hidden from search; existing connections keep working)","operationId":"opt_out_v1_net_directory_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["network"],"summary":"Search opted-in OneBiz tenants","operationId":"directory_v1_net_directory_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"tax_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/connections":{"get":{"tags":["network"],"summary":"Connections","operationId":"connections_v1_net_connections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["network"],"summary":"Request a connection with document permissions (HUB-NET-002)","operationId":"connect_v1_net_connections_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/connections/{conn_id}/respond":{"post":{"tags":["network"],"summary":"Respond Conn","operationId":"respond_conn_v1_net_connections__conn_id__respond_post","parameters":[{"name":"conn_id","in":"path","required":true,"schema":{"type":"string","title":"Conn Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RespondIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/documents":{"post":{"tags":["network"],"summary":"Send a signed document to a connected tenant or external participant","operationId":"send_v1_net_documents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/inbox":{"get":{"tags":["network"],"summary":"Documents received (HUB-NET-003/004)","operationId":"inbox_v1_net_inbox_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"doc_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/outbox":{"get":{"tags":["network"],"summary":"Outbox","operationId":"outbox_v1_net_outbox_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/documents/{doc_id}":{"get":{"tags":["network"],"summary":"Get Doc","operationId":"get_doc_v1_net_documents__doc_id__get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/documents/{doc_id}/as/{target}":{"get":{"tags":["network"],"summary":"Map to an Odoo sale.order or vendor bill (account.move)","operationId":"as_target_v1_net_documents__doc_id__as__target__get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"target","in":"path","required":true,"schema":{"type":"string","title":"Target"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/documents/{doc_id}/ubl":{"get":{"tags":["network"],"summary":"Peppol-ready UBL 2.1 export (HUB-NET-012)","operationId":"ubl_v1_net_documents__doc_id__ubl_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/documents/{doc_id}/status":{"post":{"tags":["network"],"summary":"accepted / rejected / paid / cancelled — synced to the other party (HUB-NET-005)","operationId":"set_status_v1_net_documents__doc_id__status_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/catalogs":{"get":{"tags":["network"],"summary":"Latest catalogues shared with this tenant (HUB-NET-007)","operationId":"catalogs_v1_net_catalogs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/analytics":{"get":{"tags":["network"],"summary":"Documents, partners and response times (HUB-NET-011)","operationId":"analytics_v1_net_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/signing-key":{"get":{"tags":["network"],"summary":"Hub Ed25519 public key for verifying document seals (public)","operationId":"signing_key_v1_net_signing_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/net/verify":{"post":{"tags":["network"],"summary":"Verify a document seal","operationId":"verify_v1_net_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/consent":{"get":{"tags":["insight"],"summary":"Current opt-in status (HUB-INSIGHT-001)","operationId":"consent_v1_insight_consent_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["insight"],"summary":"Grant explicit consent","operationId":"grant_v1_insight_consent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/consent/withdraw":{"post":{"tags":["insight"],"summary":"Withdraw consent — excluded from the next run, purged within 30 days (HUB-INSIGHT-004)","operationId":"withdraw_v1_insight_consent_withdraw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/contributions":{"post":{"tags":["insight"],"summary":"Submit this period's metrics (opt-in only)","operationId":"contribute_v1_insight_contributions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContributionIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/benchmarks":{"get":{"tags":["insight"],"summary":"Anonymised benchmarks per TSIC × size (HUB-INSIGHT-005/006)","operationId":"benchmarks_v1_insight_benchmarks_get","parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"tsic","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tsic"}},{"name":"size","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/widget":{"get":{"tags":["insight"],"summary":"Your position vs your segment, for onebiz_dashboard (HUB-INSIGHT-007)","operationId":"widget_v1_insight_widget_get","parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/indices":{"get":{"tags":["insight"],"summary":"Monthly trend indices (HUB-INSIGHT-008)","operationId":"indices_v1_insight_indices_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/benchmarks/export.xlsx":{"get":{"tags":["insight"],"summary":"Excel export (HUB-INSIGHT-010)","operationId":"export_v1_insight_benchmarks_export_xlsx_get","parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/insight/public/report":{"get":{"tags":["insight"],"summary":"Public quarterly SME index (no key; HUB-INSIGHT-009)","operationId":"public_report_v1_insight_public_report_get","parameters":[{"name":"quarter","in":"query","required":true,"schema":{"type":"string","title":"Quarter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing / invalid / revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SCOPE_DENIED — key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"VALIDATION_ERROR — invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED / QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/lic/v1/tenants/{lic_tenant_id}":{"put":{"tags":["lic"],"summary":"Create or update a tenant (plan changes apply immediately)","operationId":"upsert_tenant_lic_v1_tenants__lic_tenant_id__put","parameters":[{"name":"lic_tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Lic Tenant Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lic/v1/tenants/{lic_tenant_id}/keys":{"post":{"tags":["lic"],"summary":"Issue an API key (plaintext returned once)","operationId":"issue_key_lic_v1_tenants__lic_tenant_id__keys_post","parameters":[{"name":"lic_tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Lic Tenant Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyIssue"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["lic"],"summary":"List Keys","operationId":"list_keys_lic_v1_tenants__lic_tenant_id__keys_get","parameters":[{"name":"lic_tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Lic Tenant 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"}}}}}}},"/lic/v1/keys/{key_id}/revoke":{"post":{"tags":["lic"],"summary":"Revoke a key (effective immediately)","operationId":"revoke_lic_v1_keys__key_id__revoke_post","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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRevoke"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lic/v1/keys/{key_id}/rotate":{"post":{"tags":["lic"],"summary":"Rotate a key (old key valid 7 more days)","operationId":"rotate_lic_v1_keys__key_id__rotate_post","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":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/auth/login":{"post":{"tags":["admin"],"summary":"Admin login → bearer token (12 h)","operationId":"login_admin_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/auth/me":{"get":{"tags":["admin"],"summary":"Me","operationId":"me_admin_api_auth_me_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"}}}}}}},"/admin/api/dashboard":{"get":{"tags":["admin"],"summary":"Operational overview","operationId":"dashboard_admin_api_dashboard_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"}}}}}}},"/admin/api/datasets":{"get":{"tags":["admin"],"summary":"List Datasets","operationId":"list_datasets_admin_api_datasets_get","parameters":[{"name":"sub_module","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Module"}},{"name":"layer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer"}},{"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":{"tags":["admin"],"summary":"Register a new dataset (no gateway change needed)","operationId":"create_dataset_admin_api_datasets_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/datasets/{name}":{"get":{"tags":["admin"],"summary":"Get Dataset","operationId":"get_dataset_admin_api_datasets__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"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"}}}}}},"patch":{"tags":["admin"],"summary":"Operational settings (TTL, freshness, approvals, status)","operationId":"patch_dataset_admin_api_datasets__name__patch","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/datasets/{name}/records":{"get":{"tags":["admin"],"summary":"Browse Records","operationId":"browse_records_admin_api_datasets__name__records_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"as_of","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of"}},{"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"}}}}}}},"/admin/api/datasets/{name}/records/{key}/history":{"get":{"tags":["admin"],"summary":"Record History","operationId":"record_history_admin_api_datasets__name__records__key__history_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"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"}}}}}}},"/admin/api/datasets/{name}/rollback":{"post":{"tags":["admin"],"summary":"Restore the dataset to an earlier version immediately (HUB-ADMIN-011)","operationId":"rollback_admin_api_datasets__name__rollback_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/batches":{"post":{"tags":["admin"],"summary":"Create a draft change batch (manual edit / new rule version)","operationId":"create_batch_admin_api_batches_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__admin__data__BatchIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["admin"],"summary":"List Batches","operationId":"list_batches_admin_api_batches_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"dataset","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"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"}}}}}}},"/admin/api/batches/import":{"post":{"tags":["admin"],"summary":"Import CSV / XLSX / JSON into a draft batch","operationId":"import_batch_admin_api_batches_import_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_batch_admin_api_batches_import_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/batches/{batch_id}":{"get":{"tags":["admin"],"summary":"Get Batch","operationId":"get_batch_admin_api_batches__batch_id__get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch 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"}}}}}}},"/admin/api/batches/{batch_id}/submit":{"post":{"tags":["admin"],"summary":"Submit","operationId":"submit_admin_api_batches__batch_id__submit_post","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch 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"}}}}}}},"/admin/api/batches/{batch_id}/approve":{"post":{"tags":["admin"],"summary":"Approve (four-eyes: the author cannot approve)","operationId":"approve_admin_api_batches__batch_id__approve_post","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/batches/{batch_id}/reject":{"post":{"tags":["admin"],"summary":"Reject","operationId":"reject_admin_api_batches__batch_id__reject_post","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/batches/{batch_id}/cancel":{"post":{"tags":["admin"],"summary":"Cancel","operationId":"cancel_admin_api_batches__batch_id__cancel_post","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch 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"}}}}}}},"/admin/api/rules/preview":{"post":{"tags":["admin"],"summary":"Validate a rule version and preview its impact (timeline + golden cases)","operationId":"rule_preview_admin_api_rules_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/jobs":{"get":{"tags":["admin"],"summary":"List Jobs","operationId":"list_jobs_admin_api_jobs_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"}}}}}}},"/admin/api/jobs/{job_id}":{"patch":{"tags":["admin"],"summary":"Patch Job","operationId":"patch_job_admin_api_jobs__job_id__patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/jobs/{job_id}/run":{"post":{"tags":["admin"],"summary":"Queue a run now (the worker picks it up)","operationId":"run_job_admin_api_jobs__job_id__run_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/runs":{"get":{"tags":["admin"],"summary":"List Runs","operationId":"list_runs_admin_api_runs_get","parameters":[{"name":"job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"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"}}}}}}},"/admin/api/runs/{run_id}":{"get":{"tags":["admin"],"summary":"Get Run","operationId":"get_run_admin_api_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run 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"}}}}}}},"/admin/api/sources":{"get":{"tags":["admin"],"summary":"List Sources","operationId":"list_sources_admin_api_sources_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":{"tags":["admin"],"summary":"Create Source","operationId":"create_source_admin_api_sources_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/sources/{code}":{"patch":{"tags":["admin"],"summary":"Update the licence register entry of a source","operationId":"patch_source_admin_api_sources__code__patch","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/alerts":{"get":{"tags":["admin"],"summary":"List Alerts","operationId":"list_alerts_admin_api_alerts_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"open","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"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"}}}}}}},"/admin/api/alerts/{alert_id}/ack":{"post":{"tags":["admin"],"summary":"Ack Alert","operationId":"ack_alert_admin_api_alerts__alert_id__ack_post","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert 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"}}}}}}},"/admin/api/alerts/{alert_id}/resolve":{"post":{"tags":["admin"],"summary":"Resolve Alert","operationId":"resolve_alert_admin_api_alerts__alert_id__resolve_post","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert 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"}}}}}}},"/admin/api/alerts/test":{"post":{"tags":["admin"],"summary":"Send a test alert through the configured channels (LINE / e-mail / chat)","operationId":"test_alert_admin_api_alerts_test_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"}}}}}}},"/admin/api/audit":{"get":{"tags":["admin"],"summary":"Audit Log","operationId":"audit_log_admin_api_audit_get","parameters":[{"name":"actor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"}},{"name":"target_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"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"}}}}}}},"/admin/api/tenants":{"get":{"tags":["admin"],"summary":"List Tenants","operationId":"list_tenants_admin_api_tenants_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},{"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":{"tags":["admin"],"summary":"Create Tenant","operationId":"create_tenant_admin_api_tenants_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/tenants/{tenant_id}":{"get":{"tags":["admin"],"summary":"Get Tenant","operationId":"get_tenant_admin_api_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant 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"}}}}}},"patch":{"tags":["admin"],"summary":"Plan / scopes / quotas / status — effective immediately, no new key needed","operationId":"patch_tenant_admin_api_tenants__tenant_id__patch","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/tenants/{tenant_id}/keys":{"post":{"tags":["admin"],"summary":"Issue an API key (plaintext shown once)","operationId":"issue_key_admin_api_tenants__tenant_id__keys_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/keys/{key_id}/revoke":{"post":{"tags":["admin"],"summary":"Revoke Key","operationId":"revoke_key_admin_api_keys__key_id__revoke_post","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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hub__admin__ops__RevokeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/keys/{key_id}/rotate":{"post":{"tags":["admin"],"summary":"Rotate: new key now, old key valid 7 more days","operationId":"rotate_key_admin_api_keys__key_id__rotate_post","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":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/plans":{"get":{"tags":["admin"],"summary":"List Plans","operationId":"list_plans_admin_api_plans_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"}}}}}}},"/admin/api/plans/{code}":{"patch":{"tags":["admin"],"summary":"Change a plan's scopes / quotas / limits (applies to all tenants immediately)","operationId":"patch_plan_admin_api_plans__code__patch","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/usage":{"get":{"tags":["admin"],"summary":"Usage per tenant / dataset / endpoint / day","operationId":"usage_admin_api_usage_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"To"}},{"name":"tenant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant"}},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","pattern":"^(tenant|dataset|endpoint|day)$","default":"tenant","title":"Group By"}},{"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"}}}}}}},"/admin/api/usage/export":{"get":{"tags":["admin"],"summary":"Monthly billing export (CSV) per tenant × dataset × endpoint","operationId":"usage_export_admin_api_usage_export_get","parameters":[{"name":"month","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$","title":"Month"}},{"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"}}}}}}},"/admin/api/webhooks":{"get":{"tags":["admin"],"summary":"List Webhook Subs","operationId":"list_webhook_subs_admin_api_webhooks_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"}}}}}}},"/admin/api/webhooks/deliveries":{"get":{"tags":["admin"],"summary":"List Deliveries","operationId":"list_deliveries_admin_api_webhooks_deliveries_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"tenant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"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"}}}}}}},"/admin/api/webhooks/deliveries/{delivery_id}/retry":{"post":{"tags":["admin"],"summary":"Retry Delivery","operationId":"retry_delivery_admin_api_webhooks_deliveries__delivery_id__retry_post","parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery 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"}}}}}}},"/admin/api/events":{"get":{"tags":["admin"],"summary":"List Events","operationId":"list_events_admin_api_events_get","parameters":[{"name":"dataset","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"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"}}}}}}},"/admin/api/announcements":{"get":{"tags":["admin"],"summary":"List Announcements","operationId":"list_announcements_admin_api_announcements_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":{"tags":["admin"],"summary":"Create Announcement","operationId":"create_announcement_admin_api_announcements_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/announcements/{ann_id}":{"delete":{"tags":["admin"],"summary":"Discard a draft announcement","operationId":"delete_announcement_admin_api_announcements__ann_id__delete","parameters":[{"name":"ann_id","in":"path","required":true,"schema":{"type":"string","title":"Ann 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"}}}}}}},"/admin/api/announcements/{ann_id}/send":{"post":{"tags":["admin"],"summary":"Publish to tenants (event + webhooks) filtered by plan/dataset","operationId":"send_announcement_admin_api_announcements__ann_id__send_post","parameters":[{"name":"ann_id","in":"path","required":true,"schema":{"type":"string","title":"Ann 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"}}}}}}},"/admin/api/backups":{"get":{"tags":["admin"],"summary":"List Backups","operationId":"list_backups_admin_api_backups_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"}}}}}}},"/admin/api/backups/run":{"post":{"tags":["admin"],"summary":"Take a backup now","operationId":"run_backup_admin_api_backups_run_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/backups/restore-test":{"post":{"tags":["admin"],"summary":"Quarterly restore drill into a scratch database","operationId":"restore_test_admin_api_backups_restore_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/users":{"get":{"tags":["admin"],"summary":"List Users","operationId":"list_users_admin_api_users_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":{"tags":["admin"],"summary":"Create User","operationId":"create_user_admin_api_users_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/users/{user_id}":{"patch":{"tags":["admin"],"summary":"Patch User","operationId":"patch_user_admin_api_users__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/ai/reviews":{"get":{"tags":["admin"],"summary":"Ai Reviews","operationId":"ai_reviews_admin_api_ai_reviews_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"pending","title":"Status"}},{"name":"service","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"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"}}}}}}},"/admin/api/ai/reviews/{item_id}/decide":{"post":{"tags":["admin"],"summary":"Approve / correct / reject a low-confidence AI result","operationId":"decide_admin_api_ai_reviews__item_id__decide_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api/ai/usage":{"get":{"tags":["admin"],"summary":"Ai Usage","operationId":"ai_usage_admin_api_ai_usage_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"}}}}}}},"/admin/api/radar/audit":{"get":{"tags":["admin"],"summary":"Radar accountability log across tenants (who checked whom, why)","operationId":"radar_audit_admin_api_radar_audit_get","parameters":[{"name":"tax_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},{"name":"tenant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"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"}}}}}}},"/admin/api/net/overview":{"get":{"tags":["admin"],"summary":"Net Overview","operationId":"net_overview_admin_api_net_overview_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"}}}}}}}},"components":{"schemas":{"AccountIn":{"properties":{"bank_code":{"type":"string","title":"Bank Code"},"account_number":{"type":"string","title":"Account Number"}},"type":"object","required":["bank_code","account_number"],"title":"AccountIn"},"AlertIn":{"properties":{"currency":{"type":"string","maxLength":3,"minLength":3,"title":"Currency"},"threshold_pct":{"type":"number","maximum":100.0,"exclusiveMinimum":0.0,"title":"Threshold Pct"},"rate_field":{"type":"string","enum":["mid_rate","selling","buying_transfer","buying_sight"],"title":"Rate Field","default":"mid_rate"}},"type":"object","required":["currency","threshold_pct"],"title":"AlertIn"},"AnnouncementIn":{"properties":{"title_th":{"type":"string","title":"Title Th"},"title_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title En"},"body_th":{"type":"string","title":"Body Th"},"body_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body En"},"severity":{"type":"string","pattern":"^(info|warning|critical)$","title":"Severity","default":"info"},"target_plans":{"items":{"type":"string"},"type":"array","title":"Target Plans","default":[]},"target_datasets":{"items":{"type":"string"},"type":"array","title":"Target Datasets","default":[]},"effective_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective From"},"reference_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Url"}},"type":"object","required":["title_th","body_th"],"title":"AnnouncementIn"},"AttachmentIn":{"properties":{"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type","default":"application/octet-stream"},"data_b64":{"type":"string","title":"Data B64"}},"type":"object","required":["name","data_b64"],"title":"AttachmentIn"},"Body_import_batch_admin_api_batches_import_post":{"properties":{"dataset":{"type":"string","title":"Dataset"},"reason":{"type":"string","title":"Reason"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"default_valid_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Valid From"}},"type":"object","required":["dataset","reason","file"],"title":"Body_import_batch_admin_api_batches_import_post"},"Body_ocr_v1_ai_ocr_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"type":"object","title":"Body_ocr_v1_ai_ocr_post"},"BulkIn":{"properties":{"tax_ids":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Tax Ids"}},"type":"object","required":["tax_ids"],"title":"BulkIn"},"CatIn":{"properties":{"product_name":{"type":"string","maxLength":500,"minLength":1,"title":"Product Name"}},"type":"object","required":["product_name"],"title":"CatIn"},"ChangesResponse":{"properties":{"dataset":{"type":"string","title":"Dataset"},"dataset_version":{"type":"integer","title":"Dataset Version"},"records":{"items":{"$ref":"#/components/schemas/Envelope"},"type":"array","title":"Records"},"next_cursor":{"type":"string","title":"Next Cursor","examples":["eyJ2IjoxMjM1fQ"]},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["dataset","dataset_version","records","next_cursor","has_more"],"title":"ChangesResponse"},"CheckIn":{"properties":{"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose","description":"วัตถุประสงค์ของการตรวจ (บังคับ) เช่น 'พิจารณาให้เครดิต'"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By","description":"ผู้ใช้ที่ขอตรวจ (ใครตรวจสอบใคร — PDPA accountability)"}},"type":"object","title":"CheckIn"},"ConnIn":{"properties":{"target_tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Tenant Id"},"target_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Tax Id"},"permissions":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Permissions"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","title":"ConnIn"},"ConsentIn":{"properties":{"actor":{"type":"string","minLength":1,"title":"Actor","description":"ผู้ให้/ถอนความยินยอม"},"consent_version":{"type":"string","title":"Consent Version","default":"1.0"}},"type":"object","required":["actor"],"title":"ConsentIn"},"ContributionIn":{"properties":{"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$","title":"Period"},"tsic_section":{"type":"string","maxLength":1,"minLength":1,"title":"Tsic Section"},"size_band":{"type":"string","title":"Size Band"},"metrics":{"additionalProperties":{"type":"number"},"type":"object","title":"Metrics"}},"type":"object","required":["period","tsic_section","size_band","metrics"],"title":"ContributionIn"},"DatasetCreate":{"properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)+$","title":"Name"},"title_th":{"type":"string","title":"Title Th"},"title_en":{"type":"string","title":"Title En"},"layer":{"type":"string","pattern":"^(reference|live|rules|network)$","title":"Layer"},"sub_module":{"type":"string","title":"Sub Module"},"scope":{"type":"string","title":"Scope"},"source_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Code"},"cadence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cadence"},"delivery":{"type":"string","title":"Delivery","default":"delta"},"key_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Format"},"payload_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload Schema","description":"JSON Schema used to validate payloads"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","title_th","title_en","layer","sub_module","scope"],"title":"DatasetCreate"},"DatasetInfo":{"properties":{"name":{"type":"string","title":"Name"},"title_th":{"type":"string","title":"Title Th"},"title_en":{"type":"string","title":"Title En"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"layer":{"type":"string","title":"Layer"},"sub_module":{"type":"string","title":"Sub Module"},"scope":{"type":"string","title":"Scope"},"source":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Source"},"cadence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cadence"},"delivery":{"type":"string","title":"Delivery"},"key_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Format"},"status":{"type":"string","title":"Status"},"phase":{"type":"integer","title":"Phase"},"dataset_version":{"type":"integer","title":"Dataset Version"},"record_count":{"type":"integer","title":"Record Count"},"last_published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Published At"},"stale":{"type":"boolean","title":"Stale"},"stale_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stale Since"},"cache_ttl_seconds":{"type":"integer","title":"Cache Ttl Seconds"},"payload_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload Schema"}},"type":"object","required":["name","title_th","title_en","layer","sub_module","scope","delivery","status","phase","dataset_version","record_count","stale","cache_ttl_seconds"],"title":"DatasetInfo"},"DatasetPatch":{"properties":{"cache_ttl_seconds":{"anyOf":[{"type":"integer","maximum":2592000.0,"minimum":0.0},{"type":"null"}],"title":"Cache Ttl Seconds"},"freshness_hours":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Freshness Hours"},"required_approvals":{"anyOf":[{"type":"integer","maximum":3.0,"minimum":0.0},{"type":"null"}],"title":"Required Approvals"},"manual_approvals":{"anyOf":[{"type":"integer","maximum":3.0,"minimum":1.0},{"type":"null"}],"title":"Manual Approvals"},"status":{"anyOf":[{"type":"string","pattern":"^(active|beta|deprecated)$"},{"type":"null"}],"title":"Status"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"DatasetPatch"},"DecideIn":{"properties":{"decision":{"type":"string","pattern":"^(approved|corrected|rejected)$","title":"Decision"},"corrected":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Corrected"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["decision"],"title":"DecideIn"},"Decision":{"properties":{"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","title":"Decision"},"DedupIn":{"properties":{"partners":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":5000,"minItems":2,"title":"Partners","description":"[{id, name, tax_id, branch, address}]"},"threshold":{"type":"number","maximum":1.0,"minimum":0.5,"title":"Threshold","default":0.82}},"type":"object","required":["partners"],"title":"DedupIn"},"DirectoryIn":{"properties":{"display_name":{"type":"string","maxLength":255,"minLength":2,"title":"Display Name"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"branch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch","default":"00000"},"tsic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tsic"},"province_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"line_oa_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line Oa Id"}},"type":"object","required":["display_name"],"title":"DirectoryIn"},"DocIn":{"properties":{"doc_type":{"type":"string","title":"Doc Type","description":"purchase_order | invoice | credit_note | catalog | partner_master"},"ref_no":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref No"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection Id"},"to_tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Tenant Id"},"to_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"To Email","description":"external participant (not on OneBiz) — gets a signed link"},"attachments":{"items":{"$ref":"#/components/schemas/AttachmentIn"},"type":"array","title":"Attachments","default":[]},"in_reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To"}},"type":"object","required":["doc_type","payload"],"title":"DocIn"},"DupIn":{"properties":{"partners":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":5000,"minItems":2,"title":"Partners","description":"[{id, name, tax_id, branch, address}]"},"threshold":{"type":"number","maximum":1.0,"minimum":0.5,"title":"Threshold","default":0.82}},"type":"object","required":["partners"],"title":"DupIn"},"Envelope":{"properties":{"dataset":{"type":"string","title":"Dataset","examples":["fx.bot.daily"]},"key":{"type":"string","title":"Key","examples":["USD:2026-09-25"]},"version":{"type":"integer","title":"Version"},"valid_from":{"type":"string","title":"Valid From"},"valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid To"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"source":{"additionalProperties":true,"type":"object","title":"Source"},"fetched_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fetched At"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published At"},"checksum":{"type":"string","title":"Checksum","examples":["sha256:9a1c…"]},"stale":{"type":"boolean","title":"Stale","default":false},"stale_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stale Since"},"deleted":{"type":"boolean","title":"Deleted","default":false}},"type":"object","required":["dataset","key","version","valid_from","payload","source","checksum"],"title":"Envelope","description":"Common envelope wrapping every published record (spec §5.5)."},"ErrorBody":{"properties":{"code":{"type":"string","title":"Code","examples":["SCOPE_DENIED"]},"message":{"type":"string","title":"Message"},"details":{"anyOf":[{},{"type":"null"}],"title":"Details"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","required":["code","message"],"title":"ErrorBody"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorResponse"},"EvaluateIn":{"properties":{"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of","description":"document date (defaults to today, Asia/Bangkok)"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs","examples":[{"amount":10000,"income_type":"service","payee_type":"company"}]}},"type":"object","title":"EvaluateIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HsIn":{"properties":{"description":{"type":"string","maxLength":2000,"minLength":2,"title":"Description"},"limit":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Limit","default":5}},"type":"object","required":["description"],"title":"HsIn"},"ItemIn":{"properties":{"key":{"type":"string","title":"Key"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"deleted":{"type":"boolean","title":"Deleted","default":false},"source":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Source"}},"type":"object","required":["key","valid_from"],"title":"ItemIn"},"JobPatch":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"max_retries":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Max Retries"},"retry_backoff_seconds":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":5.0},{"type":"null"}],"title":"Retry Backoff Seconds"}},"type":"object","title":"JobPatch"},"KeyIn":{"properties":{"name":{"type":"string","title":"Name","default":"default"},"env":{"type":"string","pattern":"^(live|test)$","title":"Env","default":"live"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","title":"KeyIn"},"KeyIssue":{"properties":{"name":{"type":"string","title":"Name","default":"default"},"env":{"type":"string","pattern":"^(live|test)$","title":"Env","default":"live"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","title":"KeyIssue"},"KeyRevoke":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"KeyRevoke"},"LateIn":{"properties":{"principal":{"type":"number","exclusiveMinimum":0.0,"title":"Principal"},"due_date":{"type":"string","format":"date","title":"Due Date"},"paid_date":{"type":"string","format":"date","title":"Paid Date"},"basis":{"type":"string","enum":["civil_s224","civil_s7"],"title":"Basis","default":"civil_s224"},"rate_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Rate Pct","description":"contractual rate; omit for the statutory rate"},"day_count":{"type":"integer","enum":[365,366,360],"title":"Day Count","default":365}},"type":"object","required":["principal","due_date","paid_date"],"title":"LateIn"},"LoginIn":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginIn"},"MappingIn":{"properties":{"product_ref":{"type":"string","maxLength":160,"minLength":1,"title":"Product Ref"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"hs_code":{"type":"string","title":"Hs Code"},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence"},"origin":{"type":"string","pattern":"^(manual|ai|import)$","title":"Origin","default":"manual"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["product_ref","hs_code"],"title":"MappingIn"},"PlanPatch":{"properties":{"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"quotas":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Quotas"},"rate_limit_per_minute":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Rate Limit Per Minute"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"PlanPatch"},"PolicyIn":{"properties":{"sale":{"anyOf":[{"type":"string","enum":["bot","customs","manual"]},{"type":"null"}],"title":"Sale"},"purchase":{"anyOf":[{"type":"string","enum":["bot","customs","manual"]},{"type":"null"}],"title":"Purchase"},"import":{"anyOf":[{"type":"string","enum":["bot","customs","manual"]},{"type":"null"}],"title":"Import"},"export":{"anyOf":[{"type":"string","enum":["bot","customs","manual"]},{"type":"null"}],"title":"Export"},"revaluation":{"anyOf":[{"type":"string","enum":["bot","customs","manual"]},{"type":"null"}],"title":"Revaluation"}},"type":"object","title":"PolicyIn"},"PreviewIn":{"properties":{"dataset":{"type":"string","title":"Dataset"},"key":{"type":"string","title":"Key"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"}},"type":"object","required":["dataset","key","payload","valid_from"],"title":"PreviewIn"},"PromptPayIn":{"properties":{"id":{"type":"string","maxLength":40,"minLength":1,"title":"Id","description":"เบอร์มือถือ / เลขบัตรประชาชน / Tax ID / e-Wallet"}},"type":"object","required":["id"],"title":"PromptPayIn"},"QaIn":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":3,"title":"Question"},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of"}},"type":"object","required":["question"],"title":"QaIn"},"QrIn":{"properties":{"id":{"type":"string","title":"Id"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount"}},"type":"object","required":["id"],"title":"QrIn"},"RejectIn":{"properties":{"reason":{"type":"string","minLength":3,"title":"Reason"}},"type":"object","required":["reason"],"title":"RejectIn"},"RespondIn":{"properties":{"accept":{"type":"boolean","title":"Accept"},"permissions":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Permissions"},"actor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor"}},"type":"object","required":["accept"],"title":"RespondIn"},"RollbackIn":{"properties":{"to_version":{"type":"integer","minimum":0.0,"title":"To Version"},"reason":{"type":"string","minLength":5,"title":"Reason"}},"type":"object","required":["to_version","reason"],"title":"RollbackIn"},"RunIn":{"properties":{"params":{"additionalProperties":true,"type":"object","title":"Params"}},"type":"object","title":"RunIn"},"SelectIn":{"properties":{"currency":{"type":"string","maxLength":3,"minLength":3,"title":"Currency","examples":["USD"]},"document_date":{"type":"string","format":"date","title":"Document Date","examples":["2026-09-28"]},"direction":{"type":"string","enum":["sale","purchase","import","export","revaluation"],"title":"Direction"},"policy":{"anyOf":[{"type":"string","enum":["bot","customs","manual"]},{"type":"null"}],"title":"Policy","description":"omit to use the tenant's rate policy"}},"type":"object","required":["currency","document_date","direction"],"title":"SelectIn"},"SnapshotInfo":{"properties":{"dataset":{"type":"string","title":"Dataset"},"dataset_version":{"type":"integer","title":"Dataset Version"},"cursor":{"type":"string","title":"Cursor"},"record_count":{"type":"integer","title":"Record Count"},"generated_at":{"type":"string","title":"Generated At"},"formats":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Formats"}},"type":"object","required":["dataset","dataset_version","cursor","record_count","generated_at","formats"],"title":"SnapshotInfo"},"SourceCreate":{"properties":{"name_th":{"type":"string","title":"Name Th"},"name_en":{"type":"string","title":"Name En"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"license_terms":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Terms"},"attribution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attribution"},"commercial_use":{"anyOf":[{"type":"string","pattern":"^(allowed|conditional|prohibited|unknown)$"},{"type":"null"}],"title":"Commercial Use"},"redistribution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redistribution"},"license_expires_at":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"License Expires At"},"review_due_at":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Review Due At"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"code":{"type":"string","pattern":"^[A-Z0-9_]{2,40}$","title":"Code"}},"type":"object","required":["name_th","name_en","code"],"title":"SourceCreate"},"SourcePatch":{"properties":{"name_th":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Th"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"license_terms":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Terms"},"attribution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attribution"},"commercial_use":{"anyOf":[{"type":"string","pattern":"^(allowed|conditional|prohibited|unknown)$"},{"type":"null"}],"title":"Commercial Use"},"redistribution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redistribution"},"license_expires_at":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"License Expires At"},"review_due_at":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Review Due At"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"SourcePatch"},"StatusIn":{"properties":{"status":{"type":"string","title":"Status"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"actor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor"}},"type":"object","required":["status"],"title":"StatusIn"},"TenantIn":{"properties":{"code":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{1,62}$","title":"Code"},"name":{"type":"string","title":"Name"},"plan":{"type":"string","title":"Plan","default":"included"},"kind":{"type":"string","title":"Kind","default":"erp"},"lic_tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lic Tenant Id"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"extra_scopes":{"items":{"type":"string"},"type":"array","title":"Extra Scopes","default":[]}},"type":"object","required":["code","name"],"title":"TenantIn"},"TenantPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"status":{"anyOf":[{"type":"string","pattern":"^(active|suspended)$"},{"type":"null"}],"title":"Status"},"extra_scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Scopes"},"quota_overrides":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Quota Overrides"},"rate_limit_override":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Rate Limit Override"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"}},"type":"object","title":"TenantPatch"},"TenantUpsert":{"properties":{"lic_tenant_id":{"type":"string","maxLength":64,"title":"Lic Tenant Id"},"code":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{1,62}$","title":"Code"},"name":{"type":"string","title":"Name"},"plan":{"type":"string","title":"Plan","default":"included"},"kind":{"type":"string","title":"Kind","default":"erp"},"status":{"type":"string","pattern":"^(active|suspended)$","title":"Status","default":"active"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"extra_scopes":{"items":{"type":"string"},"type":"array","title":"Extra Scopes","default":[]},"quota_overrides":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object","title":"Quota Overrides","default":{}}},"type":"object","required":["lic_tenant_id","code","name"],"title":"TenantUpsert"},"UserIn":{"properties":{"username":{"type":"string","pattern":"^[a-zA-Z0-9._@-]{3,80}$","title":"Username"},"display_name":{"type":"string","title":"Display Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"type":"string","pattern":"^(viewer|data_ops|reviewer|admin)$","title":"Role"},"password":{"type":"string","minLength":10,"title":"Password"}},"type":"object","required":["username","display_name","role","password"],"title":"UserIn"},"UserPatch":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"anyOf":[{"type":"string","pattern":"^(viewer|data_ops|reviewer|admin)$"},{"type":"null"}],"title":"Role"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"password":{"anyOf":[{"type":"string","minLength":10},{"type":"null"}],"title":"Password"}},"type":"object","title":"UserPatch"},"ValidateIn":{"properties":{"province":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province","description":"ชื่อหรือรหัสจังหวัด"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District","description":"ชื่อหรือรหัสอำเภอ/เขต"},"subdistrict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subdistrict","description":"ชื่อหรือรหัสตำบล/แขวง"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"}},"type":"object","title":"ValidateIn"},"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"},"VerifyIn":{"properties":{"envelope":{"additionalProperties":true,"type":"object","title":"Envelope"},"signature":{"type":"string","title":"Signature"}},"type":"object","required":["envelope","signature"],"title":"VerifyIn"},"WebhookIn":{"properties":{"url":{"type":"string","maxLength":1000,"title":"Url"},"secret":{"anyOf":[{"type":"string","maxLength":200,"minLength":16},{"type":"null"}],"title":"Secret"},"datasets":{"items":{"type":"string"},"type":"array","title":"Datasets","description":"glob patterns, e.g. ['calendar.*', 'rule.wht']"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["url"],"title":"WebhookIn"},"WeightsIn":{"properties":{"weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Weights"}},"type":"object","required":["weights"],"title":"WeightsIn"},"hub__admin__data__BatchIn":{"properties":{"dataset":{"type":"string","title":"Dataset"},"items":{"items":{"$ref":"#/components/schemas/ItemIn"},"type":"array","maxItems":20000,"minItems":1,"title":"Items"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"reason":{"type":"string","minLength":3,"title":"Reason","description":"why this change is needed (audit)"},"reference_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Url"},"summary_th":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Th"},"summary_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary En"},"kind":{"type":"string","pattern":"^(manual|override|import)$","title":"Kind","default":"manual"}},"type":"object","required":["dataset","items","reason"],"title":"BatchIn"},"hub__admin__ops__RevokeIn":{"properties":{"reason":{"type":"string","minLength":3,"title":"Reason"}},"type":"object","required":["reason"],"title":"RevokeIn"},"hub__api__v1__address__TextIn":{"properties":{"text":{"type":"string","maxLength":1000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"TextIn"},"hub__api__v1__ai__TextIn":{"properties":{"text":{"type":"string","maxLength":200000,"minLength":1,"title":"Text"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["text"],"title":"TextIn"},"hub__api__v1__hs_radar__BatchIn":{"properties":{"tax_ids":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Tax Ids"},"purpose":{"type":"string","minLength":3,"title":"Purpose"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By"}},"type":"object","required":["tax_ids","purpose"],"title":"BatchIn"},"hub__api__v1__hs_radar__WatchIn":{"properties":{"tax_id":{"type":"string","title":"Tax Id"},"purpose":{"type":"string","minLength":3,"title":"Purpose"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","required":["tax_id","purpose"],"title":"WatchIn"},"hub__api__v1__rates__OverrideIn":{"properties":{"currency":{"type":"string","maxLength":3,"minLength":3,"title":"Currency"},"rate_date":{"type":"string","format":"date","title":"Rate Date"},"rate":{"type":"number","exclusiveMinimum":0.0,"title":"Rate"},"rate_type":{"type":"string","title":"Rate Type","default":"any"},"reason":{"type":"string","minLength":3,"title":"Reason"},"actor":{"type":"string","minLength":1,"title":"Actor","description":"user at the tenant making the override"}},"type":"object","required":["currency","rate_date","rate","reason","actor"],"title":"OverrideIn"},"hub__api__v1__registry__WatchIn":{"properties":{"tax_id":{"type":"string","title":"Tax Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","required":["tax_id"],"title":"WatchIn"},"hub__api__v1__rules__OverrideIn":{"properties":{"rule":{"type":"string","title":"Rule","examples":["wht"]},"key":{"type":"string","title":"Key","examples":["service:company:company"]},"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"fields that replace the Hub values, e.g. {'rate': 0.0}"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"reason":{"type":"string","minLength":5,"title":"Reason","description":"เหตุผล เช่น ได้รับสิทธิ BOI"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"actor":{"type":"string","minLength":1,"title":"Actor","description":"user at the tenant who made the change"}},"type":"object","required":["rule","key","payload","valid_from","reason","actor"],"title":"OverrideIn"},"hub__api__v1__rules__RevokeIn":{"properties":{"reason":{"type":"string","minLength":3,"title":"Reason"},"actor":{"type":"string","title":"Actor"}},"type":"object","required":["reason","actor"],"title":"RevokeIn"}}},"tags":[{"name":"core","description":"HUB-CORE — registry, records, change feed, usage"},{"name":"webhooks","description":"HUB-CORE-013 — push notifications signed with HMAC-SHA256"},{"name":"address","description":"HUB-ADDR — Thai address & geography"},{"name":"registry","description":"HUB-REG — DBD / RD juristic person lookup"},{"name":"rates","description":"HUB-RATE — exchange & interest rates"},{"name":"calendar","description":"HUB-CAL — holidays, working days, deadlines"},{"name":"rules","description":"HUB-RULE — tax & compliance rules-as-data"},{"name":"hs","description":"HUB-HS — customs tariff"},{"name":"bank","description":"HUB-BANK — banks, PromptPay, payment formats"},{"name":"etax","description":"HUB-ETAX — e-Tax Invoice code lists"},{"name":"radar","description":"HUB-RADAR — KYC & partner risk"},{"name":"network","description":"HUB-NET — inter-tenant document exchange"},{"name":"insight","description":"HUB-INSIGHT — anonymised benchmarks"},{"name":"ai","description":"HUB-AI — AI enrichment"},{"name":"lic","description":"OB-LIC provisioning bridge (service-to-service)"}]}