{"openapi":"3.1.0","info":{"title":"Legalize API","description":"Open legislation API. Every law as structured data, every reform as a diff.","version":"0.11.0"},"paths":{"/api/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Health check for monitoring. No authentication required.","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/countries":{"get":{"tags":["api"],"summary":"Api Countries","description":"List all available countries with law counts.","operationId":"api_countries_api_v1_countries_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CountryInfo"},"type":"array","title":"Response Api Countries Api V1 Countries Get"}},"application/xml":{"schema":{"items":{"$ref":"#/components/schemas/CountryInfo"},"type":"array","title":"Response Api Countries Api V1 Countries Get"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}},"security":[{"ApiKeyAuth":[]}]}},"/api/v1/{country}/jurisdictions":{"get":{"tags":["api"],"summary":"Api Jurisdictions","description":"List jurisdictions (regions/states) within a country.","operationId":"api_jurisdictions_api_v1__country__jurisdictions_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JurisdictionInfo"},"title":"Response Api Jurisdictions Api V1  Country  Jurisdictions Get"}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JurisdictionInfo"},"title":"Response Api Jurisdictions Api V1  Country  Jurisdictions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/laws":{"get":{"tags":["api"],"summary":"Api List Laws","description":"Search and list laws for a country.\n\nWithout `q`: returns a paginated list of all laws, sorted by date (newest first).\nWith `q`: full-text search with relevance ranking.\n\nAll filters (law_type, year, status, jurisdiction, from_date, to_date) apply\nin both listing and search modes. Use `sort` to change order.","operationId":"api_list_laws_api_v1__country__laws_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Per Page"}},{"name":"law_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by law type. Comma-separated for multiple: ley,constitucion","title":"Law Type"},"description":"Filter by law type. Comma-separated for multiple: ley,constitucion"},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by publication year (4 digits)","title":"Year"},"description":"Filter by publication year (4 digits)"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: vigente, derogada","title":"Status"},"description":"Filter by status: vigente, derogada"},{"name":"jurisdiction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by jurisdiction code","title":"Jurisdiction"},"description":"Filter by jurisdiction code"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Full-text search query","title":"Q"},"description":"Full-text search query"},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sort order: date_desc (default), date_asc, title","title":"Sort"},"description":"Sort order: date_desc (default), date_asc, title"},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter from date (YYYY-MM-DD inclusive)","title":"From Date"},"description":"Filter from date (YYYY-MM-DD inclusive)"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to date (YYYY-MM-DD inclusive)","title":"To Date"},"description":"Filter to date (YYYY-MM-DD inclusive)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedLaws"}},"application/xml":{"schema":{"$ref":"#/components/schemas/PaginatedLaws"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/laws/{law_id}/meta":{"get":{"tags":["api"],"summary":"Api Get Law Meta","description":"Get law metadata only. Fast — no content fetching from GitHub.\n\nFree tier: basic fields (id, title, status, dates, country, law_type).\nPro tier: adds department, source, last_updated, extra (country-specific metadata).","operationId":"api_get_law_meta_api_v1__country__laws__law_id__meta_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"law_id","in":"path","required":true,"schema":{"type":"string","title":"Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LawMeta"}},"application/xml":{"schema":{"$ref":"#/components/schemas/LawMeta"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/laws/{law_id}":{"get":{"tags":["api"],"summary":"Api Get Law","description":"Get a complete law with full Markdown content.\n\nFetches content from GitHub. Slower than /meta for metadata-only use cases.\nFree tier: basic fields + content_md.\nPro tier: adds department, source, last_updated, extra (country-specific metadata).","operationId":"api_get_law_api_v1__country__laws__law_id__get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"law_id","in":"path","required":true,"schema":{"type":"string","title":"Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LawDetail"}},"application/xml":{"schema":{"$ref":"#/components/schemas/LawDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/laws/{law_id}/reforms":{"get":{"tags":["api"],"summary":"Api Get Reforms","description":"Get the reform history of a law. Each reform is a legislative change.","operationId":"api_get_reforms_api_v1__country__laws__law_id__reforms_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"law_id","in":"path","required":true,"schema":{"type":"string","title":"Law Id"}},{"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":{"$ref":"#/components/schemas/ReformsResponse"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ReformsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/laws/{law_id}/commits":{"get":{"tags":["api"],"summary":"Api Get Commits","description":"Get the git commit history of a law. Each commit represents a version change.","operationId":"api_get_commits_api_v1__country__laws__law_id__commits_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"law_id","in":"path","required":true,"schema":{"type":"string","title":"Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitsResponse"}},"application/xml":{"schema":{"$ref":"#/components/schemas/CommitsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/laws/{law_id}/at/{sha}":{"get":{"tags":["api"],"summary":"Api Law At Commit","description":"Time-travel: get the full text of a law at a specific historical version.","operationId":"api_law_at_commit_api_v1__country__laws__law_id__at__sha__get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"law_id","in":"path","required":true,"schema":{"type":"string","title":"Law Id"}},{"name":"sha","in":"path","required":true,"schema":{"type":"string","title":"Sha"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LawAtCommitResponse"}},"application/xml":{"schema":{"$ref":"#/components/schemas/LawAtCommitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/law-types":{"get":{"tags":["api"],"summary":"Api Law Types","description":"List law types available in a country (e.g. constitucion, ley, real_decreto).","operationId":"api_law_types_api_v1__country__law_types_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Response Api Law Types Api V1  Country  Law Types Get"}},"application/xml":{"schema":{"type":"array","items":{"type":"string"},"title":"Response Api Law Types Api V1  Country  Law Types Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/{country}/stats":{"get":{"tags":["api"],"summary":"Api Stats","description":"Get aggregate statistics: reform activity by year, most reformed laws, and law types.","operationId":"api_stats_api_v1__country__stats_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"jurisdiction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}},"application/xml":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List Endpoints","description":"List all webhook endpoints for the authenticated user.","operationId":"list_endpoints_api_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["webhooks"],"summary":"Create Endpoint","description":"Create a webhook endpoint. Returns the signing secret ONCE.","operationId":"create_endpoint_api_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}},"security":[{"ApiKeyAuth":[]}]}},"/api/v1/webhooks/{endpoint_id}":{"get":{"tags":["webhooks"],"summary":"Get Endpoint","description":"Get details for a specific webhook endpoint.","operationId":"get_endpoint_api_v1_webhooks__endpoint_id__get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}},"patch":{"tags":["webhooks"],"summary":"Update Endpoint","description":"Update a webhook endpoint.","operationId":"update_endpoint_api_v1_webhooks__endpoint_id__patch","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}},"delete":{"tags":["webhooks"],"summary":"Delete Endpoint","description":"Delete a webhook endpoint.","operationId":"delete_endpoint_api_v1_webhooks__endpoint_id__delete","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/webhooks/{endpoint_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Deliveries","description":"List delivery attempts for an endpoint. Filter by status: failed, success, pending.","operationId":"list_deliveries_api_v1_webhooks__endpoint_id__deliveries_get","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/webhooks/{endpoint_id}/deliveries/{delivery_id}/retry":{"post":{"tags":["webhooks"],"summary":"Retry Failed Delivery","description":"Retry a failed webhook delivery. Re-sends the original event payload.","operationId":"retry_failed_delivery_api_v1_webhooks__endpoint_id__deliveries__delivery_id__retry_post","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"integer","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}},"/api/v1/webhooks/{endpoint_id}/test":{"post":{"tags":["webhooks"],"summary":"Send Test Event","description":"Send a test.ping event to verify the endpoint is working.","operationId":"send_test_event_api_v1_webhooks__endpoint_id__test_post","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/xml":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}},"application/xml":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing, malformed, or invalid API key"},"429":{"description":"Monthly quota exceeded. Includes Retry-After header."}}}}},"components":{"schemas":{"Commit":{"properties":{"sha":{"type":"string","title":"Sha"},"date":{"type":"string","title":"Date"},"message":{"type":"string","title":"Message"}},"type":"object","required":["sha","date","message"],"title":"Commit"},"CommitsResponse":{"properties":{"law_id":{"type":"string","title":"Law Id"},"commits":{"items":{"$ref":"#/components/schemas/Commit"},"type":"array","title":"Commits"}},"type":"object","required":["law_id","commits"],"title":"CommitsResponse"},"CountryInfo":{"properties":{"country":{"type":"string","title":"Country"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["country","count"],"title":"CountryInfo"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JurisdictionInfo":{"properties":{"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"JurisdictionInfo"},"LawAtCommitResponse":{"properties":{"law_id":{"type":"string","title":"Law Id"},"sha":{"type":"string","title":"Sha"},"content_md":{"type":"string","title":"Content Md"}},"type":"object","required":["law_id","sha","content_md"],"title":"LawAtCommitResponse"},"LawDetail":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"short_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Title"},"country":{"type":"string","title":"Country"},"law_type":{"type":"string","title":"Law Type"},"publication_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"article_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Article Count"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"last_updated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Updated"},"extra":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra"},"frontmatter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Frontmatter"},"content_md":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Md"}},"type":"object","required":["id","title","country","law_type"],"title":"LawDetail","description":"Full law with Markdown content (fetched from GitHub)."},"LawMeta":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"short_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Title"},"country":{"type":"string","title":"Country"},"law_type":{"type":"string","title":"Law Type"},"publication_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"article_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Article Count"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"last_updated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Updated"},"extra":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra"}},"type":"object","required":["id","title","country","law_type"],"title":"LawMeta","description":"Law metadata without content. Lightweight — no GitHub fetch."},"LawSearchResult":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"short_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Title"},"country":{"type":"string","title":"Country"},"law_type":{"type":"string","title":"Law Type"},"publication_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"article_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Article Count"},"title_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title Snippet"}},"type":"object","required":["id","title","country","law_type"],"title":"LawSearchResult","description":"Law result with search snippet."},"PaginatedLaws":{"properties":{"country":{"type":"string","title":"Country"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"sort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"},"from_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Date"},"to_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Date"},"results":{"items":{"$ref":"#/components/schemas/LawSearchResult"},"type":"array","title":"Results"}},"type":"object","required":["country","total","page","per_page","results"],"title":"PaginatedLaws","description":"Unified response for law listing and search.\n\nWhen searching (query is not None), both ``total`` and ``count``\nare populated with the same value for backward compatibility.\nWhen listing, ``query`` and ``count`` are None."},"Reform":{"properties":{"date":{"type":"string","title":"Date"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"articles_affected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Articles Affected"}},"type":"object","required":["date"],"title":"Reform"},"ReformsResponse":{"properties":{"law_id":{"type":"string","title":"Law Id"},"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"},"reforms":{"items":{"$ref":"#/components/schemas/Reform"},"type":"array","title":"Reforms"}},"type":"object","required":["law_id","total","offset","limit","reforms"],"title":"ReformsResponse"},"StatsResponse":{"properties":{"country":{"type":"string","title":"Country"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"reform_activity_by_year":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Reform Activity By Year"},"most_reformed_laws":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Most Reformed Laws"},"law_types":{"items":{"type":"string"},"type":"array","title":"Law Types"}},"type":"object","required":["country","reform_activity_by_year","most_reformed_laws","law_types"],"title":"StatsResponse"},"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"},"WebhookEndpointCreate":{"properties":{"url":{"type":"string","title":"Url"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types"},"countries":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Countries"},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["url","event_types"],"title":"WebhookEndpointCreate"},"WebhookEndpointUpdate":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"event_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Event Types"},"countries":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Countries"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"WebhookEndpointUpdate"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Bearer token. Get one for free at https://legalize.dev/api — no credit card, 5,000 calls/month forever for early signups. Format: `Bearer leg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`"}}}}