{
  "openapi": "3.1.0",
  "info": {
    "title": "Stetline",
    "version": "0.1.0",
    "description": "Which standing orders bind a US federal judge on a date, whether they require an AI certification or disclosure, and their filing rules, quoted with the link."
  },
  "servers": [],
  "security": [
    {
      "bearer": []
    },
    {}
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/v1/tools/ai_rules": {
      "post": {
        "operationId": "ai_rules",
        "summary": "AI filing rules for a judge",
        "description": "Says whether a US federal judge's standing orders require anything for AI-assisted filings on a date: certification_required (a separate certification, with who must sign it), signature_certification (signing certifies that you verified), disclosure_required (mark the filing as AI-drafted), verification_duty (verify, no statement), no_ai_filing_rule_found, or check_the_order. Returns the exact clause, what to do, whether prompt records must be kept, the order title, its effective date and the PDF link, plus any order that could not be read. Each AI clause was labelled by a person reading the order. Call it before filing anything drafted with an AI tool, or when an agent adds or omits an AI certification. Do not call it for page limits or other procedure (use filing_rules). It cannot see case-specific orders, local rules or orders the court has not listed, and it is not legal advice: the order governs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "court",
                  "judge"
                ],
                "properties": {
                  "court": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The federal court, for example \"cand\", \"N.D. Cal.\" or \"Northern District of California\". Only N.D. Cal. is covered today; any other court returns court_not_covered, which means no answer, not no rule."
                  },
                  "judge": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The assigned judge as on the docket: full name (\"Eumi K. Lee\"), \"Judge Lee\", the court's listing form (\"Lee, Eumi K.\") or the initials the court uses in order file names (\"EKL\"). District and magistrate judges both count."
                  },
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Filing date, YYYY-MM-DD. Defaults to the data date. Orders that took effect after it are left out; their earlier versions are not held, so such a date can return check_the_order."
                  },
                  "case_type": {
                    "type": "string",
                    "enum": [
                      "civil",
                      "criminal",
                      "patent",
                      "all"
                    ],
                    "description": "Which orders count: civil (default), criminal, patent (civil plus patent orders) or all. Taken from each order's title as the court lists it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/filing_rules": {
      "post": {
        "operationId": "filing_rules",
        "summary": "Filing rules from a judge's standing orders",
        "description": "Returns the clauses of a judge's standing orders in force on a date for filing topics: ai, page_limits, chambers_copies, hearings, formatting, discovery, proposed_orders, sealing, meet_and_confer, summary_judgment, case_management. Each clause is the order's own words with its title, effective date, PDF page and link, judge's own orders first, then the district-wide order. Each topic says found, none_found (no clause in readable orders; the Local Rules still apply) or check_the_order (an order could not be read or the version for that date is not held). Call it when preparing a brief, motion or hearing to learn page limits, chambers copy rules, hearing practice, formatting or discovery letter procedure. Without topics it gives the first clause per topic, cut at 600 characters, as an overview; pass topics (and per_topic) for the full set. Matching is by keywords, so read each clause; it does not compute limits for you. Not legal advice: the order governs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "court",
                  "judge"
                ],
                "properties": {
                  "court": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The federal court, for example \"cand\", \"N.D. Cal.\" or \"Northern District of California\". Only N.D. Cal. is covered today; any other court returns court_not_covered, which means no answer, not no rule."
                  },
                  "judge": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The assigned judge as on the docket: full name (\"Eumi K. Lee\"), \"Judge Lee\", the court's listing form (\"Lee, Eumi K.\") or the initials the court uses in order file names (\"EKL\"). District and magistrate judges both count."
                  },
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Filing date, YYYY-MM-DD. Defaults to the data date. Orders that took effect after it are left out; their earlier versions are not held, so such a date can return check_the_order."
                  },
                  "case_type": {
                    "type": "string",
                    "enum": [
                      "civil",
                      "criminal",
                      "patent",
                      "all"
                    ],
                    "description": "Which orders count: civil (default), criminal, patent (civil plus patent orders) or all. Taken from each order's title as the court lists it."
                  },
                  "topics": {
                    "type": [
                      "array",
                      "string"
                    ],
                    "maxItems": 11,
                    "maxLength": 200,
                    "items": {
                      "type": "string",
                      "enum": [
                        "ai",
                        "page_limits",
                        "chambers_copies",
                        "hearings",
                        "formatting",
                        "discovery",
                        "proposed_orders",
                        "sealing",
                        "meet_and_confer",
                        "summary_judgment",
                        "case_management"
                      ]
                    },
                    "description": "Topics to return, as a list or comma-separated: ai, page_limits, chambers_copies, hearings, formatting, discovery, proposed_orders, sealing, meet_and_confer, summary_judgment, case_management. Defaults to all."
                  },
                  "per_topic": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20,
                    "description": "Clauses per topic, default 1 for all topics or 3 when topics is given; more says how many were left out."
                  },
                  "max_chars": {
                    "type": "integer",
                    "minimum": 200,
                    "maximum": 4000,
                    "description": "Longest clause text returned, default 700 (600 without topics); longer clauses are cut and marked truncated."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/orders_in_force": {
      "post": {
        "operationId": "orders_in_force",
        "summary": "Standing orders in force for a judge",
        "description": "Lists the standing orders that bind a judge's cases on a date: the judge's own orders as the court lists them and the district-wide order, each with title, effective date, kind (standing order, trial, settlement, discovery, form), case types, whether its text could be read, and the link to the PDF. Orders that took effect after the date are listed separately, because their earlier versions are not held. Call it to cite which orders apply, or to hand a person the links. Use ai_rules or filing_rules for what the orders say. It cannot know case-specific orders or orders the court has not posted.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "court",
                  "judge"
                ],
                "properties": {
                  "court": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The federal court, for example \"cand\", \"N.D. Cal.\" or \"Northern District of California\". Only N.D. Cal. is covered today; any other court returns court_not_covered, which means no answer, not no rule."
                  },
                  "judge": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The assigned judge as on the docket: full name (\"Eumi K. Lee\"), \"Judge Lee\", the court's listing form (\"Lee, Eumi K.\") or the initials the court uses in order file names (\"EKL\"). District and magistrate judges both count."
                  },
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Filing date, YYYY-MM-DD. Defaults to the data date. Orders that took effect after it are left out; their earlier versions are not held, so such a date can return check_the_order."
                  },
                  "case_type": {
                    "type": "string",
                    "enum": [
                      "civil",
                      "criminal",
                      "patent",
                      "all"
                    ],
                    "description": "Which orders count: civil (default), criminal, patent (civil plus patent orders) or all. Taken from each order's title as the court lists it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/search_orders": {
      "post": {
        "operationId": "search_orders",
        "summary": "Search the text of standing orders",
        "description": "Finds paragraphs in the standing orders of a court, or of one judge on a date, that contain every word of the query (put a phrase in double quotes). Returns the paragraph text, order title, effective date, PDF page and link, 10 at a time with next_cursor. Call it for any rule the other tools do not tag, such as \"tutorial\", \"pronouns\", \"pro hac vice\" or \"class settlement\". Scanned orders without a text layer cannot be searched and are listed in not_searched. Words are matched as written, so try a synonym when nothing comes back.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "court",
                  "query"
                ],
                "properties": {
                  "court": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The federal court, for example \"cand\", \"N.D. Cal.\" or \"Northern District of California\". Only N.D. Cal. is covered today; any other court returns court_not_covered, which means no answer, not no rule."
                  },
                  "query": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200,
                    "description": "Words that must all appear in the paragraph; \"double quotes\" for an exact phrase. Case does not matter."
                  },
                  "judge": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The assigned judge as on the docket: full name (\"Eumi K. Lee\"), \"Judge Lee\", the court's listing form (\"Lee, Eumi K.\") or the initials the court uses in order file names (\"EKL\"). District and magistrate judges both count. Optional: without it, every order of the court is searched."
                  },
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Filing date, YYYY-MM-DD. Defaults to the data date. Orders that took effect after it are left out; their earlier versions are not held, so such a date can return check_the_order."
                  },
                  "case_type": {
                    "type": "string",
                    "enum": [
                      "civil",
                      "criminal",
                      "patent",
                      "all"
                    ],
                    "description": "Which orders to search: civil, criminal, patent or all (default all)."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "description": "Matches per page, default 10."
                  },
                  "cursor": {
                    "type": "string",
                    "maxLength": 20,
                    "description": "next_cursor from the previous answer."
                  },
                  "max_chars": {
                    "type": "integer",
                    "minimum": 200,
                    "maximum": 4000,
                    "description": "Longest paragraph text returned, default 1200."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/changes_since": {
      "post": {
        "operationId": "changes_since",
        "summary": "Standing order changes since a date",
        "description": "Lists standing orders the court dated, replaced, added or dropped after a date, oldest first, each with title, judges, effective date, link and whether it has an AI clause. Pass since as YYYY-MM-DD, or the next_cursor from your last call to poll. Filter by judge, or ai_only for orders with an AI clause. Page with next_cursor while has_more is true. Call it daily or weekly to know when a judge's rules moved. Effective dates come from the court's table; replacements and removals are detected between our reads, from history_since on.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "court": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The federal court, for example \"cand\", \"N.D. Cal.\" or \"Northern District of California\". Only N.D. Cal. is covered today; any other court returns court_not_covered, which means no answer, not no rule. Defaults to cand."
                  },
                  "since": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "A date YYYY-MM-DD (changes after that day) or the next_cursor from the previous answer. Without it, everything is listed from the oldest order."
                  },
                  "judge": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The assigned judge as on the docket: full name (\"Eumi K. Lee\"), \"Judge Lee\", the court's listing form (\"Lee, Eumi K.\") or the initials the court uses in order file names (\"EKL\"). District and magistrate judges both count. Optional; the district-wide order is always included."
                  },
                  "ai_only": {
                    "type": "boolean",
                    "description": "Only orders with an AI clause."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "description": "Changes per page, default 25."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/coverage": {
      "post": {
        "operationId": "coverage",
        "summary": "Courts and judges covered",
        "description": "Without court: which courts are covered, with data dates, and which are known not to be (N.D. Tex. refuses our crawler). With court: every judge with standing orders listed, their initials, order count, newest order date, how many orders could not be read, and a one-word summary of their AI filing rule. Call it first when you do not know whether a court or judge is covered, or to pick out judges with AI rules. A court missing here means no data, not no rules.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "court": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The federal court, for example \"cand\", \"N.D. Cal.\" or \"Northern District of California\". Only N.D. Cal. is covered today; any other court returns court_not_covered, which means no answer, not no rule. Optional."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    }
  }
}
