{
  "openapi": "3.1.0",
  "info": {
    "title": "SaveTrack API",
    "version": "1.0.0",
    "contact": {
      "name": "SaveTrack",
      "email": "info@savetrack.sk",
      "url": "https://savetrack.sk"
    },
    "description": "Read-only REST API for connecting SaveTrack with accounting and ERP systems.\n\n**Authentication:** create a key in SaveTrack → Settings → API and send it as `Authorization: Bearer st_live_…`. A key in the URL is rejected.\n\n**Scopes:** `vozidla:read`, `vodici:read`, `jazdy:read`, `kniha-jazd:read`, `tankovania:read`, `adresy:read`. Trip addresses and coordinates are returned only with `adresy:read`, never for private trips.\n\n**Limits:** 60 requests per minute per key and 2,000 requests per day per account. Over the limit you get `429` with `Retry-After`.\n\n**Pagination:** lists return at most `limit` records ordered by ID and `next_od_id`; pass it as `od_id` for the next page. Use `zmenene_od` for incremental synchronisation.\n\n**Errors:** always `{\"error\": \"…\", \"code\": \"…\", \"fields\": {…}}`. A record of another account returns `404`. Every response has an `X-Request-Id` header; include it when contacting support.\n\n**Units:** distances in km, volume in litres, money in cents with an ISO 4217 currency, times in ISO 8601."
  },
  "tags": [
    {
      "name": "Account",
      "description": "The account the API key belongs to."
    },
    {
      "name": "Vehicles",
      "description": "Vehicles of the account (`vozidla`)."
    },
    {
      "name": "Drivers",
      "description": "Drivers of the account (`vodici`)."
    },
    {
      "name": "Trips",
      "description": "Trips with distance and odometer (`jazdy`). Addresses need the `adresy:read` scope."
    },
    {
      "name": "Driving book",
      "description": "Driving log of one vehicle for a period, as required for VAT and tax purposes (`kniha-jazd`)."
    },
    {
      "name": "Refuelings",
      "description": "Refuelings and charging (`tankovania`)."
    }
  ],
  "servers": [
    {
      "url": "https://admin.savetrack.sk/api/v1"
    },
    {
      "url": "https://admin.savetrack.cz/api/v1"
    },
    {
      "url": "https://admin.savetrack.eu/api/v1"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/ucet": {
      "get": {
        "summary": "Account of the API key",
        "tags": [
          "Account"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Account"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vozidla": {
      "get": {
        "summary": "List vehicles",
        "tags": [
          "Vehicles"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1–200, default 100",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "od_id",
            "in": "query",
            "required": false,
            "description": "Cursor: return records after this ID (value of next_od_id)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zmenene_od",
            "in": "query",
            "required": false,
            "description": "Only records changed since this date-time (ISO 8601), for synchronisation",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Vehicle"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as od_id to get the next page; null = last page"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `vozidla:read`"
      }
    },
    "/vozidla/{id}": {
      "get": {
        "summary": "Vehicle detail",
        "tags": [
          "Vehicles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vehicle"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `vozidla:read`"
      }
    },
    "/vodici": {
      "get": {
        "summary": "List drivers",
        "tags": [
          "Drivers"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1–200, default 100",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "od_id",
            "in": "query",
            "required": false,
            "description": "Cursor: return records after this ID (value of next_od_id)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zmenene_od",
            "in": "query",
            "required": false,
            "description": "Only records changed since this date-time (ISO 8601), for synchronisation",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Driver"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as od_id to get the next page; null = last page"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `vodici:read`"
      }
    },
    "/vodici/{id}": {
      "get": {
        "summary": "Driver detail",
        "tags": [
          "Drivers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Driver"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `vodici:read`"
      }
    },
    "/jazdy": {
      "get": {
        "summary": "List trips",
        "tags": [
          "Trips"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1–200, default 100",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "od_id",
            "in": "query",
            "required": false,
            "description": "Cursor: return records after this ID (value of next_od_id)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zmenene_od",
            "in": "query",
            "required": false,
            "description": "Only records changed since this date-time (ISO 8601), for synchronisation",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "od",
            "in": "query",
            "required": false,
            "description": "From date (trip start)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "do",
            "in": "query",
            "required": false,
            "description": "To date (inclusive)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "vozidlo_id",
            "in": "query",
            "required": false,
            "description": "Vehicle ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vodic_id",
            "in": "query",
            "required": false,
            "description": "Driver ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Trip"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as od_id to get the next page; null = last page"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `jazdy:read`"
      }
    },
    "/jazdy/{id}": {
      "get": {
        "summary": "Trip detail",
        "tags": [
          "Trips"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Trip"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `jazdy:read`"
      }
    },
    "/kniha-jazd": {
      "get": {
        "summary": "Driving book of one vehicle for a period (max. 1 year)",
        "tags": [
          "Driving book"
        ],
        "parameters": [
          {
            "name": "vozidlo_id",
            "in": "query",
            "required": true,
            "description": "Vehicle ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "od",
            "in": "query",
            "required": true,
            "description": "From date (trip start)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "do",
            "in": "query",
            "required": true,
            "description": "To date (inclusive)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DrivingBook"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `kniha-jazd:read`"
      }
    },
    "/kniha-jazd/nahrady": {
      "get": {
        "summary": "Travel allowances (fuel reimbursement) of one vehicle for a period",
        "tags": [
          "Driving book"
        ],
        "parameters": [
          {
            "name": "vozidlo_id",
            "in": "query",
            "required": true,
            "description": "Vehicle ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "od",
            "in": "query",
            "required": true,
            "description": "From date (trip start)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "do",
            "in": "query",
            "required": true,
            "description": "To date (inclusive)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `kniha-jazd:read`"
      }
    },
    "/tankovania": {
      "get": {
        "summary": "List refuelings",
        "tags": [
          "Refuelings"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1–200, default 100",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "od_id",
            "in": "query",
            "required": false,
            "description": "Cursor: return records after this ID (value of next_od_id)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zmenene_od",
            "in": "query",
            "required": false,
            "description": "Only records changed since this date-time (ISO 8601), for synchronisation",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "od",
            "in": "query",
            "required": false,
            "description": "From date (refueling)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "do",
            "in": "query",
            "required": false,
            "description": "To date (inclusive)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "vozidlo_id",
            "in": "query",
            "required": false,
            "description": "Vehicle ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FuelLog"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as od_id to get the next page; null = last page"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `tankovania:read`"
      }
    },
    "/tankovania/{id}": {
      "get": {
        "summary": "Refueling detail",
        "tags": [
          "Refuelings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FuelLog"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Scope: `tankovania:read`"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "unauthenticated",
              "forbidden",
              "not_found",
              "validation_failed",
              "rate_limited",
              "server_error"
            ]
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "error": "Missing scope: vozidla:read",
          "code": "forbidden"
        }
      },
      "Vehicle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public ID"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "vin": {
            "type": [
              "string",
              "null"
            ]
          },
          "brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "fuel_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownership": {
            "type": "string"
          },
          "odometer_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "driver_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public ID"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "example": {
          "id": "4fK2pQ9xZa",
          "name": "Octavia Combi",
          "registration_number": "BA123AB",
          "vin": "TMBJJ7NE5L0123456",
          "brand": "Škoda",
          "model": "Octavia",
          "category": "M1",
          "fuel_type": "diesel",
          "ownership": "company",
          "odometer_km": 84512.4,
          "driver_id": "7Hq0LmN3bV",
          "created_at": "2025-03-14T09:12:00+01:00",
          "updated_at": "2026-10-31T17:45:10+01:00"
        }
      },
      "Driver": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public ID"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "surname": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "example": {
          "id": "7Hq0LmN3bV",
          "name": "Jana",
          "surname": "Nováková",
          "email": "jana.novakova@firma.sk",
          "phone": "+421900123456",
          "created_at": "2025-03-14T09:15:00+01:00",
          "updated_at": "2026-02-01T08:00:00+01:00"
        }
      },
      "Place": {
        "type": "object",
        "description": "Only with scope adresy:read. Null values for private trips.",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ]
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "Trip": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public ID"
          },
          "vehicle_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public ID"
          },
          "driver_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public ID"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "distance_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "odometer_start_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "odometer_end_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "business",
              "private",
              null
            ],
            "description": "null = not classified yet"
          },
          "purpose": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "start": {
            "$ref": "#/components/schemas/Place"
          },
          "end": {
            "$ref": "#/components/schemas/Place"
          }
        },
        "example": {
          "id": "9QzL0bW1xY",
          "vehicle_id": "4fK2pQ9xZa",
          "driver_id": "7Hq0LmN3bV",
          "started_at": "2026-10-01T08:02:11+02:00",
          "ended_at": "2026-10-01T09:14:40+02:00",
          "distance_km": 61.3,
          "odometer_start_km": 84100.2,
          "odometer_end_km": 84161.5,
          "type": "business",
          "purpose": "Stretnutie s klientom",
          "updated_at": "2026-10-02T07:30:00+02:00",
          "start": {
            "address": "Mlynské nivy 5, 821 09 Bratislava",
            "latitude": 48.1446,
            "longitude": 17.1257
          },
          "end": {
            "address": "Hlavná 12, 917 01 Trnava",
            "latitude": 48.3774,
            "longitude": 17.5872
          }
        }
      },
      "DrivingBookTrip": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Trip"
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "description": "Sequence number per vehicle"
              },
              "vehicle": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "registration_number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "vin": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "driver": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "surname": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        ]
      },
      "DrivingBook": {
        "type": "object",
        "properties": {
          "vehicle_id": {
            "type": "string",
            "description": "Public ID"
          },
          "od": {
            "type": "string",
            "format": "date"
          },
          "do": {
            "type": "string",
            "format": "date"
          },
          "odometer_start_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "odometer_end_km": {
            "type": [
              "number",
              "null"
            ]
          },
          "summary": {
            "type": "object",
            "properties": {
              "trips": {
                "type": "integer"
              },
              "business_km": {
                "type": "number"
              },
              "private_km": {
                "type": "number"
              },
              "unclassified_km": {
                "type": "number"
              }
            }
          },
          "trips": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DrivingBookTrip"
            }
          }
        },
        "example": {
          "vehicle_id": "4fK2pQ9xZa",
          "od": "2026-10-01",
          "do": "2026-10-31",
          "odometer_start_km": 84100.2,
          "odometer_end_km": 85320.0,
          "summary": {
            "trips": 38,
            "business_km": 1104.6,
            "private_km": 115.2,
            "unclassified_km": 0
          },
          "trips": [
            {
              "id": "9QzL0bW1xY",
              "vehicle_id": "4fK2pQ9xZa",
              "driver_id": "7Hq0LmN3bV",
              "started_at": "2026-10-01T08:02:11+02:00",
              "ended_at": "2026-10-01T09:14:40+02:00",
              "distance_km": 61.3,
              "odometer_start_km": 84100.2,
              "odometer_end_km": 84161.5,
              "type": "business",
              "purpose": "Stretnutie s klientom",
              "updated_at": "2026-10-02T07:30:00+02:00",
              "start": {
                "address": "Mlynské nivy 5, 821 09 Bratislava",
                "latitude": 48.1446,
                "longitude": 17.1257
              },
              "end": {
                "address": "Hlavná 12, 917 01 Trnava",
                "latitude": 48.3774,
                "longitude": 17.5872
              },
              "seq": 1,
              "vehicle": {
                "name": "Octavia Combi",
                "registration_number": "BA123AB",
                "vin": "TMBJJ7NE5L0123456"
              },
              "driver": {
                "name": "Jana",
                "surname": "Nováková"
              }
            }
          ]
        }
      },
      "FuelLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public ID"
          },
          "vehicle_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public ID"
          },
          "driver_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public ID"
          },
          "trip_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public ID"
          },
          "refueled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "station": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "fuel_kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "volume_l": {
            "type": [
              "number",
              "null"
            ]
          },
          "energy_kwh": {
            "type": [
              "number",
              "null"
            ]
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217, by account legislation country"
          },
          "odometer_km": {
            "type": [
              "integer",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "example": {
          "id": "2Ty8KpXw0c",
          "vehicle_id": "4fK2pQ9xZa",
          "driver_id": "7Hq0LmN3bV",
          "trip_id": "9QzL0bW1xY",
          "refueled_at": "2026-10-01T10:05:00+02:00",
          "station": "Slovnaft Trnava",
          "title": "Nafta",
          "fuel_kind": "diesel",
          "volume_l": 42.5,
          "energy_kwh": null,
          "price_cents": 6588,
          "currency": "EUR",
          "odometer_km": 84170,
          "updated_at": "2026-10-01T10:20:00+02:00"
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "legislation_country": {
            "type": "string",
            "enum": [
              "sk",
              "cz"
            ]
          },
          "currency": {
            "type": "string"
          },
          "api_key": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        },
        "example": {
          "name": "Firma s.r.o.",
          "email": "ucty@firma.sk",
          "legislation_country": "sk",
          "currency": "EUR",
          "api_key": {
            "name": "Pohoda",
            "scopes": [
              "vozidla:read",
              "jazdy:read",
              "kniha-jazd:read"
            ],
            "expires_at": null
          }
        }
      }
    }
  }
}