{
  "openapi": "3.1.0",
  "info": {
    "title": "Erlasso",
    "version": "0.1.0",
    "description": "The state of each Abschnitt of the German Umsatzsteuer-Anwendungserlass on a date: which BMF letter last changed it, from when it applies, the transitional rule, and where BMF's consolidated PDF lags behind."
  },
  "servers": [
    {
      "url": "https://erlasso.bulkhead.solutions"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {}
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/v1/tools/section_state": {
      "post": {
        "operationId": "section_state",
        "summary": "State of a UStAE section on a date",
        "description": "Returns the wording state of one Abschnitt of the Umsatzsteuer-Anwendungserlass (UStAE) on a date: the BMF letter that last changed it (date, GZ, DOK, title, URL), that letter's application rule (appliesFrom), every Nichtbeanstandungsregelung of every letter that changed the Abschnitt (transitional, each with its own words, dates and letter), what the last letter changed in this Abschnitt (each step with operation, Absatz, Satz; for inserts and renumbering newAbsatz and newSatz give the new numbers), the history within coverage, and whether BMF's consolidated PDF already shows it (consolidatedLags, pendingInConsolidated with each pending letter's steps). Call it before quoting or applying a UStAE section, especially one you know from training data, since BMF changes several sections a month. status is changed_after_consolidation, changed_in_consolidation, unchanged_in_coverage (no letter Erlasso holds changed it; earlier letters it does not hold are listed in lettersNotHeld and their effect is unknown), deleted_in_consolidation (BMF's consolidated PDF marks it gestrichen), deleted, or not_yet_created. A locator such as 'Abs. 3 Satz 10' adds stepsOnRequested, the steps on that Absatz. It does not return the section wording of BMF's consolidated PDF (not served, because of the database right in the compilation; the PDF is linked) and gives no tax advice. For several sections at once, call changes_since.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "abschnitt"
                ],
                "additionalProperties": false,
                "properties": {
                  "abschnitt": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 80,
                    "description": "UStAE Abschnitt number as BMF writes it, for example 15.2b, 3.10, 4.12.1 or 3a.9a. 'Abschnitt 15.2b', 'Abschn. 15.2b', 'A 13b.1' and a trailing locator such as 'Abs. 3 Satz 10' are read too. Not a UStG paragraph: § 15 UStG is covered by Abschnitte 15.1 to 15.24, and an error names the range for any paragraph."
                  },
                  "as_of": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "The day to read the state on, YYYY-MM-DD. Defaults to the data version. A letter counts from its own date, the day BMF changed the UStAE wording; when its content applies is appliesFrom."
                  },
                  "wording": {
                    "type": "boolean",
                    "description": "Default false: inserted wording longer than 120 characters is replaced by its length, to keep the answer small. True returns each instruction exactly as the letter words it, new wording included."
                  },
                  "wording_offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Only where the deployment serves consolidated wording: start the wording at this character (from wording.nextOffset). Wording comes in pages of 20000 characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dataVersion",
                    "source",
                    "coverage",
                    "notice"
                  ],
                  "properties": {
                    "dataVersion": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object"
                    },
                    "coverage": {
                      "type": "object"
                    },
                    "notice": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/letter_changes": {
      "post": {
        "operationId": "letter_changes",
        "summary": "One BMF letter's UStAE changes",
        "description": "Returns one BMF letter's own change instructions to the UStAE, numbered as in the letter: per instruction the Abschnitte it touches, any Abschnitt it creates, and each step (a, b, c) with operation (replace, replace_words, insert, append, delete, renumber, amend), Absatz, Satz and the instruction text. Also the letter's predecessor (the letter it names as the last one to change the UStAE), its application rule and Nichtbeanstandungsregelung, and whether BMF's consolidated PDF already includes it. Call it when a user names a letter, or after changes_since to see exactly what changed. Pass a date (all letters of that day) as 2026-10-29, 29.10.2026 or 29. Oktober 2026, a GZ such as III C 5 - S 7300/00078/004/078, a DOK, an id, or a whole citation as letters print it (BMF-Schreiben vom 29. Oktober 2026 – III C 5 - S 7300/00078/004/078). A letter BMF's consolidated PDF lists but Erlasso does not hold (before 9 April 2026) gives the error letter_not_held, naming it; its changes are unknown to Erlasso. Pass abschnitt to keep only the instructions for one section; a warning says when the letter does not change it. Long inserted wording is shortened unless wording is true. It does not interpret the change.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "letter"
                ],
                "additionalProperties": false,
                "properties": {
                  "letter": {
                    "type": "string",
                    "minLength": 6,
                    "maxLength": 120,
                    "description": "Letter date (2026-10-29, 29.10.2026 or 29. Oktober 2026), its GZ, its DOK (COO...), its Erlasso id (from changes_since), or a citation such as 'BMF-Schreiben vom 29. Oktober 2026 – III C 5 - S 7300/00078/004/078'."
                  },
                  "abschnitt": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 80,
                    "description": "Only the instructions touching this Abschnitt."
                  },
                  "wording": {
                    "type": "boolean",
                    "description": "Default false: inserted wording longer than 120 characters is replaced by its length, to keep the answer small. True returns each instruction exactly as the letter words it, new wording included."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dataVersion",
                    "source",
                    "coverage",
                    "notice"
                  ],
                  "properties": {
                    "dataVersion": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object"
                    },
                    "coverage": {
                      "type": "object"
                    },
                    "notice": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/changes_since": {
      "post": {
        "operationId": "changes_since",
        "summary": "UStAE changes since a date",
        "description": "Lists every UStAE Abschnitt changed by a BMF letter dated after since (and on or before until), with the letters that changed it, plus the letters themselves with date, GZ, URL, application rule and whether BMF's consolidated PDF includes them. Call it on a schedule, or when a user asks what changed in the UStAE since a date, to know which mapped rules to re-check. Pass prefix to keep one area, for example 15 for input tax (Abschnitte 15.x), 4.12 for letting, or § 4 Nr. 12 UStG; a prefix no Abschnitt has is an error, never an empty answer. Paginated by section (limit, offset, nextOffset). For one section's detail, call section_state; for a letter's instructions, letter_changes. A since before the first letter Erlasso holds returns a warning and lettersNotHeld, the earlier letters BMF's consolidated PDF lists whose changes are unknown to Erlasso.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "since"
                ],
                "additionalProperties": false,
                "properties": {
                  "since": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Letters dated after this day, YYYY-MM-DD."
                  },
                  "until": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Letters dated on or before this day, YYYY-MM-DD. Defaults to the data version."
                  },
                  "prefix": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 24,
                    "description": "Only Abschnitte under this number, such as 15, 4.12 or 3a. 'Abschnitt 15', '§ 15 UStG' and '§ 4 Nr. 12 UStG' are read too."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "description": "Sections per page, default 50."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Start at this section, from nextOffset."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dataVersion",
                    "source",
                    "coverage",
                    "notice"
                  ],
                  "properties": {
                    "dataVersion": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object"
                    },
                    "coverage": {
                      "type": "object"
                    },
                    "notice": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/consolidation_lag": {
      "post": {
        "operationId": "consolidation_lag",
        "summary": "How far the consolidated UStAE lags",
        "description": "Compares BMF's consolidated UStAE PDF with the letters: its Stand (date), the base version and the letters it says it includes, which of those letters Erlasso holds, the Abschnitte it marks as deleted (gestrichen), every letter it does not yet include, every Abschnitt those letters changed (sectionsAhead), and how many days the newest letter is ahead. Also checks the chain: each letter names the letter that last changed the UStAE before it, and a missing link is reported as a gap. Call it before using the consolidated PDF as the current text, or to explain why a section reads differently from BMF's PDF. It takes no input and does not judge which version applies to a transaction: see appliesFrom and transitional in section_state.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dataVersion",
                    "source",
                    "coverage",
                    "notice"
                  ],
                  "properties": {
                    "dataVersion": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object"
                    },
                    "coverage": {
                      "type": "object"
                    },
                    "notice": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    }
  }
}
