{
  "openapi": "3.1.0",
  "info": {
    "title": "Drive Analytics API",
    "version": "1.0.0",
    "description": "REST-API für die eigenen Fahrzeugdaten: Fahrzeuge, Fahrten, Fahrtenbuch, Tankrechnungen, Kosten, Wartung, Zonen und Webhooks. Den API-Key legst du in den Einstellungen der App an. Jede Anfrage sieht nur die Daten des Schlüssel-Inhabers. Erfolg: {\"data\": …, \"meta\": …}, Fehler: {\"error\": {\"code\", \"message\"}}.",
    "contact": {
      "url": "https://driveanalytics.uk/developers"
    }
  },
  "externalDocs": {
    "description": "Entwickler-Dokumentation",
    "url": "https://driveanalytics.uk/developers"
  },
  "servers": [
    {
      "url": "https://driveanalytics.uk"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Konto"
    },
    {
      "name": "Fahrzeuge"
    },
    {
      "name": "Fahrten"
    },
    {
      "name": "Tankrechnungen"
    },
    {
      "name": "Wartung"
    },
    {
      "name": "Kosten"
    },
    {
      "name": "Suche"
    },
    {
      "name": "Flotte"
    },
    {
      "name": "Zonen"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Mitteilungen"
    },
    {
      "name": "Fahrtenbuch"
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "tags": [
          "Konto"
        ],
        "summary": "Discovery-Index der Sammlungen.",
        "operationId": "get_index",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Konto"
        ],
        "summary": "Eigenes Konto-Profil.",
        "operationId": "get_me",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Account"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars": {
      "get": {
        "tags": [
          "Fahrzeuge"
        ],
        "summary": "Alle zugänglichen Fahrzeuge (eigene und geteilte).",
        "operationId": "get_cars",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Car"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}": {
      "get": {
        "tags": [
          "Fahrzeuge"
        ],
        "summary": "Ein Fahrzeug mit Live-Position.",
        "operationId": "get_cars_car_id",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Car"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/battery": {
      "get": {
        "tags": [
          "Fahrzeuge"
        ],
        "summary": "Batterie-Gesundheit.",
        "operationId": "get_cars_car_id_battery",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Battery"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/trips": {
      "get": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Fahrten eines Fahrzeugs.",
        "operationId": "get_cars_car_id_trips",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl, Standard 50, höchstens 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Versatz für das Blättern."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Ab Datum (JJJJ-MM-TT)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Bis Datum (JJJJ-MM-TT)."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Textsuche im Fahrt-Zweck."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TripSummary"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/fuel-receipts": {
      "get": {
        "tags": [
          "Tankrechnungen"
        ],
        "summary": "Tankrechnungen eines Fahrzeugs.",
        "operationId": "get_cars_car_id_fuel_receipts",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl, Standard 50, höchstens 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Versatz für das Blättern."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FuelReceipt"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/fuel-stats": {
      "get": {
        "tags": [
          "Tankrechnungen"
        ],
        "summary": "Tank-Kennzahlen (Durchschnitt je Monat, laufendes Jahr, Preis je Liter).",
        "operationId": "get_cars_car_id_fuel_stats",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/maintenance": {
      "get": {
        "tags": [
          "Wartung"
        ],
        "summary": "Wartungspositionen mit Fälligkeit.",
        "operationId": "get_cars_car_id_maintenance",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MaintenanceItem"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/maintenance/{item_id}/done": {
      "post": {
        "tags": [
          "Wartung"
        ],
        "summary": "Wartung quittieren. Besitzer oder Flotten-Verwalter; mit `cost` entsteht eine Kostenposition.",
        "operationId": "post_cars_car_id_maintenance_item_id_done",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "mileage": {
                    "type": "integer"
                  },
                  "cost": {
                    "type": "string",
                    "description": "Betrag, z. B. \"189,90\"."
                  },
                  "currency": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceItem"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/costs": {
      "get": {
        "tags": [
          "Kosten"
        ],
        "summary": "Kosten eines Fahrzeugs: Summe, Kostenarten, Kosten je Kilometer, Einzelposten.",
        "operationId": "get_cars_car_id_costs",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Ab Datum (JJJJ-MM-TT)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Bis Datum (JJJJ-MM-TT)."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Kosten"
        ],
        "summary": "Einmalkosten erfassen. Nur Besitzer.",
        "operationId": "post_cars_car_id_costs",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "maintenance",
                      "repair",
                      "tires",
                      "inspection",
                      "insurance",
                      "tax",
                      "purchase",
                      "other"
                    ]
                  },
                  "amount": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "occurred_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "mileage": {
                    "type": "integer"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CarCost"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/costs/{cost_id}": {
      "delete": {
        "tags": [
          "Kosten"
        ],
        "summary": "Kostenposition löschen. Nur Besitzer.",
        "operationId": "delete_cars_car_id_costs_cost_id",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cost_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/recurring-costs": {
      "post": {
        "tags": [
          "Kosten"
        ],
        "summary": "Laufende Kosten anlegen. Nur Besitzer.",
        "operationId": "post_cars_car_id_recurring_costs",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "insurance",
                      "tax",
                      "parking",
                      "leasing",
                      "other"
                    ]
                  },
                  "amount": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "monthly",
                      "quarterly",
                      "yearly"
                    ]
                  },
                  "starts_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "ends_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CarRecurringCost"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/recurring-costs/{rec_id}": {
      "delete": {
        "tags": [
          "Kosten"
        ],
        "summary": "Laufende Kosten löschen. Nur Besitzer.",
        "operationId": "delete_cars_car_id_recurring_costs_rec_id",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "rec_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/costs/overview": {
      "get": {
        "tags": [
          "Kosten"
        ],
        "summary": "Kontoweite Kosten-Übersicht über zwölf Monate mit Fahrzeug-Vergleich.",
        "operationId": "get_costs_overview",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/trips/{trip_id}": {
      "get": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Fahrt mit Route, Geschwindigkeit und Ereignissen.",
        "operationId": "get_trips_trip_id",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TripDetail"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Kategorie, Zweck oder Fahrer setzen. `driver_id` nur im Geschäftskonto, null löscht ihn. Änderungen an Kategorie und Zweck werden protokolliert.",
        "operationId": "patch_trips_trip_id",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "enum": [
                      "business",
                      "private",
                      "commute"
                    ]
                  },
                  "purpose": {
                    "type": "string"
                  },
                  "driver_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TripSummary"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Fahrt löschen. Nur Besitzer. Wird mit Abbild der Fahrt protokolliert.",
        "operationId": "delete_trips_trip_id",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/trips/{trip_id}/export.{fmt}": {
      "get": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Fahrt als GPX- oder KML-Datei.",
        "operationId": "get_trips_trip_id_export_fmt",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "fmt",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "gpx",
                "kml"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Datei",
            "content": {
              "application/gpx+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.google-earth.kml+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/trips/category-bulk": {
      "post": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Bis zu 200 Fahrten auf einmal einordnen. Alles oder nichts.",
        "operationId": "post_trips_category_bulk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "maxItems": 200
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "business",
                      "private",
                      "commute"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "updated": {
                          "type": "integer"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/trips/{trip_id}/share": {
      "post": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Öffentlichen, widerrufbaren Link erzeugen.",
        "operationId": "post_trips_trip_id_share",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "share_url": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "tags": [
          "Fahrten"
        ],
        "summary": "Teilen aufheben.",
        "operationId": "delete_trips_trip_id_share",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "shared": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fuel-receipts": {
      "get": {
        "tags": [
          "Tankrechnungen"
        ],
        "summary": "Alle Tankrechnungen über deine Fahrzeuge.",
        "operationId": "get_fuel_receipts",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl, Standard 50, höchstens 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Versatz für das Blättern."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FuelReceipt"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fuel-receipts/{receipt_id}": {
      "get": {
        "tags": [
          "Tankrechnungen"
        ],
        "summary": "Eine Tankrechnung.",
        "operationId": "get_fuel_receipts_receipt_id",
        "parameters": [
          {
            "name": "receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FuelReceipt"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "tags": [
          "Tankrechnungen"
        ],
        "summary": "Tankrechnung löschen. Nur Besitzer.",
        "operationId": "delete_fuel_receipts_receipt_id",
        "parameters": [
          {
            "name": "receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fuel-receipts/{receipt_id}/image": {
      "get": {
        "tags": [
          "Tankrechnungen"
        ],
        "summary": "Belegfoto als JPEG.",
        "operationId": "get_fuel_receipts_receipt_id_image",
        "parameters": [
          {
            "name": "receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Datei",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "tags": [
          "Suche"
        ],
        "summary": "Suche über Fahrzeuge, Fahrten, Tankrechnungen, Zonen und App-Seiten.",
        "operationId": "get_search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Suchbegriff, Pflicht."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "groups": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fleet/drivers": {
      "get": {
        "tags": [
          "Flotte"
        ],
        "summary": "Fahrer-Stammliste. Nur Geschäftskonten.",
        "operationId": "get_fleet_drivers",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Flotte"
        ],
        "summary": "Fahrer anlegen.",
        "operationId": "post_fleet_drivers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fleet/drivers/{driver_id}": {
      "patch": {
        "tags": [
          "Flotte"
        ],
        "summary": "Fahrer ändern (name, email, active).",
        "operationId": "patch_fleet_drivers_driver_id",
        "parameters": [
          {
            "name": "driver_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "tags": [
          "Flotte"
        ],
        "summary": "Fahrer löschen. Zuordnungen entfallen.",
        "operationId": "delete_fleet_drivers_driver_id",
        "parameters": [
          {
            "name": "driver_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fleet/assignments": {
      "get": {
        "tags": [
          "Flotte"
        ],
        "summary": "Fahrer-Fahrzeug-Zuordnungen.",
        "operationId": "get_fleet_assignments",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Flotte"
        ],
        "summary": "Zuordnung anlegen, ohne Überschneidung je Fahrzeug.",
        "operationId": "post_fleet_assignments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "driver_id": {
                    "type": "integer"
                  },
                  "car_id": {
                    "type": "integer"
                  },
                  "starts_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "ends_on": {
                    "type": "string",
                    "format": "date"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fleet/assignments/{assignment_id}": {
      "delete": {
        "tags": [
          "Flotte"
        ],
        "summary": "Zuordnung entfernen.",
        "operationId": "delete_fleet_assignments_assignment_id",
        "parameters": [
          {
            "name": "assignment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/fleet/report": {
      "get": {
        "tags": [
          "Flotte"
        ],
        "summary": "Monatsbericht je Fahrer und Fahrzeug (Kilometer, Fahrten, geschätzte Kosten).",
        "operationId": "get_fleet_report",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Jahr, Standard voriger Monat."
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Monat 1 bis 12."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/geofences": {
      "get": {
        "tags": [
          "Zonen"
        ],
        "summary": "Alle eigenen Zonen.",
        "operationId": "get_geofences",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Geofence"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Zonen"
        ],
        "summary": "Zone anlegen. radius_m optional, Standard 200.",
        "operationId": "post_geofences",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "lat": {
                    "type": "number"
                  },
                  "lon": {
                    "type": "number"
                  },
                  "radius_m": {
                    "type": "integer"
                  },
                  "notify_enter": {
                    "type": "boolean"
                  },
                  "notify_leave": {
                    "type": "boolean"
                  },
                  "active_start_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "active_end_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "car_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Geofence"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/geofences/{zone_id}": {
      "patch": {
        "tags": [
          "Zonen"
        ],
        "summary": "Zone ändern.",
        "operationId": "patch_geofences_zone_id",
        "parameters": [
          {
            "name": "zone_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "radius_m": {
                    "type": "integer"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "notify_enter": {
                    "type": "boolean"
                  },
                  "notify_leave": {
                    "type": "boolean"
                  },
                  "active_start_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "active_end_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "car_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Geofence"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "delete": {
        "tags": [
          "Zonen"
        ],
        "summary": "Zone samt Verlauf löschen.",
        "operationId": "delete_geofences_zone_id",
        "parameters": [
          {
            "name": "zone_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/geofences/{zone_id}/events": {
      "get": {
        "tags": [
          "Zonen"
        ],
        "summary": "Ein- und Austritte einer Zone, neueste zuerst.",
        "operationId": "get_geofences_zone_id_events",
        "parameters": [
          {
            "name": "zone_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl, Standard 50, höchstens 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Versatz für das Blättern."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GeofenceEvent"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/cars/{car_id}/zone-events": {
      "get": {
        "tags": [
          "Zonen"
        ],
        "summary": "Ein- und Austritte eines eigenen Fahrzeugs über alle Zonen.",
        "operationId": "get_cars_car_id_zone_events",
        "parameters": [
          {
            "name": "car_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl, Standard 50, höchstens 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Versatz für das Blättern."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GeofenceEvent"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Eigene Webhook-Ziele, ohne Geheimnis.",
        "operationId": "get_webhooks",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Ziel anlegen. Nur öffentliche https-Adressen. Die Antwort enthält das Geheimnis genau einmal.",
        "operationId": "post_webhooks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "trip.completed",
                        "zone.entered",
                        "zone.left",
                        "alert.raised"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/webhooks/{endpoint_id}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Ziel widerrufen.",
        "operationId": "delete_webhooks_endpoint_id",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/notifications": {
      "get": {
        "tags": [
          "Mitteilungen"
        ],
        "summary": "Mitteilungen, blätterbar. `unread=1` nur ungelesene.",
        "operationId": "get_notifications",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl, Standard 50, höchstens 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Versatz für das Blättern."
          },
          {
            "name": "unread",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1 = nur ungelesene."
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Notification"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/notifications/unread-count": {
      "get": {
        "tags": [
          "Mitteilungen"
        ],
        "summary": "Anzahl ungelesener Mitteilungen.",
        "operationId": "get_notifications_unread_count",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "unread": {
                          "type": "integer"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/notifications/{notification_id}/read": {
      "post": {
        "tags": [
          "Mitteilungen"
        ],
        "summary": "Eine Mitteilung als gelesen markieren.",
        "operationId": "post_notifications_notification_id_read",
        "parameters": [
          {
            "name": "notification_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/notifications/read-all": {
      "post": {
        "tags": [
          "Mitteilungen"
        ],
        "summary": "Alle als gelesen markieren.",
        "operationId": "post_notifications_read_all",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/api/v1/logbook/export": {
      "get": {
        "tags": [
          "Fahrtenbuch"
        ],
        "summary": "Fahrtenbuch als Datei (PDF, CSV oder Excel) mit Änderungsprotokoll. 409, solange Fahrten ohne Kategorie im Zeitraum liegen.",
        "operationId": "get_logbook_export",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "csv",
                "xlsx"
              ]
            },
            "description": "Dateiformat."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Ab Datum (JJJJ-MM-TT)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Bis Datum (JJJJ-MM-TT)."
          },
          {
            "name": "car_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Nur dieses Fahrzeug."
          }
        ],
        "responses": {
          "200": {
            "description": "Datei",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API-Key aus den Einstellungen: Authorization: Bearer <key>"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        },
        "description": "Fehlerantwort. `code` ist ein stabiler Bezeichner, `message` Klartext."
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "salutation": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Position": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number"
          },
          "lon": {
            "type": "number"
          },
          "fuel_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "fuel_liters": {
            "type": [
              "number",
              "null"
            ]
          },
          "tank_capacity_l": {
            "type": [
              "number",
              "null"
            ]
          },
          "range_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "voltage_v": {
            "type": [
              "number",
              "null"
            ]
          },
          "dtc_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "moved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "packet_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "moving": {
            "type": "boolean"
          },
          "speed_kmh": {
            "type": [
              "number",
              "null"
            ],
            "description": "Nur während einer Fahrt, sonst null."
          }
        },
        "description": "Letzte bekannte Position und Live-Werte des Fahrzeugs."
      },
      "Car": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "vin": {
            "type": [
              "string",
              "null"
            ]
          },
          "license_plate": {
            "type": [
              "string",
              "null"
            ]
          },
          "license_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "make": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_registration": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "body_class": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_registered": {
            "type": "boolean"
          },
          "access": {
            "type": "string",
            "enum": [
              "owner",
              "shared"
            ]
          },
          "current_mileage": {
            "type": [
              "integer",
              "null"
            ]
          },
          "odometer_auto": {
            "type": "boolean"
          },
          "mileage_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "manual_avg_fuel_l_per_100km": {
            "type": [
              "number",
              "null"
            ]
          },
          "learned_avg_fuel_l_per_100km": {
            "type": [
              "number",
              "null"
            ]
          },
          "estimated_avg_fuel_l_per_100km": {
            "type": [
              "number",
              "null"
            ]
          },
          "position": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Position"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "TripSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "car_id": {
            "type": "integer"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_min": {
            "type": "integer"
          },
          "distance_m": {
            "type": "integer"
          },
          "distance_km": {
            "type": "number"
          },
          "top_speed_kmh": {
            "type": [
              "number",
              "null"
            ]
          },
          "avg_fuel_l_per_100km": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "estimated_cost_eur": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "fuel_price_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "business",
              "private",
              "commute",
              null
            ]
          },
          "purpose": {
            "type": [
              "string",
              "null"
            ]
          },
          "driver_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "driving_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "event_count": {
            "type": "integer"
          },
          "shared": {
            "type": "boolean"
          },
          "share_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TripDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TripSummary"
          },
          {
            "type": "object",
            "properties": {
              "route": {
                "type": "array",
                "items": {},
                "description": "Punkte der Strecke."
              },
              "speed_series": {
                "type": "array",
                "items": {}
              },
              "events": {
                "type": "array",
                "items": {}
              },
              "score_breakdown": {
                "type": [
                  "object",
                  "null"
                ]
              }
            }
          }
        ]
      },
      "FuelReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "car_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fueled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "liters": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "price_per_liter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "total_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "discount_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_amount_eur": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "fx_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Dezimalzahl als Text, z. B. \"1.789\""
          },
          "fx_rate_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "fuel_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "station_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "station_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "owned": {
            "type": "boolean"
          },
          "image_url": {
            "type": "string"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MaintenanceItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "interval_km": {
            "type": [
              "integer",
              "null"
            ]
          },
          "interval_months": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_service_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "last_service_mileage": {
            "type": [
              "integer",
              "null"
            ]
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "due_km": {
            "type": [
              "integer",
              "null"
            ]
          },
          "severity": {
            "type": [
              "string",
              "null"
            ]
          },
          "notify_lead_times": {
            "type": "array",
            "items": {}
          }
        }
      },
      "Geofence": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lon": {
            "type": "number"
          },
          "radius_m": {
            "type": "integer"
          },
          "notify_enter": {
            "type": "boolean"
          },
          "notify_leave": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "active_start_min": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minuten seit lokaler Mitternacht, null = ganztägig."
          },
          "active_end_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "car_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Leer = alle Fahrzeuge."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "GeofenceEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "zone_id": {
            "type": "integer"
          },
          "car_id": {
            "type": "integer"
          },
          "direction": {
            "type": "string",
            "enum": [
              "enter",
              "leave"
            ]
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "notified": {
            "type": "boolean"
          },
          "lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "lon": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "Nur in der Antwort auf das Anlegen."
          }
        }
      },
      "Notification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "priority": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": [
              "string",
              "null"
            ]
          },
          "car_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "deeplink_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "payload": {
            "type": [
              "object",
              "null"
            ]
          },
          "read": {
            "type": "boolean"
          },
          "read_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Battery": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "resting_v": {
            "type": [
              "number",
              "null"
            ]
          },
          "crank_min_v": {
            "type": [
              "number",
              "null"
            ]
          },
          "crank_outlier_v": {
            "type": [
              "number",
              "null"
            ]
          },
          "crank_outlier_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "charge_max_v": {
            "type": [
              "number",
              "null"
            ]
          },
          "charging_ok": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "trend": {
            "type": [
              "string",
              "null"
            ]
          },
          "trend_delta_v": {
            "type": [
              "number",
              "null"
            ]
          },
          "days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "spark": {
            "type": "array",
            "items": {}
          }
        }
      },
      "CarCost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "car_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "kind_label": {
            "type": "string"
          },
          "occurred_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "amount": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "amount_eur": {
            "type": "string"
          },
          "fx_rate": {
            "type": [
              "string",
              "null"
            ]
          },
          "fx_rate_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "mileage": {
            "type": [
              "integer",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "maintenance_log_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "CarRecurringCost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "car_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "kind_label": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "amount_eur": {
            "type": "string"
          },
          "period": {
            "type": "string",
            "enum": [
              "monthly",
              "quarterly",
              "yearly"
            ]
          },
          "starts_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "ends_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "responses": {
      "E400": {
        "description": "Ungültige Eingabe.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "API-Key fehlt oder ist ungültig.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "Keine Berechtigung für diese Aktion.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "Nicht gefunden.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Zu viele Anfragen (120 je Minute und Schlüssel).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
