{"components":{"securitySchemes":{"ApiKeyAuth":{"scheme":"bearer","type":"http"}}},"info":{"title":"Rabop Task API","version":"v1"},"openapi":"3.1.0","paths":{"/v1/tasks/check_director_network":{"post":{"description":"Map the ownership and control network around a Thai juristic person: current directors (with their other directorships), current shareholders (persons and companies, with percentages), and related companies reachable through shared directors or corporate shareholders within `depth` hops (1–3, default 1). Costs 20 credits. Requires a KYC-verified or enterprise tier because it returns personal data. Person identities across companies are linked only after entity-resolution review; unreviewed same-name matches are NOT linked (see match_confidence). (price: 20 credits, min tier: kyc_verified)","operationId":"check_director_network","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"anyOf":[{"required":["entity_id"]},{"required":["juristic_id"]}],"properties":{"depth":{"default":1,"description":"Company hops to traverse for related_companies","maximum":3,"minimum":1,"type":"integer"},"entity_id":{"pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"เครือข่ายกรรมการ / ผู้ถือหุ้น"}},"/v1/tasks/check_healthcare_license":{"post":{"description":"Check healthcare regulatory licenses from สบส. (healthcare facilities, practitioners) and อย. (drug and medical-device registrations). Look up by license_no, by the holding company (entity_id / juristic_id), or by holder name. Returns each license with status (active / expired / suspended / revoked — an 'active' license past its expiry date is reported as expired), validity dates and provenance. Costs 3 credits. Practitioner licenses are personal data and require a KYC-verified tier. (price: 3 credits, min tier: free)","operationId":"check_healthcare_license","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"anyOf":[{"required":["license_no"]},{"required":["entity_id"]},{"required":["juristic_id"]},{"required":["holder_name"]}],"properties":{"entity_id":{"pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"holder_name":{"maxLength":200,"minLength":2,"type":"string"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"},"license_no":{"maxLength":60,"type":"string"},"license_type":{"enum":["healthcare_facility","drug","medical_device","practitioner"],"type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ตรวจใบอนุญาตสถานพยาบาล / ทะเบียนยา / เครื่องมือแพทย์ / ผู้ประกอบวิชาชีพ"}},"/v1/tasks/get_company_profile":{"post":{"description":"Get the full registry profile of a Thai juristic person: legal names, status, legal form, registered capital, business objective (TSIC), registered address and director count. Use verify_company first if you only need to know whether the company exists. Costs 2 credits. Director names are returned only for KYC-verified tiers (otherwise masked with a warning). (price: 2 credits, min tier: free)","operationId":"get_company_profile","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"anyOf":[{"required":["entity_id"]},{"required":["juristic_id"]}],"properties":{"entity_id":{"pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ข้อมูลพื้นฐานนิติบุคคล"}},"/v1/tasks/get_financials":{"post":{"description":"Get structured annual financial statements (balance sheet and income statement line items in THB) filed with DBD for a Thai juristic person, newest first. Costs 10 credits. Optionally limit by fiscal years. Every statement carries provenance including extraction method and confidence (api / ocr / llm). (price: 10 credits, min tier: paid)","operationId":"get_financials","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"anyOf":[{"required":["entity_id"]},{"required":["juristic_id"]}],"properties":{"entity_id":{"pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"fiscal_years":{"description":"Gregorian fiscal years to return; default = latest 5","items":{"maximum":2100,"minimum":1990,"type":"integer"},"maxItems":10,"type":"array"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"งบการเงินย้อนหลัง"}},"/v1/tasks/monitor_company":{"post":{"description":"Subscribe to changes of a Thai juristic person. When Rabop detects a change at the source (status, registered capital, address, name, director count, new or restated financial statements) you receive an HMAC-signed webhook (X-Rabop-Signature) and/or can poll GET /v1/events?since=<cursor>. Costs 5 credits to create. event_types accepts '*', 'company.*', 'financials.*' or explicit types: company.created, company.status_changed, company.capital_changed, company.address_changed, company.name_changed, director.count_changed, company.updated, financials.filed, financials.restated. The signing secret is returned exactly once. (price: 5 credits, min tier: free)","operationId":"monitor_company","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"anyOf":[{"required":["entity_id"]},{"required":["juristic_id"]}],"properties":{"entity_id":{"pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"event_types":{"default":["*"],"items":{"pattern":"^(\\*|[a-z_]+\\.(\\*|[a-z_]+))$","type":"string"},"maxItems":20,"minItems":1,"type":"array"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"},"secret":{"description":"Optional HMAC secret; generated if omitted.","maxLength":128,"minLength":16,"type":"string"},"webhook_url":{"description":"HTTPS endpoint to POST notifications to. Omit to use polling only.","format":"uri","type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ตั้ง watch แจ้งเตือนเมื่อข้อมูลบริษัทเปลี่ยน"}},"/v1/tasks/search_entities":{"post":{"description":"Find Thai juristic persons when you only have a name (Thai or English, any spelling/abbreviation such as 'บจก.') or a 13-digit registration number. Returns ranked candidates with entity_id to pass to verify_company / get_company_profile. Costs 1 credit. Use filters (status, province) to narrow. match_type tells you whether the hit was an exact id, exact normalized name, keyword or semantic match. (price: 1 credits, min tier: free)","operationId":"search_entities","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"limit":{"default":10,"maximum":25,"minimum":1,"type":"integer"},"province":{"maxLength":60,"type":"string"},"q":{"description":"Company name (Thai/English) or 13-digit registration number","maxLength":200,"minLength":2,"type":"string"},"status":{"enum":["active","dissolved","liquidating","struck_off","bankrupt"],"type":"string"}},"required":["q"],"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ค้นหานิติบุคคลด้วยชื่อ / เลขทะเบียน"}},"/v1/tasks/search_gov_contracts":{"post":{"description":"Search public-procurement awards (e-GP): who won which government contract, from which agency, for how much. Filter by winning company (entity_id / juristic_id), agency name, announcement date range, minimum value, or free text over title / agency / winner. Costs 5 credits. Winners are linked to an entity_id only when the source published a tax id; otherwise winner_name is returned without a link (no name-based guessing). (price: 5 credits, min tier: paid)","operationId":"search_gov_contracts","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"agency":{"maxLength":200,"type":"string"},"entity_id":{"description":"Winning company","pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"from":{"format":"date","type":"string"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"},"limit":{"default":20,"maximum":100,"minimum":1,"type":"integer"},"min_value":{"minimum":0,"type":"number"},"q":{"description":"Free text over title, agency, winner name, or an exact project id","maxLength":200,"type":"string"},"to":{"format":"date","type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ประวัติคู่สัญญาภาครัฐ (e-GP)"}},"/v1/tasks/verify_company":{"post":{"description":"Verify whether a Thai juristic person (company / partnership) exists and is still active. Use this first for any KYB check before pulling deeper data. Costs 1 credit. Returns legal names, status, legal form, registration date and registered capital, each with provenance (source, data_as_of). (price: 1 credits, min tier: free)","operationId":"verify_company","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"anyOf":[{"required":["entity_id"]},{"required":["juristic_id"]}],"properties":{"entity_id":{"description":"Rabop entity id, e.g. org:th:0105551012343","pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"juristic_id":{"description":"13-digit DBD juristic registration number (alias of entity_id for TH)","pattern":"^[0-9]{13}$","type":"string"}},"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ตรวจสถานะนิติบุคคล"}},"/v1/tasks/verify_company_batch":{"post":{"description":"Verify up to 1,000 Thai juristic persons in one asynchronous job (e.g. a supplier list or loan book). Submitting returns 202 with a task_id; poll /v1/tasks/status/{task_id} or subscribe to task.completed. Costs 1 credit per item, charged on submission (refunded if the job fails). Each item gets the same verify_company result (status, names, legal form, capital, provenance) or a per-item error such as ENTITY_NOT_FOUND. (price: 1 credits, min tier: paid)","operationId":"verify_company_batch","requestBody":{"content":{"application/json":{"schema":{"properties":{"as_of":{"format":"date","type":"string"},"jurisdiction":{"default":"TH","type":"string"},"options":{"type":"object"},"query":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"items":{"items":{"additionalProperties":false,"anyOf":[{"required":["entity_id"]},{"required":["juristic_id"]}],"properties":{"entity_id":{"pattern":"^org:[a-z]{2}:[A-Za-z0-9-]+$","type":"string"},"juristic_id":{"pattern":"^[0-9]{13}$","type":"string"},"ref":{"description":"Your own reference echoed back","maxLength":100,"type":"string"}},"type":"object"},"maxItems":1000,"minItems":1,"type":"array"}},"required":["items"],"type":"object"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Signed task envelope"},"202":{"description":"Accepted (async task)"},"4XX":{"description":"Machine-readable error envelope"}},"security":[{"ApiKeyAuth":[]}],"summary":"ตรวจสถานะนิติบุคคลหลายรายการ (async)"}}},"servers":[{"url":"https://api.rabops.com"}]}
