{"openapi":"3.1.0","info":{"title":"Mellow Data Bilingual Arabic Official Gazette Alert & CSV API","version":"1.0.0","description":"Structured bilingual (Arabic and English) regulatory alert and CSV API covering Qatar (QA, almeezan.qa) and Egypt (EG, manshurat.org). Serves verified bilingual titles, summaries, sector tags, publication dates, optional sparse effective dates, and canonical official source deep links without mirroring raw government PDFs.","contact":{"name":"Mellow Data","url":"https://mellowdata.net","email":"hello@mellowdata.net"}},"servers":[{"url":"https://gazette.mellowdata.net"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Required API key for decree search, CSV export, and alert rules."},"BearerAuth":{"type":"http","scheme":"bearer","description":"Required API key sent as Authorization: Bearer <key>."},"MarketplaceSecretAuth":{"type":"apiKey","in":"header","name":"X-Marketplace-Secret","description":"Marketplace gateway authentication secret header."}}},"paths":{"/v1/health":{"get":{"operationId":"getGazetteHealth","summary":"Service health, Qatar and Egypt counts, sector totals, and latest publication dates","responses":{"200":{"description":"Dataset counts, source coverage, and freshness metadata."}}}},"/v1/decrees":{"get":{"operationId":"searchArabicDecrees","summary":"Search and filter bilingual Qatar and Egypt official gazette decrees","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Arabic or English full-text query."},{"name":"jurisdiction","in":"query","schema":{"type":"string"},"description":"Comma-separated codes: QA,EG."},{"name":"sector","in":"query","schema":{"type":"string"},"description":"Comma-separated sectors: finance,labor,tax,real_estate,tech,customs,corporate,general."},{"name":"source","in":"query","schema":{"type":"string","enum":["almeezan_qa","manshurat_org"]}},{"name":"instrument_type","in":"query","schema":{"type":"string"}},{"name":"year","in":"query","schema":{"type":"integer"}},{"name":"from_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"to_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"effective_after","in":"query","schema":{"type":"string","format":"date"},"description":"Minimum effective_date (YYYY-MM-DD). Note: effective_date is sparse and only populated when stated separately from publish_date."},{"name":"sort","in":"query","schema":{"type":"string","enum":["publish_desc","publish_asc","effective_desc","year_desc"],"default":"publish_desc"}},{"name":"limit","in":"query","schema":{"type":"integer","default":25}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Paginated bilingual decree metadata with official deep links."}}}},"/v1/decrees/{decree_id}":{"get":{"operationId":"getDecreeDetail","summary":"Retrieve full bilingual metadata for a single Qatar or Egypt decree","parameters":[{"name":"decree_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Decree metadata, compliance summaries, and official primary link."},"404":{"description":"Decree not found."}}}},"/v1/decrees/export.csv":{"get":{"operationId":"exportDecreesCsv","summary":"Download filtered bilingual official gazette decrees as UTF-8 BOM CSV","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"jurisdiction","in":"query","schema":{"type":"string"},"description":"Comma-separated codes: QA,EG."},{"name":"sector","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string","enum":["almeezan_qa","manshurat_org"]}},{"name":"year","in":"query","schema":{"type":"integer"}},{"name":"from_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"to_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","schema":{"type":"integer","default":100}}],"responses":{"200":{"description":"UTF-8 BOM RFC 4180 CSV file with bilingual columns and official source links.","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/v1/alerts":{"get":{"operationId":"listAlertRules","summary":"List saved regulatory alert rules for the authenticated caller or X-Alert-Token namespace","parameters":[{"name":"X-Alert-Token","in":"header","required":false,"schema":{"type":"string"},"description":"Optional caller-supplied token to isolate saved alert rules into a private namespace on shared marketplace plans."}],"responses":{"200":{"description":"List of active alert rules."}}},"post":{"operationId":"createAlertRule","summary":"Create a saved bilingual regulatory alert rule for Qatar or Egypt","parameters":[{"name":"X-Alert-Token","in":"header","required":false,"schema":{"type":"string"},"description":"Optional caller-supplied token to isolate saved alert rules into a private namespace on shared marketplace plans."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rule_name"],"properties":{"rule_name":{"type":"string"},"jurisdictions":{"type":"array","items":{"type":"string","enum":["QA","EG"]}},"sectors":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"delivery_channel":{"type":"string","enum":["webhook","email","poll"]},"delivery_target":{"type":"string"}}}}}},"responses":{"201":{"description":"Alert rule created."},"400":{"description":"Missing rule_name or filter criteria."},"401":{"description":"Authentication required."}}}},"/v1/alerts/{rule_id}":{"delete":{"operationId":"deleteAlertRule","summary":"Delete a saved regulatory alert rule","parameters":[{"name":"X-Alert-Token","in":"header","required":false,"schema":{"type":"string"},"description":"Optional caller-supplied token to isolate saved alert rules into a private namespace on shared marketplace plans."},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Alert rule deleted."},"404":{"description":"Alert rule not found."}}}},"/v1/alerts/{rule_id}/matches":{"get":{"operationId":"getAlertRuleMatches","summary":"Evaluate a saved alert rule against currently indexed Qatar and Egypt decrees","parameters":[{"name":"X-Alert-Token","in":"header","required":false,"schema":{"type":"string"},"description":"Optional caller-supplied token to isolate saved alert rules into a private namespace on shared marketplace plans."},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":25}}],"responses":{"200":{"description":"Matching decrees for the saved alert rule."},"404":{"description":"Alert rule not found."}}}}}}