{ "openapi": "3.2.0", "info": { "title": "GarageStack API", "description": "GarageStack's own API: everything the web app shows and does, for scripts, Home Assistant and\nanything else you connect.\n\n## Signing in\n\n- **On this page**, *Test Request* sends the request as you, with the session of the browser\n you signed in with. It is the real thing: a command goes to the car, a delete deletes.\n- **From a script**, make a read-only token under *Settings, API tokens* and send it as\n `Authorization: Bearer gs_...`. A token only reads (GET), and never the export, the logs\n or the tokens themselves: every endpoint it can call carries a *Read-only token* badge.\n- **The Homepage widget** sends the `X-Widget-Key` header (WIDGET_API_KEY) instead.\n\n## Answers\n\n- Times are UTC, in ISO 8601. Distances are km, speeds km/h, temperatures °C, tyre pressures\n bar, energy kWh and power kW, whatever units the web app is set to show.\n- A refusal is a problem details body (RFC 9457) with a `code`, such as `trip.changed`, that\n stays the same between releases; `detail` says it in English.\n- Each address may make 120 requests a minute (RATE_LIMIT_GLOBAL_PER_MINUTE), and some\n endpoints allow fewer. Past that the answer is 429.\n- A command's outcome arrives later, over the SignalR hub at `/hubs/telemetry`, as the car\n answers it. The command endpoint only says it was sent.\n- `GET /api/health` reports the database, the MQTT broker and the Worker, without signing in.", "license": { "name": "MIT", "url": "https://github.com/joszz/garagestack/blob/main/LICENSE" }, "version": "(the release)" }, "paths": { "/api/calendar/feed.ics": { "get": { "tags": [ "Calendar" ], "summary": "The calendar feed: APK expiry, maintenance due dates and the next two weeks of climate schedules, as iCalendar", "responses": { "200": { "description": "OK", "content": { "text/calendar": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "calendarToken": [] } ] } }, "/api/export": { "get": { "tags": [ "Export" ], "summary": "Download everything GarageStack keeps, as a zip of JSON files and a telemetry CSV per car", "responses": { "200": { "description": "OK", "content": { "application/zip": { "schema": { "$ref": "#/components/schemas/Stream" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.sessionOnly`: The export, the logs and the diagnostics need a signed-in session; an API token cannot read them.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/diagnostics": { "get": { "tags": [ "Diagnostics" ], "summary": "Download anonymized diagnostics for a bug report: version, health, car details, a week of readings without positions, and a week of warnings from the logs", "responses": { "200": { "description": "OK", "content": { "application/zip": { "schema": { "$ref": "#/components/schemas/Stream" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.sessionOnly`: The export, the logs and the diagnostics need a signed-in session; an API token cannot read them.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/logs": { "get": { "tags": [ "Logs" ], "summary": "A page of the API's and the Worker's log entries, newest first, from a level up and matching a search: the newest, the one before an older cursor, or what came after a newer one", "parameters": [ { "name": "source", "in": "query", "schema": { "type": "string" } }, { "name": "level", "in": "query", "schema": { "$ref": "#/components/schemas/LogLevelName" } }, { "name": "search", "in": "query", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "format": "int32" } }, { "name": "before", "in": "query", "schema": { "type": "string" } }, { "name": "after", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogPageDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.sessionOnly`: The export, the logs and the diagnostics need a signed-in session; an API token cannot read them.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/dawarich/status": { "get": { "tags": [ "Dawarich" ], "summary": "Check whether Dawarich is configured and reachable with the configured key", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DawarichStatusResponse" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/updates": { "get": { "tags": [ "Updates" ], "summary": "Whether a newer GarageStack release is available", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateInfo" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/gateway": { "get": { "tags": [ "Gateway" ], "summary": "Whether the gateway is signed in to the MG account", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayStatus" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/client-errors": { "post": { "tags": [ "Diagnostics" ], "summary": "Record an error the web app ran into in the browser", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientErrorReport" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/auth/config": { "get": { "tags": [ "Authentication" ], "summary": "Get the enabled sign-in methods", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthConfigResponse" } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } } } }, "/api/auth/oidc/login": { "get": { "tags": [ "Authentication" ], "summary": "Start the OpenID Connect sign-in flow: a browser navigation, redirected to the provider (404 without one)", "parameters": [ { "name": "returnUrl", "in": "query", "schema": { "type": "string" } } ], "responses": { "302": { "description": "Found" }, "404": { "description": "Not Found" }, "429": { "description": "Too many requests from this address; wait a minute and try again." } } } }, "/api/auth/logout": { "post": { "tags": [ "Authentication" ], "summary": "Clear the session cookie and revoke the session server-side", "responses": { "204": { "description": "No Content" }, "403": { "description": "`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } } } }, "/api/auth/me": { "get": { "tags": [ "Authentication" ], "summary": "Get current authenticated user", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MeResponse" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/auth/login": { "post": { "tags": [ "Authentication" ], "summary": "Authenticate with the built-in password login, which sets the session cookie (404 while it is switched off)", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not Found" }, "403": { "description": "`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } } } }, "/api/settings": { "get": { "tags": [ "Settings" ], "summary": "Get the signed-in account's settings, by section; a section never saved is left out", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" } } } }, "403": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/settings/{section}": { "patch": { "tags": [ "Settings" ], "summary": "Save some of a section's settings; the keys left out keep their saved values", "parameters": [ { "name": "section", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonElement" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "Payload Too Large", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/tokens": { "get": { "tags": [ "API tokens" ], "summary": "List the signed-in account's API tokens, newest first, without the tokens themselves", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ApiTokenDto" } } } } }, "403": { "description": "`token.cannotManageTokens`: API tokens are managed from a signed-in session only.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] }, "post": { "tags": [ "API tokens" ], "summary": "Make a read-only API token; the response is the only time the token is shown", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateApiTokenRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatedApiTokenDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/tokens/{id}": { "delete": { "tags": [ "API tokens" ], "summary": "Revoke an API token: it stops working at once", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "204": { "description": "No Content" }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/tokens/reference": { "get": { "tags": [ "API tokens" ], "summary": "Whether this deployment serves the API reference page (API_REFERENCE_ENABLED)", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiReferenceStatus" } } } }, "403": { "description": "`token.cannotManageTokens`: API tokens are managed from a signed-in session only.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/calendar/link": { "get": { "tags": [ "Calendar" ], "summary": "Whether the signed-in account has a calendar link, without the link itself", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarLinkDto" } } } }, "403": { "description": "`token.cannotManageTokens`: API tokens are managed from a signed-in session only.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] }, "post": { "tags": [ "Calendar" ], "summary": "Make the account's calendar link, replacing the one it had; the response is the only time its token is shown", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatedCalendarLinkDto" } } } }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] }, "delete": { "tags": [ "Calendar" ], "summary": "Stop the account's calendar link: calendar apps get nothing more from it", "responses": { "204": { "description": "No Content" }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles": { "get": { "tags": [ "Vehicles" ], "summary": "List all vehicles", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VehicleListItemDto" } } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/tyre-pressure-thresholds": { "get": { "tags": [ "Vehicles" ], "summary": "Get the deployment's tyre pressure colour-coding thresholds, which a vehicle without settings of its own uses", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TyrePressureThresholds" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/tyre-pressure-thresholds": { "get": { "tags": [ "Vehicles" ], "summary": "Get the vehicle's tyre pressure colour-coding thresholds: its own settings, else the deployment's", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TyrePressureThresholds" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/settings": { "get": { "tags": [ "Vehicles" ], "summary": "Get the vehicle's own settings, with the deployment default each empty one falls back to", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VehicleSettingsDto" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "patch": { "tags": [ "Vehicles" ], "summary": "Change some of the vehicle's own settings: a field left out stays, null puts it back to the deployment default", "requestBody": { "content": { "application/json": { "schema": { "required": [ "hvBatteryCapacityKwh", "tyreLowBar", "tyreGoodBar", "tyreHighBar", "tyreDropBar", "auxBatteryLowVolt", "lowFuelPercent", "lowEvPercent", "vehicleType" ], "type": "object", "properties": { "hvBatteryCapacityKwh": { "type": [ "null", "number" ], "description": "Usable traction battery size, 0.5 to 200 kWh. Refused on a plain hybrid (hev).", "format": "double" }, "tyreLowBar": { "type": [ "null", "number" ], "description": "Below this a tyre is low, 1 to 5 bar.", "format": "double" }, "tyreGoodBar": { "type": [ "null", "number" ], "description": "From this a tyre is at its placard pressure, 1 to 5 bar, from the low one up.", "format": "double" }, "tyreHighBar": { "type": [ "null", "number" ], "description": "Above this a tyre is too high, 1 to 5 bar, from the good one up.", "format": "double" }, "tyreDropBar": { "type": [ "null", "number" ], "description": "How far one tyre may fall behind the others over two weeks, 0 to 1 bar; 0 switches the slow-puncture alert off.", "format": "double" }, "auxBatteryLowVolt": { "type": [ "null", "number" ], "description": "12V battery voltage a parked car is warned below, 0 to 15 V; 0 switches the alert off.", "format": "double" }, "lowFuelPercent": { "type": [ "null", "number" ], "description": "Fuel level warned below, 0 to 100 %; 0 switches the alert off.", "format": "double" }, "lowEvPercent": { "type": [ "null", "number" ], "description": "Charge level a plug-in is warned below, 0 to 100 %; 0 switches the alert off.", "format": "double" }, "vehicleType": { "type": [ "null", "string" ], "description": "The drivetrain: hev, phev or bev. As a default, the detected one, or null while none is." } }, "description": "Every per-car setting. In a change, a field left out stays as it is and null clears it; in an\nanswer, null is a value not set." } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VehicleSettingsDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/config": { "get": { "tags": [ "Vehicles" ], "summary": "Get vehicle capability config", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/power-tailgate": { "put": { "tags": [ "Vehicles" ], "summary": "Say whether the vehicle has a power tailgate, which the tailgate open and close commands need", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PowerTailgateSetting" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PowerTailgateSetting" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/status": { "get": { "tags": [ "Vehicles" ], "summary": "Get latest telemetry for a vehicle (204 before the car has reported anything)", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TelemetrySnapshot" } } } }, "204": { "description": "No Content" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/charge-sessions": { "get": { "tags": [ "Vehicles" ], "summary": "Get the charge sessions in a period (default the last 90 days, at most 366), rebuilt from recorded charging-state transitions, without their power curves", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChargeSession" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/charge-sessions/power": { "get": { "tags": [ "Vehicles" ], "summary": "Get the charging power recorded in one session, from its start to its end (or now), in kW", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChargeSessionPowerPoint" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/stats/daily": { "get": { "tags": [ "Vehicles" ], "summary": "Daily statistics for a vehicle: one row per local day, from every reading of it", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date" } }, { "name": "timeZone", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DailyStat" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/tyres": { "get": { "tags": [ "Vehicles" ], "summary": "A month of daily tyre pressures, and each tyre's change against the others over the last two weeks", "parameters": [ { "name": "timeZone", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TyreHistoryDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/commands/{command}": { "post": { "tags": [ "Vehicles" ], "summary": "Send a command to the vehicle via MQTT; the car's answer arrives later over SignalR", "parameters": [ { "name": "command", "in": "path", "required": true, "schema": { "enum": [ "battery-heating", "battery-heating-schedule", "boot", "charge-limit", "charge-target", "charging", "charging-cable-lock", "climate", "climate-temperature", "find-my-car", "lock", "power-tailgate", "rear-defroster", "refresh", "scheduled-charging", "seat-left", "seat-right" ], "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "required": [ "value" ], "type": "object", "properties": { "value": { "type": "string" } }, "description": "A command's value, always as text: \"on\", \"True\", \"80\", or a small JSON object for a schedule." } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VehicleCommandSent" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ], "x-badges": [ { "name": "Sends to the car" } ] } }, "/api/vehicles/{vin}/stats": { "get": { "tags": [ "Vehicles" ], "summary": "Get aggregate statistics for a vehicle over a date range", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VehicleAggregateStats" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/trips": { "get": { "tags": [ "Trips" ], "summary": "Get trip history (saved trips, then the ones not saved yet, including the trip being driven); points=false leaves out the fixes, format=compact packs them into a polyline and two arrays", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "points", "in": "query", "schema": { "type": "boolean" } }, { "name": "format", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "oneOf": [ { "type": "array", "items": { "required": [ "index", "startedAt", "endedAt", "distanceKm", "pointCount", "points" ], "type": "object", "properties": { "index": { "type": "integer", "format": "int32" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "distanceKm": { "type": "number", "format": "double" }, "pointCount": { "type": "integer", "format": "int32" }, "points": { "type": "array", "items": { "required": [ "recordedAt", "latitude", "longitude", "speed" ], "type": "object", "properties": { "recordedAt": { "type": "string", "format": "date-time" }, "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "speed": { "type": [ "null", "number" ], "format": "double" }, "source": { "enum": [ "anchored", "manual", "phone", null ] } }, "description": "A position on a trip's path. Source is null for a fix the car reported as it\ndrove, and otherwise says why the point is there: left out of the JSON when null, so the trips\nsaved before it existed read the same." } }, "id": { "type": [ "null", "integer" ], "format": "int64" }, "endLatitude": { "type": [ "null", "number" ], "description": "Where the trip ended, or null for a trip without fixes.", "format": "double" }, "endLongitude": { "type": [ "null", "number" ], "format": "double" }, "maxSpeedKmh": { "type": [ "null", "number" ], "description": "The highest speed any fix reported, or null when none carried a speed.", "format": "double" }, "avgMovingSpeedKmh": { "type": [ "null", "number" ], "description": "The mean of the speeds reported while moving, or null when none was.", "format": "double" }, "movingSpeedSamples": { "type": "integer", "description": "How many fixes reported a speed while moving: the weight to give\ndouble? TripDto.AvgMovingSpeedKmh when averaging over several trips.", "format": "int32" } }, "description": "A trip as the Api serves it. Id is the saved trip's id, or null for a trip\nthe Worker has not saved yet, such as the one being driven. The summary figures are read off\nPoints, so a client that needs only those can ask for\nTripSummaryDto instead and skip the fixes." } }, { "type": "array", "items": { "required": [ "index", "id", "startedAt", "endedAt", "distanceKm", "pointCount", "endLatitude", "endLongitude", "maxSpeedKmh", "avgMovingSpeedKmh", "movingSpeedSamples" ], "type": "object", "properties": { "index": { "type": "integer", "format": "int32" }, "id": { "type": [ "null", "integer" ], "format": "int64" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "distanceKm": { "type": "number", "format": "double" }, "pointCount": { "type": "integer", "format": "int32" }, "endLatitude": { "type": [ "null", "number" ], "format": "double" }, "endLongitude": { "type": [ "null", "number" ], "format": "double" }, "maxSpeedKmh": { "type": [ "null", "number" ], "format": "double" }, "avgMovingSpeedKmh": { "type": [ "null", "number" ], "format": "double" }, "movingSpeedSamples": { "type": "integer", "format": "int32" } }, "description": "A trip without its fixes: what the statistics page needs from a whole period of trips, at a\nfraction of the size." } }, { "type": "array", "items": { "required": [ "index", "id", "startedAt", "endedAt", "distanceKm", "pointCount", "endLatitude", "endLongitude", "maxSpeedKmh", "avgMovingSpeedKmh", "movingSpeedSamples", "line", "intervalsMs", "speeds" ], "type": "object", "properties": { "index": { "type": "integer", "format": "int32" }, "id": { "type": [ "null", "integer" ], "format": "int64" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "distanceKm": { "type": "number", "format": "double" }, "pointCount": { "type": "integer", "format": "int32" }, "endLatitude": { "type": [ "null", "number" ], "format": "double" }, "endLongitude": { "type": [ "null", "number" ], "format": "double" }, "maxSpeedKmh": { "type": [ "null", "number" ], "format": "double" }, "avgMovingSpeedKmh": { "type": [ "null", "number" ], "format": "double" }, "movingSpeedSamples": { "type": "integer", "format": "int32" }, "line": { "type": "string" }, "intervalsMs": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "speeds": { "type": "array" }, "sources": { "type": [ "null", "array" ], "items": { "enum": [ "anchored", "manual", "phone", null ] } } }, "description": " A trip as TripDto serves it, with its fixes as three arrays instead of an object\n each: about half the size gzipped, for a map that shows up to 90 days of them. Opt-in\n (`?format=compact`), so a script reading the plain format is not affected.\n Fix i is at string CompactTripDto.Line's vertex i (an encoded polyline at\nint PolylineCodec.DefaultPrecision decimals, about 10 cm) and reported\nIReadOnlyList<double?> CompactTripDto.Speeds[i]. IReadOnlyList<long> CompactTripDto.IntervalsMs[i] is the milliseconds since the fix before\nit, or since DateTime CompactTripDto.StartedAt for the first, so a fix's time is their running total.\nIReadOnlyList<TripPointSource?>? CompactTripDto.Sources[i] is its TripPointSource? TripPoint.Source; the array is left out when every\npoint is a fix the car reported while driving, as almost every trip's are." } } ] } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/trips/latest": { "get": { "tags": [ "Trips" ], "summary": "Get the newest trip: the one being driven, or else the last one driven", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripDto" } } } }, "204": { "description": "No Content" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/trips/log": { "get": { "tags": [ "Trips" ], "summary": "Get the trip log: saved trips with their purpose, notes, odometer readings and addresses", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TripLogEntry" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/trips/{id}": { "put": { "tags": [ "Trips" ], "summary": "Record what a trip was for, and any notes", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripLogUpdateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripLogEntry" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/trips/purpose": { "post": { "tags": [ "Trips" ], "summary": "Set the purpose of several trips at once, leaving their notes alone", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripPurposeRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripPurposeResult" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/trips/{id}/hidden": { "put": { "tags": [ "Trips" ], "summary": "Hide a trip from the map, the statistics, the dashboard and the trip log's totals, or show it again", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripHiddenRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripLogEntry" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/trips/{id}/merge-next": { "post": { "tags": [ "Trips" ], "summary": "Join a trip with the saved trip after it, such as two trips a fuel stop split", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripLogEntry" } } } }, "404": { "description": "Not Found" }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/trips/{id}/editor": { "get": { "tags": [ "Trips" ], "summary": "Get what the route editor needs for a saved trip: its points, the points as recorded, and where the car stood before and after it", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripEditor" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/trips/{id}/points": { "put": { "tags": [ "Trips" ], "summary": "Replace a saved trip's route; its distance, ends and speed figures follow, the odometer readings stay", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripPointsRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripEditor" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/trips/{id}/points/reset": { "post": { "tags": [ "Trips" ], "summary": "Put a saved trip's route back as it was recorded", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripEditor" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/trips/places": { "post": { "tags": [ "Trips" ], "summary": "Look up the addresses at either end of trips, keeping them on the trips for good", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripPlacesRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripPlacesResult" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/push/vapid-public-key": { "get": { "tags": [ "Push Notifications" ], "summary": "Get VAPID public key for push subscription", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VapidPublicKeyResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/push/subscribe": { "post": { "tags": [ "Push Notifications" ], "summary": "Register a browser push subscription", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PushSubscribeRequest" } } }, "required": true }, "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/push/unsubscribe": { "post": { "tags": [ "Push Notifications" ], "summary": "Remove a push subscription", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PushUnsubscribeRequest" } } }, "required": true }, "responses": { "200": { "description": "OK" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/notifications": { "get": { "tags": [ "Notifications" ], "summary": "List non-deleted notifications (most recent first, default limit 100)", "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "format": "int32", "default": 100 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/NotificationDto" } } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "delete": { "tags": [ "Notifications" ], "summary": "Soft-delete all notifications", "responses": { "200": { "description": "OK" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/notifications/{id}/archive": { "patch": { "tags": [ "Notifications" ], "summary": "Archive a notification", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/notifications/{id}": { "delete": { "tags": [ "Notifications" ], "summary": "Soft-delete a notification", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/notifications/archive-all": { "patch": { "tags": [ "Notifications" ], "summary": "Archive all non-archived notifications", "responses": { "200": { "description": "OK" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/maintenance": { "get": { "tags": [ "Maintenance" ], "summary": "List maintenance items with computed due status", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MaintenanceItemDto" } } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "post": { "tags": [ "Maintenance" ], "summary": "Create a maintenance item", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateMaintenanceItemRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaintenanceItemDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/maintenance/{id}": { "put": { "tags": [ "Maintenance" ], "summary": "Update a maintenance item's name, notes and intervals", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMaintenanceItemRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaintenanceItemDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] }, "delete": { "tags": [ "Maintenance" ], "summary": "Delete a maintenance item and its service history", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/maintenance/{id}/log": { "get": { "tags": [ "Maintenance" ], "summary": "List service history for a maintenance item, newest first", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MaintenanceLogEntryDto" } } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "post": { "tags": [ "Maintenance" ], "summary": "Log a completed service, updating the item's baseline", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogMaintenanceServiceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogMaintenanceServiceResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/maintenance/{id}/log/{logId}": { "delete": { "tags": [ "Maintenance" ], "summary": "Remove a service log entry, recomputing the item's baseline", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "logId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaintenanceItemDto" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/climate-schedules": { "get": { "tags": [ "Climate schedules" ], "summary": "List climate schedules, earliest time of day first", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ClimateScheduleDto" } } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "post": { "tags": [ "Climate schedules" ], "summary": "Create a climate schedule", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClimateScheduleRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClimateScheduleDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/climate-schedules/{id}": { "put": { "tags": [ "Climate schedules" ], "summary": "Replace a climate schedule's settings, including whether it is switched on", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClimateScheduleRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClimateScheduleDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] }, "delete": { "tags": [ "Climate schedules" ], "summary": "Delete a climate schedule", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/commute-places": { "get": { "tags": [ "Commute places" ], "summary": "List the vehicle's home and work places, home first", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CommutePlaceDto" } } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "post": { "tags": [ "Commute places" ], "summary": "Add a home or work place, and label the trips between them as commutes", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommutePlaceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommutePlaceChange" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/commute-places/{id}": { "put": { "tags": [ "Commute places" ], "summary": "Move, rename or resize a home or work place, and re-label the trips", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommutePlaceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommutePlaceChange" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] }, "delete": { "tags": [ "Commute places" ], "summary": "Remove a home or work place, and re-label the trips", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommutePlaceChange" } } } }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/rdw": { "get": { "tags": [ "RDW" ], "summary": "The vehicle's plate and what the RDW last said about it", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RdwStatusDto" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/vehicles/{vin}/license-plate": { "put": { "tags": [ "RDW" ], "summary": "Set or clear the vehicle's Dutch plate, and look it up at the RDW right away", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LicensePlateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RdwStatusDto" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/phone-trackers": { "get": { "tags": [ "Dawarich" ], "summary": "List linked phone trackers and trackers seen in Dawarich during the last 30 days", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PhoneTrackersResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] }, "put": { "tags": [ "Dawarich" ], "summary": "Replace the vehicle's linked phone trackers; an empty set turns phone fusion off", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SavePhoneTrackersRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedPhoneTracker" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/vehicles/{vin}/phone-trackers/backfill": { "post": { "tags": [ "Dawarich" ], "summary": "Queue older unedited trips for phone fusion, from the supplied date until now", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PhoneBackfillRequestDto" } } }, "required": true }, "responses": { "202": { "description": "Accepted" }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/widget/{vin}/status": { "get": { "tags": [ "Widget" ], "summary": "Get latest vehicle status for Homepage widget (requires X-Widget-Key header)", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WidgetStatusDto" } } } }, "204": { "description": "No Content" }, "401": { "description": "Unauthorized" }, "404": { "description": "Not Found" }, "503": { "description": "Service Unavailable", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "widgetKey": [] } ], "x-codeSamples": [ { "source": "- GarageStack:\n href: https://YOUR_GARAGESTACK_URL\n description: MG Vehicle Status\n widget:\n type: customapi\n url: https://YOUR_GARAGESTACK_URL/api/widget/YOUR_VIN/status\n headers:\n X-Widget-Key: \"YOUR_WIDGET_API_KEY\"\n mappings:\n - field: evSocPercent\n label: Battery\n format: percent\n - field: isCharging\n label: Charging\n format: text\n - field: exteriorTemperature\n label: Ext. Temp\n format: float\n suffix: \"°C\"\n - field: isLocked\n label: Locked\n format: text", "label": "Homepage services.yaml" } ] } }, "/api/map/charging-stations": { "get": { "tags": [ "Map" ], "summary": "Get nearby EV charging stations from Open Charge Map", "parameters": [ { "name": "lat", "in": "query", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "lng", "in": "query", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "distanceKm", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "minPowerKw", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "maxPowerKw", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChargingStationDto" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/map/poi/brands": { "get": { "tags": [ "Map" ], "summary": "Get distinct brand names from the cached POI dataset", "parameters": [ { "name": "type", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "vehicleType", "in": "query", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/map/poi": { "get": { "tags": [ "Map" ], "summary": "Get nearby POIs (fuel stations, service areas, speed cameras) from OSM Overpass cache", "parameters": [ { "name": "type", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "lat", "in": "query", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "lng", "in": "query", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "radiusKm", "in": "query", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "vehicleType", "in": "query", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PoiResult" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] }, { "apiToken": [] } ], "x-badges": [ { "name": "Read-only token" } ] } }, "/api/map/reverse": { "post": { "tags": [ "Map" ], "summary": "Reverse geocode coordinates to street and city names via the OSM Nominatim cache", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReverseGeocodeRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReverseGeocodeResult" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/map/match": { "post": { "tags": [ "Map" ], "summary": "Snap a trip's GPS fixes onto OSM roads via the map matching cache", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MapMatchRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MapMatchResult" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ] } }, "/api/demo/status/{vin}": { "post": { "tags": [ "Demo" ], "summary": "Override demo vehicle status fields, as the Demo Controls panel does", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DemoStatusOverrideDto" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ], "x-badges": [ { "name": "Demo only" } ] } }, "/api/demo/gateway": { "post": { "tags": [ "Demo" ], "summary": "Make the demo gateway signed in to the MG account or not, as the Demo Controls panel does", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DemoGatewayDto" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Not signed in, or the API token is unknown or revoked." }, "403": { "description": "`token.readOnly`: An API token can only read; sign in to change anything.\n\n`csrf.originNotAllowed`: sent from a page on an address that is not CORS_ORIGIN.", "content": { "application/problem+json": { "schema": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } } } } }, "429": { "description": "Too many requests from this address; wait a minute and try again." } }, "security": [ { "session": [] } ], "x-badges": [ { "name": "Demo only" } ] } } }, "components": { "schemas": { "ApiReferenceStatus": { "required": [ "enabled" ], "type": "object", "properties": { "enabled": { "type": "boolean" } }, "description": "Whether this deployment serves the API reference page, for the link under the token settings." }, "ApiTokenDto": { "required": [ "id", "name", "prefix", "createdAt", "lastUsedAt" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "prefix": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "lastUsedAt": { "type": [ "null", "string" ], "format": "date-time" } } }, "AuthConfigResponse": { "required": [ "passwordLoginEnabled", "oidcEnabled", "oidcProviderName", "oidcAutoLogin" ], "type": "object", "properties": { "passwordLoginEnabled": { "type": "boolean" }, "oidcEnabled": { "type": "boolean" }, "oidcProviderName": { "type": [ "null", "string" ] }, "oidcAutoLogin": { "type": "boolean" } } }, "CalendarLinkDto": { "required": [ "exists", "createdAt", "lastUsedAt" ], "type": "object", "properties": { "exists": { "type": "boolean", "description": "Whether the account has one." }, "createdAt": { "type": [ "null", "string" ], "description": "When it was made.", "format": "date-time" }, "lastUsedAt": { "type": [ "null", "string" ], "description": "When a calendar app last fetched it, to the minute.", "format": "date-time" } }, "description": "The account's calendar link, as Settings shows it." }, "ChargeSession": { "required": [ "startedAt", "endedAt", "startSocPercent", "endSocPercent", "chargingType", "odometerKm", "latitude", "longitude", "startBatteryKwh", "endBatteryKwh", "batteryEnergyGainedKwh", "maxPowerKw" ], "type": "object", "properties": { "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": [ "null", "string" ], "format": "date-time" }, "startSocPercent": { "type": [ "null", "number" ], "format": "double" }, "endSocPercent": { "type": [ "null", "number" ], "format": "double" }, "chargingType": { "type": [ "null", "string" ] }, "odometerKm": { "type": [ "null", "number" ], "format": "double" }, "latitude": { "type": [ "null", "number" ], "format": "double" }, "longitude": { "type": [ "null", "number" ], "format": "double" }, "startBatteryKwh": { "type": [ "null", "number" ], "format": "double" }, "endBatteryKwh": { "type": [ "null", "number" ], "format": "double" }, "batteryEnergyGainedKwh": { "type": [ "null", "number" ], "format": "double" }, "maxPowerKw": { "type": [ "null", "number" ], "format": "double" } }, "description": "One charge, rebuilt from the telemetry rows around it. The battery kWh figures are the gateway's\ndrivetrain/soc_kwh as reported: MG's nominal 72.5 kWh pack scaled by the state of charge on\nanything but a BEV series the gateway knows, so the browser decides whether to show them.\nThe power curve is fetched separately (ChargeSessionPowerPoint), only for the\nsession someone opens." }, "ChargeSessionPowerPoint": { "required": [ "recordedAt", "powerKw" ], "type": "object", "properties": { "recordedAt": { "type": "string", "format": "date-time" }, "powerKw": { "type": "number", "format": "double" } } }, "ChargingStationDto": { "required": [ "id", "title", "latitude", "longitude", "addressLine", "town", "operator", "isOperational", "numberOfPoints", "connectors" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "title": { "type": "string" }, "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "addressLine": { "type": [ "null", "string" ] }, "town": { "type": [ "null", "string" ] }, "operator": { "type": [ "null", "string" ] }, "isOperational": { "type": [ "null", "boolean" ] }, "numberOfPoints": { "type": [ "null", "integer" ], "format": "int32" }, "connectors": { "type": "array", "items": { "$ref": "#/components/schemas/ConnectorDto" } } } }, "ClientErrorReport": { "required": [ "message", "stack", "page", "source" ], "type": "object", "properties": { "message": { "type": [ "null", "string" ], "description": "The error's message." }, "stack": { "type": [ "null", "string" ], "description": "Its stack trace, when the browser gave one." }, "page": { "type": [ "null", "string" ], "description": "The app's path when it happened, such as /map." }, "source": { "type": [ "null", "string" ], "description": "Where it came from: a script URL with line and column, or the Vue component." } } }, "ClimateScheduleDto": { "required": [ "id", "name", "enabled", "startTime", "days", "timeZoneId", "mode", "temperatureC", "rearDefroster", "seatLeftLevel", "seatRightLevel", "onlyBelowC", "onlyAboveC", "nextRunUtc", "lastRunAt", "lastRunOutcome", "lastRunFailedCommand", "lastRunDetail" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": [ "null", "string" ] }, "enabled": { "type": "boolean" }, "startTime": { "type": "string" }, "days": { "type": "array", "items": { "type": "integer", "format": "int32" } }, "timeZoneId": { "type": "string" }, "mode": { "$ref": "#/components/schemas/ClimateScheduleMode" }, "temperatureC": { "type": "integer", "format": "int32" }, "rearDefroster": { "type": "boolean" }, "seatLeftLevel": { "type": "integer", "format": "int32" }, "seatRightLevel": { "type": "integer", "format": "int32" }, "onlyBelowC": { "type": [ "null", "number" ], "format": "double" }, "onlyAboveC": { "type": [ "null", "number" ], "format": "double" }, "nextRunUtc": { "type": [ "null", "string" ], "format": "date-time" }, "lastRunAt": { "type": [ "null", "string" ], "format": "date-time" }, "lastRunOutcome": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ClimateScheduleOutcome" } ] }, "lastRunFailedCommand": { "type": [ "null", "string" ] }, "lastRunDetail": { "type": [ "null", "string" ] } } }, "ClimateScheduleMode": { "enum": [ "on", "blowingonly", "front" ], "description": "The climate mode a schedule starts. Each name is the value the gateway takes for it." }, "ClimateScheduleOutcome": { "enum": [ "running", "started", "failed", "unconfirmed", "skippedDriving", "skippedTemperature", "missed", null ] }, "ClimateScheduleRequest": { "required": [ "name", "enabled", "startTime", "days", "timeZoneId", "mode", "temperatureC", "rearDefroster", "seatLeftLevel", "seatRightLevel", "onlyBelowC", "onlyAboveC" ], "type": "object", "properties": { "name": { "type": [ "null", "string" ] }, "enabled": { "type": "boolean" }, "startTime": { "type": "string" }, "days": { "type": [ "null", "array" ], "items": { "type": "integer", "format": "int32" } }, "timeZoneId": { "type": "string" }, "mode": { "$ref": "#/components/schemas/ClimateScheduleMode" }, "temperatureC": { "type": "integer", "format": "int32" }, "rearDefroster": { "type": "boolean" }, "seatLeftLevel": { "type": "integer", "format": "int32" }, "seatRightLevel": { "type": "integer", "format": "int32" }, "onlyBelowC": { "type": [ "null", "number" ], "format": "double" }, "onlyAboveC": { "type": [ "null", "number" ], "format": "double" } }, "description": "A schedule's settings. StartTime is the time of day as HH:mm in TimeZoneId (an IANA time zone,\nsuch as Europe/Amsterdam); Days are ISO weekday numbers (Monday 1 to Sunday 7), and none runs\nthe schedule once." }, "CommutePlaceChange": { "required": [ "place", "marked", "cleared" ], "type": "object", "properties": { "place": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/CommutePlaceDto" } ] }, "marked": { "type": "integer", "format": "int32" }, "cleared": { "type": "integer", "format": "int32" } }, "description": "The place as saved (null once removed), and how many trips the change marked and unmarked as commutes." }, "CommutePlaceDto": { "required": [ "id", "kind", "label", "latitude", "longitude", "radiusMeters", "notify" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "kind": { "$ref": "#/components/schemas/CommutePlaceKind" }, "label": { "type": [ "null", "string" ] }, "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "radiusMeters": { "type": "integer", "format": "int32" }, "notify": { "type": "boolean" } } }, "CommutePlaceKind": { "enum": [ "home", "work" ] }, "CommutePlaceRequest": { "required": [ "kind", "label", "latitude", "longitude", "radiusMeters" ], "type": "object", "properties": { "kind": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/CommutePlaceKind" } ] }, "label": { "type": [ "null", "string" ] }, "latitude": { "type": [ "null", "number" ], "format": "double" }, "longitude": { "type": [ "null", "number" ], "format": "double" }, "radiusMeters": { "type": [ "null", "integer" ], "format": "int32" }, "notify": { "type": [ "null", "boolean" ] } }, "description": "`Notify`: whether reaching or leaving the place sends a notification; left out, it stays as it was." }, "ConnectorDto": { "required": [ "type", "powerKw", "quantity" ], "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "powerKw": { "type": [ "null", "number" ], "format": "double" }, "quantity": { "type": [ "null", "integer" ], "format": "int32" } } }, "CreateApiTokenRequest": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": [ "null", "string" ] } } }, "CreatedApiTokenDto": { "required": [ "details", "token" ], "type": "object", "properties": { "details": { "$ref": "#/components/schemas/ApiTokenDto" }, "token": { "type": "string" } }, "description": "A token just made: Token is shown this once and never again." }, "CreatedCalendarLinkDto": { "required": [ "details", "token" ], "type": "object", "properties": { "details": { "description": "What Settings shows of it from now on.", "$ref": "#/components/schemas/CalendarLinkDto" }, "token": { "type": "string", "description": "The token for the feed's address, shown this once and never again." } }, "description": "A calendar link just made." }, "CreateMaintenanceItemRequest": { "required": [ "name", "notes", "intervalKm", "intervalMonths", "lastServiceDate", "lastServiceOdometerKm" ], "type": "object", "properties": { "name": { "type": "string" }, "notes": { "type": [ "null", "string" ] }, "intervalKm": { "type": [ "null", "number" ], "format": "double" }, "intervalMonths": { "type": [ "null", "integer" ], "format": "int32" }, "lastServiceDate": { "type": [ "null", "string" ], "format": "date-time" }, "lastServiceOdometerKm": { "type": [ "null", "number" ], "format": "double" } } }, "DailyStat": { "required": [ "date", "evSocPercent", "fuelLevelPercent", "tyrePressureFrontLeft", "tyrePressureFrontRight", "tyrePressureRearLeft", "tyrePressureRearRight", "batteryVoltage", "counterTotal" ], "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "evSocPercent": { "type": [ "null", "number" ], "format": "double" }, "fuelLevelPercent": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureFrontLeft": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureFrontRight": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureRearLeft": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureRearRight": { "type": [ "null", "number" ], "format": "double" }, "batteryVoltage": { "type": [ "null", "number" ], "format": "double" }, "counterTotal": { "type": [ "null", "number" ], "format": "double" }, "sinceChargeTotal": {}, "counterUnbacked": { "type": "boolean", "default": false }, "distanceKm": {} }, "description": "One local day for the statistics page: the averages of what the car reported that day, and the\nday's total off its energy counter. A value is null when the car reported none of it that day.\n`CounterTotal` is in the counter's own unit: kWh out of the traction battery on a plug-in\ncar, hundredths of a litre of fuel on a plain hybrid (see the frontend's utils/energy).\n`SinceChargeTotal` is the same day read off the since-last-charge counter instead, and\n`CounterUnbacked` says the day counter rose more than that counter allows, which is how\na car whose day counter cannot be trusted shows itself (issue #551). The frontend decides\nwhich of the two to show, because only it knows whether the car plugs in.\n`DistanceKm` is the day's total off the car's distance-of-the-day counter, read the same\nway as `CounterTotal`, so the two pair up into an efficiency for the same stretch of driving." }, "DawarichStatusResponse": { "required": [ "configured", "status" ], "type": "object", "properties": { "configured": { "type": "boolean" }, "status": { "type": "string" } }, "description": "Deployment configuration and a credential check, never the URL or key." }, "DemoGatewayDto": { "required": [ "signedIn" ], "type": "object", "properties": { "signedIn": { "type": "boolean", "description": "False plays a failed sign-in, true a good one." } }, "description": "What the demo gateway should say about its MG sign-in." }, "DemoStatusOverrideDto": { "required": [ "isLocked", "engineRunning", "climateOn", "driverDoorOpen", "passengerDoorOpen", "rearLeftDoorOpen", "rearRightDoorOpen", "trunkOpen", "bonnetOpen", "driverWindowOpen", "passengerWindowOpen", "rearLeftWindowOpen", "rearRightWindowOpen", "chargerConnected", "isCharging", "lightsMainBeam", "lightsDippedBeam", "lightsSide", "evSocPercent", "interiorTemperature", "exteriorTemperature", "speed" ], "type": "object", "properties": { "isLocked": { "type": [ "null", "boolean" ] }, "engineRunning": { "type": [ "null", "boolean" ] }, "climateOn": { "type": [ "null", "boolean" ] }, "driverDoorOpen": { "type": [ "null", "boolean" ] }, "passengerDoorOpen": { "type": [ "null", "boolean" ] }, "rearLeftDoorOpen": { "type": [ "null", "boolean" ] }, "rearRightDoorOpen": { "type": [ "null", "boolean" ] }, "trunkOpen": { "type": [ "null", "boolean" ] }, "bonnetOpen": { "type": [ "null", "boolean" ] }, "driverWindowOpen": { "type": [ "null", "boolean" ] }, "passengerWindowOpen": { "type": [ "null", "boolean" ] }, "rearLeftWindowOpen": { "type": [ "null", "boolean" ] }, "rearRightWindowOpen": { "type": [ "null", "boolean" ] }, "chargerConnected": { "type": [ "null", "boolean" ] }, "isCharging": { "type": [ "null", "boolean" ] }, "lightsMainBeam": { "type": [ "null", "boolean" ] }, "lightsDippedBeam": { "type": [ "null", "boolean" ] }, "lightsSide": { "type": [ "null", "boolean" ] }, "evSocPercent": { "type": [ "null", "number" ], "format": "double" }, "interiorTemperature": { "type": [ "null", "number" ], "format": "double" }, "exteriorTemperature": { "type": [ "null", "number" ], "format": "double" }, "speed": { "type": [ "null", "number" ], "format": "double" }, "isAvailable": { "type": [ "null", "boolean" ] } } }, "GatewayStatus": { "required": [ "signedIn" ], "type": "object", "properties": { "signedIn": { "type": [ "null", "boolean" ], "description": "True while it is; false after a failed sign-in, until the next good one (it tries again every\nfifteen minutes); null while the gateway has not said, or the Worker is older than this answer." } }, "description": "Whether the SAIC gateway is signed in to the MG account." }, "GeoPoint": { "required": [ "lat", "lng" ], "type": "object", "properties": { "lat": { "type": "number", "format": "double" }, "lng": { "type": "number", "format": "double" } } }, "JsonElement": {}, "LicensePlateRequest": { "required": [ "licensePlate" ], "type": "object", "properties": { "licensePlate": { "type": [ "null", "string" ] } } }, "LinkedPhoneTracker": { "required": [ "trackerId", "createdAt" ], "type": "object", "properties": { "trackerId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "description": "Linked tracker identifiers only. No credentials or phone positions." }, "LogEntry": { "required": [ "time", "level", "source", "message", "exception" ], "type": "object", "properties": { "time": { "type": "string", "format": "date-time" }, "level": { "$ref": "#/components/schemas/LogLevelName" }, "source": { "type": "string" }, "message": { "type": "string" }, "exception": { "type": [ "null", "string" ] }, "id": { "type": "string", "description": "Where the entry starts: unique, and the same on every read, so the log viewer keys its list on it." } }, "description": "One log entry: when, how bad, which service, what it said, and an exception's lines if any." }, "LoginRequest": { "required": [ "username", "password" ], "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string" }, "rememberMe": { "type": "boolean", "default": false } } }, "LoginResponse": { "required": [ "username", "expiresAtUtc" ], "type": "object", "properties": { "username": { "type": "string" }, "expiresAtUtc": { "type": "string", "format": "date-time" } } }, "LogLevelName": { "enum": [ "Verbose", "Debug", "Information", "Warning", "Error", "Fatal" ] }, "LogMaintenanceServiceRequest": { "required": [ "performedAt", "odometerKm", "notes" ], "type": "object", "properties": { "performedAt": { "type": "string", "format": "date-time" }, "odometerKm": { "type": [ "null", "number" ], "format": "double" }, "notes": { "type": [ "null", "string" ] } } }, "LogMaintenanceServiceResponse": { "required": [ "item", "logEntry" ], "type": "object", "properties": { "item": { "$ref": "#/components/schemas/MaintenanceItemDto" }, "logEntry": { "$ref": "#/components/schemas/MaintenanceLogEntryDto" } } }, "LogPageDto": { "required": [ "entries", "sources", "older", "newer", "reset" ], "type": "object", "properties": { "entries": { "type": "array", "items": { "$ref": "#/components/schemas/LogEntry" } }, "sources": { "type": "array", "items": { "$ref": "#/components/schemas/LogSourceDto" } }, "older": { "type": [ "null", "string" ] }, "newer": { "type": [ "null", "string" ] }, "reset": { "type": "boolean" } }, "description": "A page of entries, newest first. Older goes back as `before` for the page after it, null\nonce nothing older is left; Newer goes back as `after` for what is written since. Reset\nsays the entries replace the list rather than extend it: a first page, or a live read that\nfound more than a page." }, "LogSourceDto": { "required": [ "name", "available" ], "type": "object", "properties": { "name": { "type": "string" }, "available": { "type": "boolean" } }, "description": "A log source and whether the API can read its files." }, "MaintenanceItemDto": { "required": [ "id", "vehicleId", "name", "notes", "intervalKm", "intervalMonths", "lastServiceDate", "lastServiceOdometerKm", "dueStatus", "nextDueDate", "nextDueOdometerKm", "daysRemaining", "kmRemaining", "createdAt" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "vehicleId": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "notes": { "type": [ "null", "string" ] }, "intervalKm": { "type": [ "null", "number" ], "format": "double" }, "intervalMonths": { "type": [ "null", "integer" ], "format": "int32" }, "lastServiceDate": { "type": [ "null", "string" ], "format": "date-time" }, "lastServiceOdometerKm": { "type": [ "null", "number" ], "format": "double" }, "dueStatus": { "type": "string" }, "nextDueDate": { "type": [ "null", "string" ], "format": "date-time" }, "nextDueOdometerKm": { "type": [ "null", "number" ], "format": "double" }, "daysRemaining": { "type": [ "null", "integer" ], "format": "int32" }, "kmRemaining": { "type": [ "null", "number" ], "format": "double" }, "createdAt": { "type": "string", "format": "date-time" } } }, "MaintenanceLogEntryDto": { "required": [ "id", "maintenanceItemId", "performedAt", "odometerKm", "notes", "createdAt" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "maintenanceItemId": { "type": "integer", "format": "int32" }, "performedAt": { "type": "string", "format": "date-time" }, "odometerKm": { "type": [ "null", "number" ], "format": "double" }, "notes": { "type": [ "null", "string" ] }, "createdAt": { "type": "string", "format": "date-time" } } }, "MapMatchRequest": { "required": [ "points" ], "type": "object", "properties": { "points": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/GeoPoint" }, "description": "The trip's fixes in the order they were recorded, at most\nint MapMatchDefaults.MaxPointsPerRequest of them. A client with a denser trip thins\nit first: the snapped line gains nothing from fixes closer together than the screen can show." } } }, "MapMatchResult": { "required": [ "available", "matched", "pending", "shape", "pointIndexes", "matchedKm", "speedLimits" ], "type": "object", "properties": { "available": { "type": "boolean", "description": "False when matching is switched off for this deployment, so a client can stop asking." }, "matched": { "type": "boolean", "description": "True when Shape holds a snapped line to draw instead of the raw fixes." }, "pending": { "type": "boolean", "description": "True when the matcher could not be reached just now and a later request may succeed." }, "shape": { "type": [ "null", "string" ], "description": "The snapped line as an encoded polyline (six decimals)." }, "pointIndexes": { "type": [ "null", "array" ], "items": { "type": "integer", "format": "int32" }, "description": "One vertex index into Shape per fix that was sent, in order." }, "matchedKm": { "type": "number", "description": "Length of the snapped line, which beats the straight-line distance through the fixes.", "format": "double" }, "speedLimits": { "type": [ "null", "array" ], "items": { "type": "integer", "format": "int32" }, "description": "The limits along Shape as run-length pairs (segment count, km/h), where a\nlimit of 0 covers a stretch OSM has no `maxspeed` for. Empty when none of the roads the\ntrip ran over carry one." } }, "description": "A trip's snapped line, or the reason there is none." }, "MeResponse": { "required": [ "username", "expiresAtUtc" ], "type": "object", "properties": { "username": { "type": "string" }, "expiresAtUtc": { "type": [ "null", "string" ], "format": "date-time" } } }, "NotificationDto": { "required": [ "id", "title", "body", "createdAt", "isArchived", "category", "vehicleId" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "title": { "type": "string" }, "body": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "isArchived": { "type": "boolean" }, "category": { "type": [ "null", "string" ] }, "vehicleId": { "type": [ "null", "integer" ], "format": "int32" } } }, "PhoneBackfillRequestDto": { "required": [ "from" ], "type": "object", "properties": { "from": { "type": [ "null", "string" ], "format": "date-time" } }, "description": "The earliest date to consider for an explicit historical backfill." }, "PhoneTracker": { "required": [ "trackerId", "lastSeenAt" ], "type": "object", "properties": { "trackerId": { "type": "string" }, "lastSeenAt": { "type": "string", "format": "date-time" } }, "description": "A tracker observed in Dawarich, without any of its positions." }, "PhoneTrackersResponse": { "required": [ "linked", "available", "error" ], "type": "object", "properties": { "linked": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedPhoneTracker" } }, "available": { "type": "array", "items": { "$ref": "#/components/schemas/PhoneTracker" } }, "error": { "type": [ "null", "string" ] } }, "description": "Linked tracker identifiers and available trackers, with an explicit discovery error when unavailable." }, "PlaceAddress": { "required": [ "displayName", "road", "houseNumber", "city", "postcode", "countryCode" ], "type": "object", "properties": { "displayName": { "type": [ "null", "string" ] }, "road": { "type": [ "null", "string" ] }, "houseNumber": { "type": [ "null", "string" ] }, "city": { "type": [ "null", "string" ] }, "postcode": { "type": [ "null", "string" ] }, "countryCode": { "type": [ "null", "string" ] } }, "description": "A place as reverse geocoding knows it: the parts a caller may want to compose into a label,\nnever a pre-formatted string, so the frontend decides how an address reads per locale.\n`City` is the most specific settlement name (city, town, village or hamlet) and\n`DisplayName` the upstream's own full label, a fallback for when the parts are thin." }, "PlaceDto": { "required": [ "road", "houseNumber", "city", "postcode", "countryCode", "displayName" ], "type": "object", "properties": { "road": { "type": [ "null", "string" ] }, "houseNumber": { "type": [ "null", "string" ] }, "city": { "type": [ "null", "string" ] }, "postcode": { "type": [ "null", "string" ] }, "countryCode": { "type": [ "null", "string" ] }, "displayName": { "type": [ "null", "string" ] } }, "description": "A resolved place. All-null fields mean upstream knows no place at that coordinate, which is\ndifferent from the null entry a ReverseGeocodeResult carries for one it has not\nmanaged to look up yet." }, "PoiItemDto": { "required": [ "externalId", "poiType", "latitude", "longitude", "name", "tags" ], "type": "object", "properties": { "externalId": { "type": "string" }, "poiType": { "type": "string" }, "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "name": { "type": [ "null", "string" ] }, "tags": { "type": [ "null", "object" ], "additionalProperties": { "type": "string" } } } }, "PoiResult": { "required": [ "items", "hasMore" ], "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PoiItemDto" }, "description": "The POIs within the requested bounds that are already cached." }, "hasMore": { "type": "boolean", "description": "Uncached tiles remain in this viewport, so asking again brings more." }, "available": { "type": "boolean", "description": "False only when the deployment does not serve this layer at all, which tells the client to\nstop offering it rather than to ask again.", "default": true } } }, "PowerTailgateSetting": { "required": [ "enabled" ], "type": "object", "properties": { "enabled": { "type": "boolean" } }, "description": "Whether the vehicle has a power tailgate. See bool Vehicle.HasPowerTailgate." }, "ProblemDetails": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] }, "code": { "type": "string", "description": "Why, as a code that stays the same between releases, such as trip.changed. detail says it in English." } } }, "PushSubscribeRequest": { "required": [ "endpoint", "p256DhKey", "authKey" ], "type": "object", "properties": { "endpoint": { "type": "string" }, "p256DhKey": { "type": "string" }, "authKey": { "type": "string" }, "excludedCategories": { "type": [ "null", "array" ], "items": { "type": "string" } } } }, "PushUnsubscribeRequest": { "required": [ "endpoint" ], "type": "object", "properties": { "endpoint": { "type": "string" } } }, "RdwInfoDto": { "required": [ "found", "make", "model", "apkExpiresOn", "apkDaysLeft", "wamInsured", "openRecallIndicator", "recalls", "fetchedAt", "lastError" ], "type": "object", "properties": { "found": { "type": "boolean" }, "make": { "type": [ "null", "string" ] }, "model": { "type": [ "null", "string" ] }, "apkExpiresOn": { "type": [ "null", "string" ], "format": "date" }, "apkDaysLeft": { "type": [ "null", "integer" ], "format": "int32" }, "wamInsured": { "type": [ "null", "boolean" ] }, "openRecallIndicator": { "type": [ "null", "boolean" ] }, "recalls": { "type": "array", "items": { "$ref": "#/components/schemas/RdwRecallDto" } }, "fetchedAt": { "type": [ "null", "string" ], "format": "date-time" }, "lastError": { "type": [ "null", "string" ] } }, "description": "What the RDW said. bool RdwInfoDto.Found false means it knows no vehicle by the plate.\nDateTime? RdwInfoDto.FetchedAt is the last answer, string? RdwInfoDto.LastError why the attempt after it failed." }, "RdwRecallDto": { "required": [ "code", "open", "defect", "risk", "repair", "severity", "firstSeenAt" ], "type": "object", "properties": { "code": { "type": "string" }, "open": { "type": "boolean" }, "defect": { "type": [ "null", "string" ] }, "risk": { "type": [ "null", "string" ] }, "repair": { "type": [ "null", "string" ] }, "severity": { "type": [ "null", "string" ] }, "firstSeenAt": { "type": "string", "format": "date-time" } }, "description": "A recall, open or repaired; the texts are the RDW's, in Dutch." }, "RdwStatusDto": { "required": [ "licensePlate", "info" ], "type": "object", "properties": { "licensePlate": { "type": [ "null", "string" ] }, "info": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/RdwInfoDto" } ] } }, "description": "The plate (null when none is set) and the lookup for it (null until there is one)." }, "ReverseGeocodeRequest": { "required": [ "points", "precision", "language" ], "type": "object", "properties": { "points": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/GeoPoint" }, "description": "Coordinates to resolve, at most int GeocodeDefaults.MaxPointsPerRequest of them." }, "precision": { "type": [ "null", "string" ], "description": "\"city\" for a settlement name (trip list), \"address\" for street level (parked car)." }, "language": { "type": [ "null", "string" ], "description": "Language for the place names; anything unsupported falls back to English." } } }, "ReverseGeocodeResult": { "required": [ "results", "available", "hasMore" ], "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/PlaceDto" }, "description": "One entry per requested point, in the same order; null where unresolved." }, "available": { "type": "boolean", "description": "False when geocoding is switched off for this deployment, so a client can stop asking." }, "hasMore": { "type": "boolean", "description": "True while some points are still unresolved and a later request may fill them in." } } }, "SavePhoneTrackersRequest": { "required": [ "trackerIds" ], "type": "object", "properties": { "trackerIds": { "type": [ "null", "array" ], "items": { "type": "string" } } }, "description": "The full set of trackers linked to one vehicle." }, "Stream": { "type": "string", "format": "binary" }, "TelemetrySnapshot": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "vehicleId": { "type": "integer", "format": "int32" }, "vehicle": { "$ref": "#/components/schemas/Vehicle" }, "recordedAt": { "type": "string", "format": "date-time" }, "fuelLevelPercent": { "type": [ "null", "number" ], "format": "double" }, "fuelRangeKm": { "type": [ "null", "number" ], "format": "double" }, "odometerKm": { "type": [ "null", "number" ], "format": "double" }, "isLocked": { "type": [ "null", "boolean" ] }, "engineRunning": { "type": [ "null", "boolean" ] }, "climateOn": { "type": [ "null", "boolean" ] }, "climateMode": { "type": [ "null", "string" ] }, "driverDoorOpen": { "type": [ "null", "boolean" ] }, "passengerDoorOpen": { "type": [ "null", "boolean" ] }, "rearLeftDoorOpen": { "type": [ "null", "boolean" ] }, "rearRightDoorOpen": { "type": [ "null", "boolean" ] }, "trunkOpen": { "type": [ "null", "boolean" ] }, "bonnetOpen": { "type": [ "null", "boolean" ] }, "driverWindowOpen": { "type": [ "null", "boolean" ] }, "passengerWindowOpen": { "type": [ "null", "boolean" ] }, "rearLeftWindowOpen": { "type": [ "null", "boolean" ] }, "rearRightWindowOpen": { "type": [ "null", "boolean" ] }, "latitude": { "type": [ "null", "number" ], "format": "double" }, "longitude": { "type": [ "null", "number" ], "format": "double" }, "speed": { "type": [ "null", "number" ], "format": "double" }, "heading": { "type": [ "null", "number" ], "format": "double" }, "batteryVoltage": { "type": [ "null", "number" ], "format": "double" }, "interiorTemperature": { "type": [ "null", "number" ], "format": "double" }, "exteriorTemperature": { "type": [ "null", "number" ], "format": "double" }, "evSocPercent": { "type": [ "null", "number" ], "format": "double" }, "electricRangeKm": { "type": [ "null", "number" ], "format": "double" }, "isCharging": { "type": [ "null", "boolean" ] }, "sunRoofOpen": { "type": [ "null", "boolean" ] }, "tyrePressureFrontLeft": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureFrontRight": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureRearLeft": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureRearRight": { "type": [ "null", "number" ], "format": "double" }, "mileageOfTheDay": { "type": [ "null", "number" ], "format": "double" }, "powerUsageOfDay": { "type": [ "null", "number" ], "format": "double" }, "mileageSinceLastCharge": { "type": [ "null", "number" ], "format": "double" }, "hvVoltage": { "type": [ "null", "number" ], "format": "double" }, "hvCurrent": { "type": [ "null", "number" ], "format": "double" }, "hvPower": { "type": [ "null", "number" ], "format": "double" }, "hvSocKwh": { "type": [ "null", "number" ], "format": "double" }, "hvTotalCapacityKwh": { "type": [ "null", "number" ], "format": "double" }, "powerUsageSinceLastCharge": { "type": [ "null", "number" ], "format": "double" }, "chargerConnected": { "type": [ "null", "boolean" ] }, "hvBatteryActive": { "type": [ "null", "boolean" ] }, "lightsMainBeam": { "type": [ "null", "boolean" ] }, "lightsDippedBeam": { "type": [ "null", "boolean" ] }, "lightsSide": { "type": [ "null", "boolean" ] }, "remoteTemperature": { "type": [ "null", "number" ], "format": "double" }, "heatedSeatFrontLeft": { "type": [ "null", "integer" ], "format": "int32" }, "heatedSeatFrontRight": { "type": [ "null", "integer" ], "format": "int32" }, "rearWindowDefroster": { "type": [ "null", "boolean" ] }, "isAvailable": { "type": [ "null", "boolean" ] }, "lastVehicleStateAt": { "type": [ "null", "string" ], "format": "date-time" }, "lastChargeStateAt": { "type": [ "null", "string" ], "format": "date-time" }, "currentJourneyDistance": { "type": [ "null", "number" ], "format": "double" }, "chargingType": { "type": [ "null", "string" ] }, "chargingCableLock": { "type": [ "null", "boolean" ] }, "remainingChargingTime": { "type": [ "null", "integer" ], "format": "int32" }, "bmsChargeStatus": { "type": [ "null", "string" ] }, "onboardChargerPlugStatus": { "type": [ "null", "integer" ], "format": "int32" }, "offboardChargerPlugStatus": { "type": [ "null", "integer" ], "format": "int32" }, "lastChargeEndingPower": { "type": [ "null", "number" ], "format": "double" }, "chargingLastStartAt": { "type": [ "null", "string" ], "format": "date-time" }, "chargingLastEndAt": { "type": [ "null", "string" ], "format": "date-time" }, "chargingStopReason": { "type": [ "null", "string" ] }, "socTargetPercent": { "type": [ "null", "integer" ], "format": "int32" }, "chargeCurrentLimit": { "type": [ "null", "string" ] }, "chargingScheduleMode": { "type": [ "null", "string" ] }, "chargingScheduleStartTime": { "type": [ "null", "string" ] }, "chargingScheduleEndTime": { "type": [ "null", "string" ] }, "obcCurrent": { "type": [ "null", "number" ], "format": "double" }, "obcVoltage": { "type": [ "null", "number" ], "format": "double" }, "obcPowerSinglePhase": { "type": [ "null", "number" ], "format": "double" }, "obcPowerThreePhase": { "type": [ "null", "number" ], "format": "double" }, "batteryHeating": { "type": [ "null", "boolean" ] }, "batteryHeatingScheduleMode": { "type": [ "null", "string" ] }, "batteryHeatingScheduleStartTime": { "type": [ "null", "string" ] }, "elevation": { "type": [ "null", "number" ], "format": "double" } } }, "TripDto": { "required": [ "index", "startedAt", "endedAt", "distanceKm", "pointCount", "points" ], "type": "object", "properties": { "index": { "type": "integer", "format": "int32" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "distanceKm": { "type": "number", "format": "double" }, "pointCount": { "type": "integer", "format": "int32" }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/TripPoint" } }, "id": { "type": [ "null", "integer" ], "format": "int64" }, "endLatitude": { "type": [ "null", "number" ], "description": "Where the trip ended, or null for a trip without fixes.", "format": "double" }, "endLongitude": { "type": [ "null", "number" ], "format": "double" }, "maxSpeedKmh": { "type": [ "null", "number" ], "description": "The highest speed any fix reported, or null when none carried a speed.", "format": "double" }, "avgMovingSpeedKmh": { "type": [ "null", "number" ], "description": "The mean of the speeds reported while moving, or null when none was.", "format": "double" }, "movingSpeedSamples": { "type": "integer", "description": "How many fixes reported a speed while moving: the weight to give\ndouble? TripDto.AvgMovingSpeedKmh when averaging over several trips.", "format": "int32" } }, "description": "A trip as the Api serves it. Id is the saved trip's id, or null for a trip\nthe Worker has not saved yet, such as the one being driven. The summary figures are read off\nPoints, so a client that needs only those can ask for\nTripSummaryDto instead and skip the fixes." }, "TripEditor": { "required": [ "id", "points", "originalPoints", "editedAt", "previousStop", "nextStop", "suggestion", "notBefore", "notAfter", "maxPoints" ], "type": "object", "properties": { "id": { "type": "integer", "description": "The saved trip's id.", "format": "int64" }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/TripPoint" }, "description": "The trip's points as they are now." }, "originalPoints": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/TripPoint" }, "description": "The points as recorded, when the trip was edited; null otherwise." }, "editedAt": { "type": [ "null", "string" ], "description": "When the route was last edited, or null when it is as recorded.", "format": "date-time" }, "previousStop": { "oneOf": [ { "type": "null" }, { "description": "Where the car stood before the trip, or null when nothing says.", "$ref": "#/components/schemas/TripStop" } ] }, "nextStop": { "oneOf": [ { "type": "null" }, { "description": "Where the car stood after it, or null when nothing says.", "$ref": "#/components/schemas/TripStop" } ] }, "suggestion": { "type": "boolean", "description": "Whether PreviousStop is far enough from the start, and near enough, that the\ntrip probably left from there: a trip saved before trips were anchored, which one tap can fix." }, "notBefore": { "type": [ "null", "string" ], "description": "The end of the trip before it: no point may be earlier.", "format": "date-time" }, "notAfter": { "type": [ "null", "string" ], "description": "The start of the trip after it, or the recording line: no point may be later.", "format": "date-time" }, "maxPoints": { "type": "integer", "description": "The most points a save may send.", "format": "int32" } }, "description": "What the trip editor needs to edit a saved trip's route." }, "TripHiddenRequest": { "required": [ "hidden" ], "type": "object", "properties": { "hidden": { "type": [ "null", "boolean" ] } } }, "TripLogEntry": { "required": [ "id", "startedAt", "endedAt", "distanceKm", "startLatitude", "startLongitude", "endLatitude", "endLongitude", "odometerStartKm", "odometerEndKm", "startPlace", "endPlace", "purpose", "notes" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time" }, "distanceKm": { "type": "number", "format": "double" }, "startLatitude": { "type": "number", "format": "double" }, "startLongitude": { "type": "number", "format": "double" }, "endLatitude": { "type": "number", "format": "double" }, "endLongitude": { "type": "number", "format": "double" }, "odometerStartKm": { "type": [ "null", "number" ], "format": "double" }, "odometerEndKm": { "type": [ "null", "number" ], "format": "double" }, "startPlace": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PlaceAddress" } ] }, "endPlace": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PlaceAddress" } ] }, "purpose": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/TripPurpose" } ] }, "notes": { "type": [ "null", "string" ] }, "purposeIsAutomatic": { "type": "boolean", "default": false }, "isHidden": { "type": "boolean", "default": false }, "isEdited": { "type": "boolean", "default": false }, "maxSpeedKmh": {}, "avgMovingSpeedKmh": {}, "phoneFusionAt": { "type": [ "null", "string" ], "format": "date-time" } }, "description": "One line of the trip log: a saved trip without its fixes, plus what the driver recorded about\nit. A place is null until it has been looked up." }, "TripLogUpdateRequest": { "required": [ "purpose", "notes" ], "type": "object", "properties": { "purpose": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/TripPurpose" } ] }, "notes": { "type": [ "null", "string" ] } } }, "TripPlaces": { "required": [ "id", "startPlace", "endPlace" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "startPlace": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PlaceAddress" } ] }, "endPlace": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PlaceAddress" } ] } }, "description": "The places now known for one trip. Either may still be null when it is not resolved yet." }, "TripPlacesRequest": { "required": [ "ids", "language" ], "type": "object", "properties": { "ids": { "type": [ "null", "array" ], "items": { "type": "integer", "format": "int64" } }, "language": { "type": [ "null", "string" ] } } }, "TripPlacesResult": { "required": [ "trips", "available", "hasMore" ], "type": "object", "properties": { "trips": { "type": "array", "items": { "$ref": "#/components/schemas/TripPlaces" }, "description": "The places now known for each requested trip; a place still null is not resolved yet." }, "available": { "type": "boolean", "description": "False when geocoding is switched off for this deployment, so a client can stop asking." }, "hasMore": { "type": "boolean", "description": "True while some ends are still unresolved and a later request may fill them in." } } }, "TripPoint": { "required": [ "recordedAt", "latitude", "longitude", "speed" ], "type": "object", "properties": { "recordedAt": { "type": "string", "format": "date-time" }, "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "speed": { "type": [ "null", "number" ], "format": "double" }, "source": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/TripPointSource" } ] } }, "description": "A position on a trip's path. Source is null for a fix the car reported as it\ndrove, and otherwise says why the point is there: left out of the JSON when null, so the trips\nsaved before it existed read the same." }, "TripPointInput": { "required": [ "recordedAt", "latitude", "longitude" ], "type": "object", "properties": { "recordedAt": { "type": [ "null", "string" ], "format": "date-time" }, "latitude": { "type": [ "null", "number" ], "format": "double" }, "longitude": { "type": [ "null", "number" ], "format": "double" } }, "description": "A point as the trip editor sends it: where, and when. The server decides its speed and\nTripPointSource? TripPoint.Source, so a client cannot pass a point it placed off as one the car\nreported. Every field is nullable so a missing one is a validation error, not a binding failure." }, "TripPointSource": { "enum": [ "anchored", "manual", "phone", null ] }, "TripPointsRequest": { "required": [ "points" ], "type": "object", "properties": { "points": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/TripPointInput" } } } }, "TripPurpose": { "enum": [ "business", "commute", "private", null ] }, "TripPurposeRequest": { "required": [ "ids", "purpose" ], "type": "object", "properties": { "ids": { "type": [ "null", "array" ], "items": { "type": "integer", "format": "int64" } }, "purpose": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/TripPurpose" } ] } } }, "TripPurposeResult": { "required": [ "changed" ], "type": "object", "properties": { "changed": { "type": "integer", "format": "int32" } } }, "TripStop": { "required": [ "latitude", "longitude", "recordedAt", "suggestedAt" ], "type": "object", "properties": { "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "recordedAt": { "type": "string", "format": "date-time" }, "suggestedAt": { "type": "string", "format": "date-time" } }, "description": "Where the car stood before or after a trip: a parked fix, or the neighbouring trip's end.\nSuggestedAt is the time to give a point placed there: when the car left it,\nor when it got there." }, "TyreChanges": { "required": [ "frontLeft", "frontRight", "rearLeft", "rearRight", "days" ], "type": "object", "properties": { "frontLeft": { "type": "number", "format": "double" }, "frontRight": { "type": "number", "format": "double" }, "rearLeft": { "type": "number", "format": "double" }, "rearRight": { "type": "number", "format": "double" }, "days": { "type": "integer", "format": "int32" } }, "description": "Each tyre's change against the other three, in bar: negative when it lost air the others kept.\nDays is how many days with all four readings it rests on." }, "TyreHistoryDto": { "required": [ "days", "trend", "trendDays", "losing" ], "type": "object", "properties": { "days": { "type": "array", "items": { "$ref": "#/components/schemas/DailyStat" } }, "trend": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/TyreChanges" } ] }, "trendDays": { "type": "integer", "format": "int32" }, "losing": { "type": "array", "items": { "type": "string" } } }, "description": "A month of daily statistics (the same rows as /stats/daily, for the same chart) and, when there\nare readings enough, each tyre's change against the others over TrendDays,\nwith the positions losing air (frontLeft, rearRight, ...) by the slow-puncture alert's rule." }, "TyrePressureThresholds": { "required": [ "lowBar", "goodBar", "highBar" ], "type": "object", "properties": { "lowBar": { "type": "number", "description": "Below this a tyre is low: a warning on the dashboard and a notification.", "format": "double" }, "goodBar": { "type": "number", "description": "Up to this a tyre is fine; between it and HighBar it is on the high side.", "format": "double" }, "highBar": { "type": "number", "description": "Above this a tyre is overinflated: a warning and a notification.", "format": "double" }, "dropBar": { "type": "number", "description": "How far one tyre may fall behind the other three over int TyreTrend.WindowDays\ndays before that is a slow puncture. Zero switches the alert off.", "format": "double", "default": 0.15 } } }, "UpdateInfo": { "required": [ "updateAvailable", "latestVersion", "releaseUrl" ], "type": "object", "properties": { "updateAvailable": { "type": "boolean" }, "latestVersion": { "type": [ "null", "string" ] }, "releaseUrl": { "type": [ "null", "string" ] } }, "description": "What the footer shows: whether a newer release exists, and where to read about it." }, "UpdateMaintenanceItemRequest": { "required": [ "name", "notes", "intervalKm", "intervalMonths" ], "type": "object", "properties": { "name": { "type": "string" }, "notes": { "type": [ "null", "string" ] }, "intervalKm": { "type": [ "null", "number" ], "format": "double" }, "intervalMonths": { "type": [ "null", "integer" ], "format": "int32" } } }, "VapidPublicKeyResponse": { "required": [ "publicKey" ], "type": "object", "properties": { "publicKey": { "type": "string" } }, "description": "The server's VAPID public key, which a browser subscribes to push with." }, "Vehicle": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "vin": { "type": "string" }, "model": { "type": [ "null", "string" ] }, "series": { "type": [ "null", "string" ] }, "saicUser": { "type": [ "null", "string" ] }, "createdAt": { "type": "string", "format": "date-time" }, "configJson": { "type": [ "null", "string" ], "description": "JSON blob of capability flags from info/configuration/* MQTT messages." }, "lastParkedAt": { "type": [ "null", "string" ], "format": "date-time" }, "parkedLatitude": { "type": [ "null", "number" ], "description": "Where the car was when it last parked: the position it is expected to stay at while the\nengine is off. Null when the car reported no position then.", "format": "double" }, "parkedLongitude": { "type": [ "null", "number" ], "format": "double" }, "lastMessageId": { "type": [ "null", "string" ], "description": "SAIC's id for the newest MG app message the Worker has dealt with, pushed or deliberately\nnot. The gateway publishes its latest message again every time it starts, and this is how\nthat repeat is told apart from a new message." }, "tripsRecordedUntil": { "type": [ "null", "string" ], "description": "How far the Worker has saved this vehicle's trips: every trip starting before this moment\nis in the Trips table, and the fixes from here on have not been cut into saved trips yet.\nNull until the Worker has run once.", "format": "date-time" }, "telemetryCompactedUntil": { "type": [ "null", "string" ], "description": "How far the Worker has compacted this vehicle's telemetry into quarter-hour rows: every row\nbefore this moment is compacted. Null until the first compaction.", "format": "date-time" }, "licensePlate": { "type": [ "null", "string" ], "description": "The Dutch registration, as string? LicensePlate.Normalize(string? plate) writes it, for the\nRDW lookup. Neither the gateway nor SAIC reports it, so the user enters it. Kept on the\nvehicle rather than in the browser's settings because the Worker looks it up." }, "hasPowerTailgate": { "type": "boolean", "description": "Whether the car has a power tailgate, so the boot can be opened and closed remotely rather\nthan only unlatched. Nothing in the vehicle data tells, and the gateway sends the command to\nany car (one without a power tailgate refuses it), so the user switches it on." }, "settings": { "oneOf": [ { "type": "null" }, { "description": "The user's settings for this car, or null while none was ever saved: then every value is\nthe deployment's default. See VehicleSettings.", "$ref": "#/components/schemas/VehicleSettings" } ] }, "telemetrySnapshots": { "type": "array", "items": { "$ref": "#/components/schemas/TelemetrySnapshot" } } } }, "VehicleAggregateStats": { "required": [ "climateUsagePct", "climateOnSnapshots", "totalClimateSnapshots" ], "type": "object", "properties": { "climateUsagePct": { "type": [ "null", "integer" ], "format": "int32" }, "climateOnSnapshots": { "type": "integer", "format": "int32" }, "totalClimateSnapshots": { "type": "integer", "format": "int32" } } }, "VehicleCommandSent": { "required": [ "topic", "value" ], "type": "object", "properties": { "topic": { "type": "string" }, "value": { "type": "string" } }, "description": "A command as it was published: the gateway topic it went out on, and its value." }, "VehicleListItemDto": { "required": [ "id", "vin", "model", "series", "createdAt", "vehicleType", "vehicleTypeOverride", "hvBatteryCapacityKwh", "supportsTargetSoc", "hasPowerTailgate" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "vin": { "type": "string" }, "model": { "type": [ "null", "string" ] }, "series": { "type": [ "null", "string" ] }, "createdAt": { "type": "string", "format": "date-time" }, "vehicleType": { "type": "string" }, "vehicleTypeOverride": { "type": [ "null", "string" ] }, "hvBatteryCapacityKwh": { "type": [ "null", "number" ], "format": "double" }, "supportsTargetSoc": { "type": "boolean" }, "hasPowerTailgate": { "type": "boolean" } }, "description": "A vehicle as the list endpoint returns it. `VehicleType` is the drivetrain detected from\nthe vehicle's reported hardware version (hev, phev, bev, or unknown while nothing has reported\none), served here so every client reads the same answer instead of parsing it themselves.\n`VehicleTypeOverride` is the type set in the vehicle's settings, null when the detected\none stands. `HvBatteryCapacityKwh` rides along for the same reason: it decides how a\nclient turns a state of charge into kWh. It is the car's own setting, else the deployment's,\nand null when neither says.\n`SupportsTargetSoc` says whether the car takes a charge target, by the gateway's own test.\n`HasPowerTailgate` is what the user set: whether the boot can be opened and closed." }, "VehicleSettings": { "type": "object", "properties": { "hvBatteryCapacityKwh": { "type": [ "null", "number" ], "description": "Usable traction battery size in kWh (HV_BATTERY_CAPACITY_KWH). Not taken on a plain hybrid.", "format": "double" }, "tyreLowBar": { "type": [ "null", "number" ], "description": "Below this a tyre is low, in bar (TYRE_PRESSURE_LOW_BAR).", "format": "double" }, "tyreGoodBar": { "type": [ "null", "number" ], "description": "From this a tyre is at its placard pressure, in bar (TYRE_PRESSURE_GOOD_BAR).", "format": "double" }, "tyreHighBar": { "type": [ "null", "number" ], "description": "Above this a tyre is too high, in bar (TYRE_PRESSURE_HIGH_BAR).", "format": "double" }, "tyreDropBar": { "type": [ "null", "number" ], "description": "The slow-puncture alert's fall against the other tyres, in bar (TYRE_PRESSURE_DROP_BAR).", "format": "double" }, "auxBatteryLowVolt": { "type": [ "null", "number" ], "description": "12V battery voltage a parked car is warned below (AUX_BATTERY_LOW_VOLT).", "format": "double" }, "lowFuelPercent": { "type": [ "null", "number" ], "description": "Fuel level in percent the car is warned below (LOW_FUEL_PERCENT).", "format": "double" }, "lowEvPercent": { "type": [ "null", "number" ], "description": "Charge level in percent a plug-in is warned below (LOW_EV_PERCENT).", "format": "double" }, "vehicleType": { "type": [ "null", "string" ], "description": "The drivetrain the user says the car has (hev, phev or bev), for when the one detected from\nwhat the gateway reports is wrong. Null follows the detected type." } }, "description": "What the user set for one car, in its own table beside the vehicle. Every value is optional:\nleft empty, the car takes the deployment's default (the environment variable named on each),\nso an install that never opens these settings behaves as it did before they existed.\nVehicleSettingsResolver turns them into the values in effect. Anything\nelse kept per car, such as a default charge price, belongs here too." }, "VehicleSettingsDto": { "required": [ "values", "defaults" ], "type": "object", "properties": { "values": { "description": "What is set for this car; null where nothing is.", "$ref": "#/components/schemas/VehicleSettingsValues" }, "defaults": { "description": "The deployment's defaults: its environment variables, and the detected vehicle type.", "$ref": "#/components/schemas/VehicleSettingsValues" } }, "description": "A car's own settings, and the deployment's default each empty one takes." }, "VehicleSettingsValues": { "required": [ "hvBatteryCapacityKwh", "tyreLowBar", "tyreGoodBar", "tyreHighBar", "tyreDropBar", "auxBatteryLowVolt", "lowFuelPercent", "lowEvPercent", "vehicleType" ], "type": "object", "properties": { "hvBatteryCapacityKwh": { "type": [ "null", "number" ], "description": "Usable traction battery size, 0.5 to 200 kWh. Refused on a plain hybrid (hev).", "format": "double" }, "tyreLowBar": { "type": [ "null", "number" ], "description": "Below this a tyre is low, 1 to 5 bar.", "format": "double" }, "tyreGoodBar": { "type": [ "null", "number" ], "description": "From this a tyre is at its placard pressure, 1 to 5 bar, from the low one up.", "format": "double" }, "tyreHighBar": { "type": [ "null", "number" ], "description": "Above this a tyre is too high, 1 to 5 bar, from the good one up.", "format": "double" }, "tyreDropBar": { "type": [ "null", "number" ], "description": "How far one tyre may fall behind the others over two weeks, 0 to 1 bar; 0 switches the slow-puncture alert off.", "format": "double" }, "auxBatteryLowVolt": { "type": [ "null", "number" ], "description": "12V battery voltage a parked car is warned below, 0 to 15 V; 0 switches the alert off.", "format": "double" }, "lowFuelPercent": { "type": [ "null", "number" ], "description": "Fuel level warned below, 0 to 100 %; 0 switches the alert off.", "format": "double" }, "lowEvPercent": { "type": [ "null", "number" ], "description": "Charge level a plug-in is warned below, 0 to 100 %; 0 switches the alert off.", "format": "double" }, "vehicleType": { "type": [ "null", "string" ], "description": "The drivetrain: hev, phev or bev. As a default, the detected one, or null while none is." } }, "description": "Every per-car setting. In a change, a field left out stays as it is and null clears it; in an\nanswer, null is a value not set." }, "WidgetStatusDto": { "required": [ "recordedAt", "fuelLevelPercent", "fuelRangeKm", "evSocPercent", "electricRangeKm", "isCharging", "chargerConnected", "mileageSinceLastCharge", "hvSocKwh", "hvTotalCapacityKwh", "hvVoltage", "hvCurrent", "hvPower", "odometerKm", "mileageOfTheDayKm", "powerUsageOfDayKwh", "electricSharePercent", "isLocked", "engineRunning", "climateOn", "driverDoorOpen", "passengerDoorOpen", "rearLeftDoorOpen", "rearRightDoorOpen", "trunkOpen", "bonnetOpen", "anyDoorOpen", "driverWindowOpen", "passengerWindowOpen", "rearLeftWindowOpen", "rearRightWindowOpen", "sunRoofOpen", "anyWindowOpen", "batteryVoltage", "interiorTemperature", "exteriorTemperature", "tyrePressureFrontLeft", "tyrePressureFrontRight", "tyrePressureRearLeft", "tyrePressureRearRight", "lightsMainBeam", "lightsDippedBeam", "lightsSide", "speedKmh", "currentJourneyDistanceKm", "isAvailable", "lastVehicleStateAt", "lastChargeStateAt", "remainingChargingTime", "chargingType", "chargingCableLock", "obcPowerSinglePhase", "obcPowerThreePhase", "batteryHeating", "batteryHeatingScheduleMode", "batteryHeatingScheduleStartTime", "elevation", "bmsChargeStatus", "lastChargeEndingPower", "chargingLastEndAt", "chargingScheduleMode", "chargingScheduleStartTime", "chargingScheduleEndTime", "onboardChargerPlugStatus", "offboardChargerPlugStatus", "apkExpiresOn", "apkDaysLeft", "openRecalls", "wamInsured", "nextMaintenance", "nextMaintenanceStatus", "nextMaintenanceDueDate", "nextMaintenanceDaysLeft", "nextMaintenanceKmLeft", "lastTripStartedAt", "lastTripEndedAt", "lastTripDistanceKm" ], "type": "object", "properties": { "recordedAt": { "type": "string", "format": "date-time" }, "fuelLevelPercent": { "type": [ "null", "number" ], "format": "double" }, "fuelRangeKm": { "type": [ "null", "number" ], "format": "double" }, "evSocPercent": { "type": [ "null", "number" ], "format": "double" }, "electricRangeKm": { "type": [ "null", "number" ], "format": "double" }, "isCharging": { "type": [ "null", "string" ] }, "chargerConnected": { "type": [ "null", "string" ] }, "mileageSinceLastCharge": { "type": [ "null", "number" ], "format": "double" }, "hvSocKwh": { "type": [ "null", "number" ], "format": "double" }, "hvTotalCapacityKwh": { "type": [ "null", "number" ], "format": "double" }, "hvVoltage": { "type": [ "null", "number" ], "format": "double" }, "hvCurrent": { "type": [ "null", "number" ], "format": "double" }, "hvPower": { "type": [ "null", "number" ], "format": "double" }, "odometerKm": { "type": [ "null", "number" ], "format": "double" }, "mileageOfTheDayKm": { "type": [ "null", "number" ], "format": "double" }, "powerUsageOfDayKwh": { "type": [ "null", "number" ], "format": "double" }, "electricSharePercent": { "type": [ "null", "number" ], "format": "double" }, "isLocked": { "type": [ "null", "string" ] }, "engineRunning": { "type": [ "null", "string" ] }, "climateOn": { "type": [ "null", "string" ] }, "driverDoorOpen": { "type": [ "null", "string" ] }, "passengerDoorOpen": { "type": [ "null", "string" ] }, "rearLeftDoorOpen": { "type": [ "null", "string" ] }, "rearRightDoorOpen": { "type": [ "null", "string" ] }, "trunkOpen": { "type": [ "null", "string" ] }, "bonnetOpen": { "type": [ "null", "string" ] }, "anyDoorOpen": { "type": [ "null", "string" ] }, "driverWindowOpen": { "type": [ "null", "string" ] }, "passengerWindowOpen": { "type": [ "null", "string" ] }, "rearLeftWindowOpen": { "type": [ "null", "string" ] }, "rearRightWindowOpen": { "type": [ "null", "string" ] }, "sunRoofOpen": { "type": [ "null", "string" ] }, "anyWindowOpen": { "type": [ "null", "string" ] }, "batteryVoltage": { "type": [ "null", "number" ], "format": "double" }, "interiorTemperature": { "type": [ "null", "number" ], "format": "double" }, "exteriorTemperature": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureFrontLeft": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureFrontRight": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureRearLeft": { "type": [ "null", "number" ], "format": "double" }, "tyrePressureRearRight": { "type": [ "null", "number" ], "format": "double" }, "lightsMainBeam": { "type": [ "null", "string" ] }, "lightsDippedBeam": { "type": [ "null", "string" ] }, "lightsSide": { "type": [ "null", "string" ] }, "speedKmh": { "type": [ "null", "number" ], "format": "double" }, "currentJourneyDistanceKm": { "type": [ "null", "number" ], "format": "double" }, "isAvailable": { "type": [ "null", "string" ] }, "lastVehicleStateAt": { "type": [ "null", "string" ], "format": "date-time" }, "lastChargeStateAt": { "type": [ "null", "string" ], "format": "date-time" }, "remainingChargingTime": { "type": [ "null", "integer" ], "format": "int32" }, "chargingType": { "type": [ "null", "string" ] }, "chargingCableLock": { "type": [ "null", "string" ] }, "obcPowerSinglePhase": { "type": [ "null", "number" ], "format": "double" }, "obcPowerThreePhase": { "type": [ "null", "number" ], "format": "double" }, "batteryHeating": { "type": [ "null", "string" ] }, "batteryHeatingScheduleMode": { "type": [ "null", "string" ] }, "batteryHeatingScheduleStartTime": { "type": [ "null", "string" ] }, "elevation": { "type": [ "null", "number" ], "format": "double" }, "bmsChargeStatus": { "type": [ "null", "string" ] }, "lastChargeEndingPower": { "type": [ "null", "number" ], "format": "double" }, "chargingLastEndAt": { "type": [ "null", "string" ], "format": "date-time" }, "chargingScheduleMode": { "type": [ "null", "string" ] }, "chargingScheduleStartTime": { "type": [ "null", "string" ] }, "chargingScheduleEndTime": { "type": [ "null", "string" ] }, "onboardChargerPlugStatus": { "type": [ "null", "integer" ], "format": "int32" }, "offboardChargerPlugStatus": { "type": [ "null", "integer" ], "format": "int32" }, "apkExpiresOn": { "type": [ "null", "string" ], "format": "date" }, "apkDaysLeft": { "type": [ "null", "integer" ], "format": "int32" }, "openRecalls": { "type": [ "null", "integer" ], "format": "int32" }, "wamInsured": { "type": [ "null", "string" ] }, "nextMaintenance": { "type": [ "null", "string" ] }, "nextMaintenanceStatus": { "type": [ "null", "string" ] }, "nextMaintenanceDueDate": { "type": [ "null", "string" ], "format": "date-time" }, "nextMaintenanceDaysLeft": { "type": [ "null", "integer" ], "format": "int32" }, "nextMaintenanceKmLeft": { "type": [ "null", "number" ], "format": "double" }, "lastTripStartedAt": { "type": [ "null", "string" ], "format": "date-time" }, "lastTripEndedAt": { "type": [ "null", "string" ], "format": "date-time" }, "lastTripDistanceKm": { "type": [ "null", "number" ], "format": "double" } } } }, "securitySchemes": { "session": { "type": "apiKey", "description": "The session cookie signing in sets. The browser sends it by itself, so this page needs nothing filled in.", "name": "garagestack-auth", "in": "cookie" }, "apiToken": { "type": "http", "description": "A read-only API token from Settings, API tokens. It only reads, and not the export, the logs or the tokens.", "scheme": "bearer", "bearerFormat": "gs_..." }, "widgetKey": { "type": "apiKey", "description": "WIDGET_API_KEY, for the Homepage widget only.", "name": "X-Widget-Key", "in": "header" }, "calendarToken": { "type": "apiKey", "description": "The token of the calendar link made in Settings, Calendar feed. It opens the feed and nothing else.", "name": "token", "in": "query" } } }, "tags": [ { "name": "API tokens", "description": "Read-only tokens for scripts. Made and revoked from a signed-in session only." }, { "name": "Authentication", "description": "Signing in and out, and which sign-in methods this install offers." }, { "name": "Calendar", "description": "A calendar feed (iCalendar) of the APK, maintenance due dates and climate schedules, opened by the token in its address. The link is made and stopped from a signed-in session." }, { "name": "Climate schedules", "description": "Climate runs the Worker starts at set times on set days." }, { "name": "Commute places", "description": "Home and work places. Trips between them are labelled as commutes, unless someone chose a purpose." }, { "name": "Dawarich", "description": "Phone GPS from Dawarich, merged into trips. Answers 404 `dawarich.disabled` unless Dawarich is configured." }, { "name": "Demo", "description": "Demo mode only: change the demo car's state, as the Demo Controls panel does." }, { "name": "Diagnostics", "description": "Errors the web app ran into in the browser, for the API's log, and an anonymized zip to attach to a bug report." }, { "name": "Export", "description": "Everything GarageStack keeps, as one zip." }, { "name": "Gateway", "description": "Whether the SAIC gateway is signed in to the MG account: when it is not, no car sends data, whatever the car itself is doing." }, { "name": "Logs", "description": "The API's and the Worker's log entries, as the log viewer pages through them." }, { "name": "Maintenance", "description": "Service items with their intervals and when they are due, and each item's service history." }, { "name": "Map", "description": "Charging stations (Open Charge Map), points of interest, addresses and map matching (OpenStreetMap services), all cached." }, { "name": "Notifications", "description": "The alerts the Worker raised, as the bell lists them." }, { "name": "Push Notifications", "description": "Browser push subscriptions (Web Push)." }, { "name": "RDW", "description": "The Dutch registration: APK, insurance and recalls. Answers 404 `rdw.disabled` unless RDW_ENABLED is set." }, { "name": "Settings", "description": "The signed-in account's settings, kept per section so they follow it to every device." }, { "name": "Trips", "description": "Trips as recorded, and the trip log: purposes, notes, hiding, joining and editing a route." }, { "name": "Updates", "description": "Whether a newer GarageStack release is out." }, { "name": "Vehicles", "description": "The cars: their latest telemetry, statistics, charge sessions and tyre pressures, their own settings, and the commands sent to them." }, { "name": "Widget", "description": "The car's status in one call, for a Homepage dashboard widget." } ] }