{"openapi":"3.0.3","info":{"title":"Parlamentul Transparent API","version":"1.0.0","description":"Read-only REST API over CDEP (Camera Deputaților) and Senat (Senate) laws, vote sessions, nominal votes, members, and parties. Every non-list endpoint returns `{ success, data, error, meta }`. Almost every endpoint takes a required `chamber` param (`cdep` or `senat`) - there is no single cross-chamber id space, each chamber's data is queried separately (the one exception is `GET /search`, which searches both chambers at once and tags each result with its own `chamber`). Dates are ISO 8601. All endpoints are `GET`-only and unauthenticated (public, read-only data)."},"servers":[{"url":"/api/v1","description":"Relative to whichever host serves this page (dev, prod, pt.zoxo.ro, or the Tor onion address all proxy this same path)."}],"tags":[{"name":"Laws","description":"Per-chamber law records, timelines, PDFs, OCR/LLM document summaries."},{"name":"Correlated laws","description":"The bicameral join between a CDEP law and its Senate counterpart."},{"name":"Votes","description":"Plenary vote sessions and their per-member/per-party breakdowns."},{"name":"Members","description":"Deputies and Senators, their stats, voting history, and rankings."},{"name":"Parties","description":"Parliamentary parties/groups, their unity score and voting history."},{"name":"Search","description":"Cross-entity and law-specific text search."},{"name":"Analytics","description":"Aggregate trends, alignment matrices, and success-rate breakdowns."},{"name":"Reports","description":"Pre-aggregated yearly summary reports."},{"name":"Meta","description":"Health check and this spec."}],"paths":{"/health":{"get":{"tags":["Meta"],"summary":"Health check","description":"Not versioned (`/health`, not `/api/v1/health`). Checks the database connection.","responses":{"200":{"description":"Success. `data`: `{ status: \"healthy\", timestamp }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"503":{"description":"Database unreachable.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/laws":{"get":{"tags":["Laws"],"summary":"List laws for one chamber","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}},{"name":"stage","in":"query","schema":{"type":"string"},"description":"Free-text legislative stage filter, chamber-specific values."},{"name":"urgent","in":"query","schema":{"type":"boolean"}},{"name":"hasSummary","in":"query","schema":{"type":"boolean"},"description":"Restrict to laws with an LLM-generated summary."}],"responses":{"200":{"description":"Success. `data`: array of law list rows","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/laws/{chamber}/{lawId}":{"get":{"tags":["Laws"],"summary":"Get one law, enriched with its correlated counterpart in the other chamber (if any)","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"lawId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: the full law record plus `correlatedLaw` (null if no cross-reference match)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/laws/{chamber}/{lawId}/timeline":{"get":{"tags":["Laws"],"summary":"Legislative timeline events for a law","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"lawId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of timeline events","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/laws/{chamber}/{lawId}/pdfs":{"get":{"tags":["Laws"],"summary":"A law's raw list of associated PDF documents","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"lawId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of PDF records (id, url, ...)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/laws/{chamber}/{lawId}/documents":{"get":{"tags":["Laws"],"summary":"A law's PDFs enriched with per-document OCR/LLM processing status (never the full OCR text)","description":"Senate rows will legitimately have `ocrStatus`/`llmStatus`/`summaryRo` all `null` - Senate PDFs are not run through the OCR pipeline, this is not missing data.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"lawId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of document summaries","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/documents/{chamber}/{pdfId}":{"get":{"tags":["Laws"],"summary":"Full OCR text content of one document","description":"The only endpoint that ever returns the complete OCR text - always for a single document.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"pdfId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: the document with its full OCR text","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/documents/{chamber}/{pdfId}/download":{"get":{"tags":["Laws"],"summary":"Download info for one document","description":"Returns a JSON envelope, not an HTTP redirect - this service has no MinIO credentials and MinIO sits on a private IP. `data.pdfUrl` (the original cdep.ro/senat.ro source link) is the one currently-working download link; `s3Key`/`bucket` are informational only.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"pdfId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: `{ pdfUrl, s3Key, bucket }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/correlated-laws":{"get":{"tags":["Correlated laws"],"summary":"The bicameral join: every law with cross-reference data on either side","parameters":[{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"matchedOnly","in":"query","schema":{"type":"boolean"},"description":"Only rows where both chambers' records were actually matched."},{"name":"status","in":"query","schema":{"type":"string","enum":["ongoing","finalized"]},"description":"Filter by whether the law has finished the legislative process on both sides."}],"responses":{"200":{"description":"Success. `data`: array of correlated-law pairs","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/vote-sessions/{chamber}/{lawId}":{"get":{"tags":["Votes"],"summary":"All vote sessions recorded against one law","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"lawId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of vote sessions","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/votes":{"get":{"tags":["Votes"],"summary":"List vote sessions for one chamber","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date"}},{"name":"hasLaw","in":"query","schema":{"type":"boolean"},"description":"Restrict to sessions tied to a specific law (excludes purely procedural votes)."}],"responses":{"200":{"description":"Success. `data`: array of vote sessions, each including `lawReference`/`lawSummary` when tied to a law","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/votes/{chamber}/{voteId}":{"get":{"tags":["Votes"],"summary":"One vote session, enriched with its law (id/reference/name only, or `null` for a procedural vote)","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"voteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: the vote session + `law`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/votes/{chamber}/{voteId}/nominal":{"get":{"tags":["Votes"],"summary":"Per-member nominal votes for one session","description":"A session has ~250-330 nominal rows; paginated regardless since the underlying tables are actively growing.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"voteId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"party","in":"query","schema":{"type":"integer"},"description":"Filter to one party by its numeric partyId."},{"name":"vote","in":"query","schema":{"type":"string","enum":["for","against","abstain","not_voted"]}}],"responses":{"200":{"description":"Success. `data`: array of `{ memberId, memberName, vote, ... }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/votes/{chamber}/{voteId}/parties":{"get":{"tags":["Votes"],"summary":"Pre-aggregated per-party tallies for one session","description":"Reads the stored per-party breakdown table directly - never computed client-side from the per-member rows.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"voteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of per-party tallies (for/against/abstain/notVoted counts)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/members":{"get":{"tags":["Members"],"summary":"List members of one chamber","description":"Defaults to the current legislature term (2024-2028). Each member id is scoped to one specific term - both chambers reuse/reissue member identifiers per term (see FIXES_LOG.md, 2026-09-24), so a past term's row is a historical snapshot, not \"the same member, out of date\".","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"party","in":"query","schema":{"type":"integer"},"description":"Filter to one party by its numeric partyId."},{"name":"legislature","in":"query","required":false,"description":"One of the values from GET /legislatures (e.g. \"2024\"). Both chambers share the same 4-year election cycle, so this is one shared set of terms. Defaults to the current term.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of members","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/legislatures":{"get":{"tags":["Members"],"summary":"Every legislature term with at least one member, newest first","description":"Use these values for the `legislature` param on `/members`, `/parties`, and `/parties/{chamber}/{partyId}/members`.","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}}],"responses":{"200":{"description":"Success. `data`: array of term strings, e.g. `[\"2024\", \"2020\", \"2016\"]`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/members/rankings":{"get":{"tags":["Members"],"summary":"All-time member rankings by one metric, aggregated across every term a member served","description":"`order=desc` (default) is \"most\" of the metric; `order=asc` is \"least\" - for `metric=attendance`, `order=asc` is the \"most absent members\" list.","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"metric","in":"query","required":true,"schema":{"type":"string","enum":["votesFor","votesAgainst","abstentions","attendance"]}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"Success. `data`: array of ranked members","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/members/{chamber}/{memberId}":{"get":{"tags":["Members"],"summary":"One member, with vote stats, attendance rate, and party-agreement rate","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"},"description":"CDEP: a term-scoped integer id (e.g. `2024059`). Senate: senat.ro's ParlamentarID UUID."}],"responses":{"200":{"description":"Success. `data`: member + `voteStats` + `attendanceRate` + `agreementRateWithParty`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/members/{chamber}/{memberId}/stats":{"get":{"tags":["Members"],"summary":"Vote stats for one member, optionally scoped to one calendar year","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: `{ totalVotes, votesFor, votesAgainst, abstentions, notVoted }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/members/{chamber}/{memberId}/votes":{"get":{"tags":["Members"],"summary":"Paginated voting history for one member, newest first","description":"Each row is flagged with whether the member agreed with their own party's majority vote in that session.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: array of voting-history rows, each with the associated law (or a \"Vot procedural\" label if untagged)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/parties":{"get":{"tags":["Parties"],"summary":"List parties/groups for one chamber","description":"Without `legislature`, every party that has ever held a seat. With it, only parties holding a seat in that specific term - a party that missed the electoral threshold that election has none.","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"legislature","in":"query","required":false,"description":"One of the values from GET /legislatures (e.g. \"2024\"). Both chambers share the same 4-year election cycle, so this is one shared set of terms. Defaults to the current term.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of parties","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/parties/{chamber}/{partyId}":{"get":{"tags":["Parties"],"summary":"One party, with its internal unity score and member/vote stats","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"partyId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success. `data`: party + `unityScore` + `stats`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"404":{"description":"No row matches the given id.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/parties/{chamber}/{partyId}/votes":{"get":{"tags":["Parties"],"summary":"A party's aggregated voting history","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"partyId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: array of voting-history rows","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/parties/{chamber}/{partyId}/members":{"get":{"tags":["Parties"],"summary":"A party's member list, defaulting to the current term","description":"Thin wrapper over `GET /members` scoped to this party.","parameters":[{"name":"chamber","in":"path","required":true,"description":"Which chamber of Parliament.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"partyId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"legislature","in":"query","required":false,"description":"One of the values from GET /legislatures (e.g. \"2024\"). Both chambers share the same 4-year election cycle, so this is one shared set of terms. Defaults to the current term.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. `data`: array of members","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/search":{"get":{"tags":["Search"],"summary":"Unified cross-entity search across both chambers at once","description":"Unlike every other endpoint, `chamber` is deliberately not required or filterable here - each result is tagged with its own `chamber` field instead. Runs separate ILIKE lookups per bucket (laws/members/parties), not a single relevance-ranked list.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":3}},{"name":"type","in":"query","schema":{"type":"string","enum":["laws","members","parties","all"],"default":"all"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Success. `data`: `{ laws: [...], members: [...], parties: [...] }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/search/laws":{"get":{"tags":["Search"],"summary":"Text search over one chamber's laws only, with the same filters as `GET /laws`","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":3}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (1-500, default 50; some endpoints use a smaller default/max - see description).","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"description":"Rows to skip, for pagination.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}},{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"urgent","in":"query","schema":{"type":"boolean"}},{"name":"hasSummary","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success. `data`: array of matching laws","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/voting-trends":{"get":{"tags":["Analytics"],"summary":"Vote counts and approval/rejection/tie rates over time","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"granularity","in":"query","schema":{"type":"string","enum":["month","quarter","year"],"default":"month"}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: array of `{ period, totalVotes, approved, rejected, tied, avgPresence }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/party-alignment":{"get":{"tags":["Analytics"],"summary":"Pairwise party voting-agreement matrix","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: `{ parties: [...], matrix: number[][] }` (agreement rate 0-1 between every party pair)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/law-categories":{"get":{"tags":["Analytics"],"summary":"Law counts broken down by character, initiative type, and outcome status","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: `{ byCharacter, byInitiativeType, byOutcomeStatus }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/urgency-analysis":{"get":{"tags":["Analytics"],"summary":"Success rate of urgent vs. regular laws","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: `{ urgent: {...}, regular: {...} }`, each with total/promulgated/rejectedFinal/pending/successRate","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/initiator-success-rate":{"get":{"tags":["Analytics"],"summary":"Success rate broken down by initiative type (government bill vs. parliamentary proposal)","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}}],"responses":{"200":{"description":"Success. `data`: array of `{ initiativeType, total, promulgated, rejectedFinal, pending, successRate }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/chamber-efficiency":{"get":{"tags":["Analytics"],"summary":"Days-to-promulgation distribution for promulgated laws","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}}],"responses":{"200":{"description":"Success. `data`: `{ promulgatedLawsWithKnownDuration, avgDaysToPromulgation, medianDaysToPromulgation, minDaysToPromulgation, maxDaysToPromulgation }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/analytics/deputy-party-alignment":{"get":{"tags":["Analytics"],"summary":"Members ranked by how often they voted with their own party's majority (\"rebels\" vs. \"loyalists\")","description":"`order=asc` (default) surfaces the least-aligned members first; `order=desc` the most-aligned. Restricted to members with at least `minVotes` recorded votes (default 10).","parameters":[{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},{"name":"year","in":"query","required":false,"description":"Restrict to a single 4-digit calendar year.","schema":{"type":"integer","minimum":1990,"maximum":2100}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":20}},{"name":"minVotes","in":"query","schema":{"type":"integer","minimum":0,"default":10}}],"responses":{"200":{"description":"Success. `data`: array of `{ memberId, memberName, partyCode, totalVotes, agreementRateWithParty }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}},"/reports/yearly-summary/{year}":{"get":{"tags":["Reports"],"summary":"Pre-aggregated yearly summary: totals, top laws, most active members, party performance","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","minimum":1990,"maximum":2100}},{"name":"chamber","in":"query","required":true,"description":"Which chamber of Parliament to query.","schema":{"type":"string","enum":["cdep","senat"]}}],"responses":{"200":{"description":"Success. `data`: `{ year, totalVotes, totalLawsVoted, totalMembers, totalParties, topLaws, mostActiveMembers, partyPerformance }`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"400":{"description":"A required query/path param is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}},"500":{"description":"Unexpected server-side failure.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"description":"Present on success - shape described per-endpoint above."},"error":{"type":"string","nullable":true},"meta":{"type":"object","description":"Pagination totals, echoed filters, or a human-readable note - varies per endpoint."}},"required":["success"]}}}}}}}}}