{"openapi":"3.1.0","info":{"title":"Midpage (BYOK) API","version":"0.1.0","description":"Midpage (BYOK) lets an AI assistant read your own Midpage data through the Midpage API with a key you supply (Midpage API key). Read-only: 12 tools (search_opinions, search_opinions_in_court, search_opinions_in_state, search_opinions_since, get_opinion, get_opinions_by_citation, list_courts, search_laws, search_laws_in_state, get_law_by_citation, get_law_by_id, list_law_collections). The BYOK key...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-midpage.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-midpage/docs"},"termsOfService":"https://connectorbay.com/byok-midpage/terms"},"servers":[{"url":"https://byok-midpage.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-midpage/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/search_opinions":{"post":{"operationId":"search_opinions","summary":"Search US court opinions by meaning or keywords and return ranked matches with case name, court, date, docket number and","description":"Search US court opinions by meaning or keywords and return ranked matches with case name, court, date, docket number and a text snippet. Use for \"Find court opinions about the summary judgment standard\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"description":"Search text. In keyword mode, uppercase AND, OR, NOT, quoted phrases and W/n proximity are supported.","maxLength":500,"title":"Query","type":"string"},"mode":{"anyOf":[{"enum":["semantic","keyword","hybrid"],"type":"string"},{"type":"null"}],"default":"semantic","description":"Search mode: semantic (meaning, default), keyword (exact terms, Lexis-style operators) or hybrid (both).","title":"Mode"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Results per page (1 to 100).","title":"Page Size"},"page":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"},"publish_status":{"anyOf":[{"enum":["published","unpublished","unknown","in_chambers","separate","errata","relating_to"],"type":"string"},{"type":"null"}],"default":null,"description":"Only opinions with this publication status.","title":"Publish Status"}},"required":["query"],"title":"search_opinionsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_opinions_in_court":{"post":{"operationId":"search_opinions_in_court","summary":"Search US court opinions inside one court, given its court id (for example scotus or ca9; see list_courts). Use for \"Wha","description":"Search US court opinions inside one court, given its court id (for example scotus or ca9; see list_courts). Use for \"What has the Ninth Circuit said about fourth amendment search and seizure\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"description":"Search text. In keyword mode, uppercase AND, OR, NOT, quoted phrases and W/n proximity are supported.","maxLength":500,"title":"Query","type":"string"},"court_id":{"description":"Court id such as 'scotus', 'ca9' or 'nysd'; list_courts shows all ids.","maxLength":40,"title":"Court Id","type":"string"},"mode":{"anyOf":[{"enum":["semantic","keyword","hybrid"],"type":"string"},{"type":"null"}],"default":"semantic","description":"Search mode: semantic (meaning, default), keyword (exact terms, Lexis-style operators) or hybrid (both).","title":"Mode"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Results per page (1 to 100).","title":"Page Size"},"page":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["query","court_id"],"title":"search_opinions_in_courtArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_opinions_in_state":{"post":{"operationId":"search_opinions_in_state","summary":"Search US court opinions from the courts of one state, by the state's full name. Use for \"Find California opinions on br","description":"Search US court opinions from the courts of one state, by the state's full name. Use for \"Find California opinions on breach of fiduciary duty\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"description":"Search text. In keyword mode, uppercase AND, OR, NOT, quoted phrases and W/n proximity are supported.","maxLength":500,"title":"Query","type":"string"},"state":{"description":"Full state name, for example 'California'.","maxLength":40,"title":"State","type":"string"},"mode":{"anyOf":[{"enum":["semantic","keyword","hybrid"],"type":"string"},{"type":"null"}],"default":"semantic","description":"Search mode: semantic (meaning, default), keyword (exact terms, Lexis-style operators) or hybrid (both).","title":"Mode"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Results per page (1 to 100).","title":"Page Size"},"page":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["query","state"],"title":"search_opinions_in_stateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_opinions_since":{"post":{"operationId":"search_opinions_since","summary":"Search US court opinions filed on or after a date, optionally up to an end date. Use for \"Which opinions filed since Jan","description":"Search US court opinions filed on or after a date, optionally up to an end date. Use for \"Which opinions filed since January 2024 discuss copyright infringement\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"description":"Search text. In keyword mode, uppercase AND, OR, NOT, quoted phrases and W/n proximity are supported.","maxLength":500,"title":"Query","type":"string"},"filed_from":{"description":"Earliest filing date, YYYY-MM-DD.","maxLength":10,"title":"Filed From","type":"string"},"filed_to":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Latest filing date, YYYY-MM-DD; leave out for no upper bound.","title":"Filed To"},"mode":{"anyOf":[{"enum":["semantic","keyword","hybrid"],"type":"string"},{"type":"null"}],"default":"semantic","description":"Search mode: semantic (meaning, default), keyword (exact terms, Lexis-style operators) or hybrid (both).","title":"Mode"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Results per page (1 to 100).","title":"Page Size"},"page":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["query","filed_from"],"title":"search_opinions_sinceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_opinion":{"post":{"operationId":"get_opinion","summary":"Get one court opinion by its Midpage opinion id, with citations, citation count and overall citator treatment; the full ","description":"Get one court opinion by its Midpage opinion id, with citations, citation count and overall citator treatment; the full text only when include_content is true. Use for \"Show opinion 8623588 with its citations\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"opinion_id":{"description":"Opinion id as returned by the search tools, for example '8623588'.","maxLength":40,"title":"Opinion Id","type":"string"},"include_content":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to include the full opinion text as HTML (can be very long).","title":"Include Content"}},"required":["opinion_id"],"title":"get_opinionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_opinions_by_citation":{"post":{"operationId":"get_opinions_by_citation","summary":"Look up court opinions by a reporter citation such as '556 U.S. 662'; a citation can match several opinions (majority, d","description":"Look up court opinions by a reporter citation such as '556 U.S. 662'; a citation can match several opinions (majority, dissent). Use for \"Which opinion is cited as 556 U.S. 662\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"citation":{"description":"Reporter citation, for example '556 U.S. 662'.","maxLength":100,"title":"Citation","type":"string"},"include_content":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to include the full opinion text as HTML (can be very long).","title":"Include Content"}},"required":["citation"],"title":"get_opinions_by_citationArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_courts":{"post":{"operationId":"list_courts","summary":"List every court available in Midpage with its id, name, abbreviation, jurisdiction type, state and whether it is still ","description":"List every court available in Midpage with its id, name, abbreviation, jurisdiction type, state and whether it is still in use. Use for \"Which courts does Midpage cover and what are their ids\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_courtsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_laws":{"post":{"operationId":"search_laws","summary":"Search US statutes, regulations, constitutions and agency guidance (federal, all states and DC); by default only the law","description":"Search US statutes, regulations, constitutions and agency guidance (federal, all states and DC); by default only the law in force today. Use for \"What does the law say about informed consent for medical treatment\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"description":"Search text. In keyword mode, uppercase AND, OR, NOT, quoted phrases and W/n proximity are supported.","maxLength":500,"title":"Query","type":"string"},"current_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"description":"True (default) for law in force today only; false also searches historical versions, which needs a key with historical access.","title":"Current Only"},"page_size":{"anyOf":[{"maximum":50,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Results per page (1 to 50).","title":"Page Size"},"page":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["query"],"title":"search_lawsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_laws_in_state":{"post":{"operationId":"search_laws_in_state","summary":"Search statutes, regulations and guidance of one jurisdiction: a state name, its USPS abbreviation, or 'Federal'. Use fo","description":"Search statutes, regulations and guidance of one jurisdiction: a state name, its USPS abbreviation, or 'Federal'. Use for \"Search Texas law for landlord duties on security deposits\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"description":"Search text. In keyword mode, uppercase AND, OR, NOT, quoted phrases and W/n proximity are supported.","maxLength":500,"title":"Query","type":"string"},"state":{"description":"State name or USPS abbreviation, or 'Federal' for federal law.","maxLength":40,"title":"State","type":"string"},"current_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"description":"True (default) for law in force today only.","title":"Current Only"},"page_size":{"anyOf":[{"maximum":50,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Results per page (1 to 50).","title":"Page Size"},"page":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["query","state"],"title":"search_laws_in_stateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_law_by_citation":{"post":{"operationId":"get_law_by_citation","summary":"Get one law document (a statute section, regulation, constitutional provision or container) by its citation, with the of","description":"Get one law document (a statute section, regulation, constitutional provision or container) by its citation, with the official text, dates and source link. Use for \"Show 42 U.S.C. section 1983\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"citation":{"description":"Canonical citation such as '42 U.S.C. § 1983' or 'Cal. Code Regs. tit. 22, § 51451'.","maxLength":200,"title":"Citation","type":"string"},"collection":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Collection id or name to disambiguate; see list_law_collections.","title":"Collection"}},"required":["citation"],"title":"get_law_by_citationArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_law_by_id":{"post":{"operationId":"get_law_by_id","summary":"Get one law document by the id returned from a law search or a previous lookup. Use for \"Open the law document with this","description":"Get one law document by the id returned from a law search or a previous lookup. Use for \"Open the law document with this id from my last search\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Law document id (UUID) from search_laws or get_law results.","maxLength":60,"title":"Id","type":"string"}},"required":["id"],"title":"get_law_by_idArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_law_collections":{"post":{"operationId":"list_law_collections","summary":"List the collections of laws available (codes, registers, constitutions) with type, state, country and publishing author","description":"List the collections of laws available (codes, registers, constitutions) with type, state, country and publishing authority. Use for \"Which law collections can I search in Midpage\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_law_collectionsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}