{"openapi":"3.1.0","info":{"title":"xind-mi API","description":"\nLocate the company's delivery scooters from three sources: **Xiaomi smart tags** on\n**Apple Find My** and on **Google Find Hub** (one of each per scooter), and the **courier's\nphone** (the courier app's GPS). The API merges them into one position per scooter with a\n**confidence** score (100% when at least two sources report the same place), keeps the\nhistory, watches for problems and sends alerts.\n\n## Authentication\n\nEvery endpoint except `/health` needs one of:\n\n* **A person**: `POST /api/v1/auth/login`. Browsers get the `xm_session` cookie;\n  scripts send the returned `token` as `Authorization: Bearer <token>`.\n* **A program**: an API key from **Settings → API keys**, sent as `X-API-Key: <key>`\n  or `Authorization: Bearer <key>`.\n\nRoles: **viewer** (read-only) · **operator** (scooters, tags, zones, alerts) · **admin**\n(also accounts, notification channels, users, keys, settings). API keys can also have the\n**device** role: it can only send courier-phone locations (`POST /phones/report`).\n\n## Getting started\n\n1. **Add accounts**: `POST /accounts`\n   * Apple: create with the Apple ID, then `POST /accounts/{id}/apple/login` and the\n     two 2FA steps.\n   * Google: upload `secrets.json` from GoogleFindMyTools.\n2. **Add tags**: Apple via `POST /trackers/import/apple` (keys exported from a Mac);\n   Google via `GET /accounts/{id}/discover` then `POST /trackers`.\n3. **Add scooters** (`POST /scooters`) and assign two tags to each\n   (`PATCH /trackers/{id}` with `scooter_id`).\n4. **Notifications**: `POST /notifications/channels` (Telegram, webhook, Discord, Slack,\n   ntfy, e-mail) and tune `/notifications/rules`.\n\nThe poller fetches every account on its own interval. `GET /stream` pushes live updates.\n\n## How accurate is it?\n\nTags have no GPS. A position comes from a stranger's phone that passed nearby, so it is\nusually 10–100 m accurate and minutes to hours old. Check `observed_at`, `age_s` and\n`accuracy_m`. Both networks are unofficial integrations and may break when Apple or\nGoogle change them; the `account_error` alert tells you when that happens.\n\n## Conventions\n\n* Times are ISO 8601 in UTC. Distances in metres. Coordinates WGS-84.\n* Errors: `{\"detail\": \"...\"}` with a 4xx/5xx status.\n","version":"0.1.0"},"paths":{"/api/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Sign in","description":"Check a username and password. Returns a session token and also sets it as an\nHTTP-only cookie, so browsers stay signed in.","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Sign out","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["Auth"],"summary":"Who am I","description":"The signed-in user, or the API key in use.","operationId":"me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/password":{"post":{"tags":["Auth"],"summary":"Change my password","operationId":"change_password_api_v1_auth_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/users":{"get":{"tags":["Users"],"summary":"List users","operationId":"list_users_api_v1_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/UserOut"},"type":"array","title":"Response List Users Api V1 Users Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Users"],"summary":"Create a user","description":"Roles: **viewer** (read-only), **operator** (manage scooters, tags, zones, alerts),\n**admin** (everything, including accounts, channels, users and keys).","operationId":"create_user_api_v1_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/users/{user_id}":{"patch":{"tags":["Users"],"summary":"Update a user","operationId":"update_user_api_v1_users__user_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Users"],"summary":"Delete a user","operationId":"delete_user_api_v1_users__user_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys","operationId":"list_keys_api_v1_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyOut"},"type":"array","title":"Response List Keys Api V1 Api Keys Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["API keys"],"summary":"Create an API key","description":"Creates a key for another program (dispatch system, courier app, scripts).\nSend it as `X-API-Key: <key>` or `Authorization: Bearer <key>`.\n**The full key is returned only once.**","operationId":"create_key_api_v1_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/api-keys/{key_id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key","operationId":"revoke_key_api_v1_api_keys__key_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/activity":{"get":{"tags":["Activity"],"summary":"What every courier is doing now","operationId":"fleet_activity_api_v1_activity_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only this state","title":"State"},"description":"Only this state"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScooterActivity"},"title":"Response Fleet Activity Api V1 Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/activity/states":{"get":{"tags":["Activity"],"summary":"Activity states and their labels","operationId":"activity_states_api_v1_activity_states_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/scooters/{scooter_id}/activity":{"get":{"tags":["Activity"],"summary":"What the courier is doing now","operationId":"scooter_activity_api_v1_scooters__scooter_id__activity_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ActivityOut"},{"type":"null"}],"title":"Response Scooter Activity Api V1 Scooters  Scooter Id  Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/timeline":{"get":{"tags":["Activity"],"summary":"Activity timeline","description":"Consecutive activity segments, oldest first: ride, pickup, ride, delivery, break...","operationId":"scooter_timeline_api_v1_scooters__scooter_id__timeline_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Default: start of today (local time)","title":"Since"},"description":"Default: start of today (local time)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActivityOut"},"title":"Response Scooter Timeline Api V1 Scooters  Scooter Id  Timeline Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/couriers/summary":{"get":{"tags":["Activity"],"summary":"Time per activity, per courier","description":"For each courier: seconds spent riding, picking up, delivering, on breaks…, plus the\nnumber of pickups and deliveries. Good for a daily report.","operationId":"couriers_summary_api_v1_couriers_summary_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Default: start of today (local time)","title":"Since"},"description":"Default: start of today (local time)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters":{"get":{"tags":["Scooters"],"summary":"List scooters","description":"All scooters with their best current position (fused from the Apple tag, the Google\ntag and the courier's phone), its confidence, the sources on them and how many alerts are\nopen.","operationId":"list_scooters_api_v1_scooters_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"active, maintenance or retired","title":"Status"},"description":"active, maintenance or retired"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search name, plate, courier or model","title":"Q"},"description":"Search name, plate, courier or model"},{"name":"located","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Only scooters with (true) or without (false) a known position","title":"Located"},"description":"Only scooters with (true) or without (false) a known position"},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"description":"Only scooters whose position confidence is at least this","title":"Min Confidence"},"description":"Only scooters whose position confidence is at least this"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScooterOut"},"title":"Response List Scooters Api V1 Scooters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Scooters"],"summary":"Add a scooter","operationId":"create_scooter_api_v1_scooters_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScooterIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScooterOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/geojson":{"get":{"tags":["Scooters"],"summary":"All scooter positions as GeoJSON","description":"A GeoJSON `FeatureCollection` with one point per located scooter. Drop it straight\ninto Leaflet, Mapbox, QGIS or geojson.io.","operationId":"scooters_geojson_api_v1_scooters_geojson_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/scooters/nearby":{"get":{"tags":["Scooters"],"summary":"Scooters near a point","description":"Scooters whose last known position is within `radius_m` of the point, nearest first.\nUseful for \"which scooter is closest to this restaurant?\".","operationId":"nearby_api_v1_scooters_nearby_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number","maximum":90,"minimum":-90,"title":"Lat"}},{"name":"lon","in":"query","required":true,"schema":{"type":"number","maximum":180,"minimum":-180,"title":"Lon"}},{"name":"radius_m","in":"query","required":false,"schema":{"type":"number","maximum":100000,"exclusiveMinimum":0,"default":1000,"title":"Radius M"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":20,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"active","title":"Status"}},{"name":"include_stale","in":"query","required":false,"schema":{"type":"boolean","description":"Include scooters whose last position is older than the freshness setting","default":true,"title":"Include Stale"},"description":"Include scooters whose last position is older than the freshness setting"},{"name":"min_confidence","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":0,"description":"Skip positions with lower confidence","default":0,"title":"Min Confidence"},"description":"Skip positions with lower confidence"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NearbyScooter"},"title":"Response Nearby Api V1 Scooters Nearby Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}":{"get":{"tags":["Scooters"],"summary":"Get one scooter","operationId":"get_scooter_api_v1_scooters__scooter_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScooterOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Scooters"],"summary":"Update a scooter","operationId":"update_scooter_api_v1_scooters__scooter_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScooterPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScooterOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Scooters"],"summary":"Delete a scooter","description":"Deletes the scooter. Its tags stay (unassigned) and its history is kept without the\nscooter link.","operationId":"delete_scooter_api_v1_scooters__scooter_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/location":{"get":{"tags":["Scooters"],"summary":"Current position","description":"The fused position, or `null` if no tag has reported yet.","operationId":"scooter_location_api_v1_scooters__scooter_id__location_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FusedLocation"},{"type":"null"}],"title":"Response Scooter Location Api V1 Scooters  Scooter Id  Location Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/trackers":{"get":{"tags":["Scooters"],"summary":"Tags on this scooter","operationId":"scooter_trackers_api_v1_scooters__scooter_id__trackers_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TrackerOut"},"title":"Response Scooter Trackers Api V1 Scooters  Scooter Id  Trackers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/history":{"get":{"tags":["Scooters"],"summary":"Location history","description":"All reports from all tags on the scooter in the time range, oldest first.","operationId":"scooter_history_api_v1_scooters__scooter_id__history_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO time; default 24 hours ago","title":"Since"},"description":"ISO time; default 24 hours ago"},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"apple, google or simulator","title":"Provider"},"description":"apple, google or simulator"},{"name":"max_accuracy_m","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Drop reports less accurate than this","title":"Max Accuracy M"},"description":"Drop reports less accurate than this"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20000,"minimum":1,"default":2000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LocationOut"},"title":"Response Scooter History Api V1 Scooters  Scooter Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/track":{"get":{"tags":["Scooters"],"summary":"Location history drawn along roads","description":"Like `/history`, but ready to draw: for each source (Apple tag, Google tag, courier's\nphone) a `path` that follows the real streets between consecutive reports, plus the\nreports themselves. Walking legs of the phone, and legs that can't sensibly follow a road,\nstay straight. `roads` says whether the road network is loaded (if not, paths are\nstraight lines).","operationId":"scooter_track_api_v1_scooters__scooter_id__track_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO time; default 24 hours ago","title":"Since"},"description":"ISO time; default 24 hours ago"},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"}},{"name":"max_points","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":10,"description":"Per source","default":1500,"title":"Max Points"},"description":"Per source"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/history.csv":{"get":{"tags":["Scooters"],"summary":"Location history as CSV","operationId":"scooter_history_csv_api_v1_scooters__scooter_id__history_csv_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/stats":{"get":{"tags":["Scooters"],"summary":"Distance and activity for a period","description":"Rough distance travelled (sum of hops between reports, ignoring jumps smaller than the\nreports' accuracy) and report counts per provider.","operationId":"scooter_stats_api_v1_scooters__scooter_id__stats_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Default: 24 hours ago","title":"Since"},"description":"Default: 24 hours ago"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/refresh":{"post":{"tags":["Scooters"],"summary":"Ask for fresh positions now","description":"Starts an immediate poll of every account that owns a tag on this scooter. Results\narrive in a few seconds (Apple) to a minute (Google); watch `/stream` or poll\n`/scooters/{id}/location`.","operationId":"refresh_scooter_api_v1_scooters__scooter_id__refresh_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trackers":{"get":{"tags":["Trackers"],"summary":"List tags","operationId":"list_trackers_api_v1_trackers_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"}},{"name":"scooter_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"unassigned","in":"query","required":false,"schema":{"type":"boolean","description":"Only tags not on any scooter","default":false,"title":"Unassigned"},"description":"Only tags not on any scooter"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TrackerOut"},"title":"Response List Trackers Api V1 Trackers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Trackers"],"summary":"Add a Google or simulator tag","description":"Adds a tag by its id. Find ids with `GET /accounts/{id}/discover`.\nApple tags need key material, so use `POST /trackers/import/apple` instead.","operationId":"create_tracker_api_v1_trackers_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trackers/health":{"get":{"tags":["Trackers"],"summary":"Health and battery of every tag","description":"A 0–100 score per tag (good ≥ 75, fair ≥ 45, poor) with plain-language issues and\nadvice: how often it reports compared with the fleet, accuracy, silence, battery level\nand battery age. Worst first.","operationId":"trackers_health_api_v1_trackers_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/trackers/{tracker_id}/health":{"get":{"tags":["Trackers"],"summary":"Health and battery of one tag","operationId":"tracker_health_api_v1_trackers__tracker_id__health_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tracker_id","in":"path","required":true,"schema":{"type":"integer","title":"Tracker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trackers/{tracker_id}/battery-replaced":{"post":{"tags":["Trackers"],"summary":"Record a battery replacement","description":"Resets the battery age (and clears a low-battery reading until the tag reports\nagain).","operationId":"battery_replaced_api_v1_trackers__tracker_id__battery_replaced_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tracker_id","in":"path","required":true,"schema":{"type":"integer","title":"Tracker Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/BatteryReplaced"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trackers/import/apple":{"post":{"tags":["Trackers"],"summary":"Import Apple tags (keys from a Mac)","description":"Imports Apple Find My tags with their private keys. Keys are encrypted at rest.\nRe-importing a tag updates its keys and keeps its history.","operationId":"import_apple_api_v1_trackers_import_apple_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_apple_api_v1_trackers_import_apple_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/trackers/{tracker_id}":{"get":{"tags":["Trackers"],"summary":"Get one tag","operationId":"get_tracker_api_v1_trackers__tracker_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tracker_id","in":"path","required":true,"schema":{"type":"integer","title":"Tracker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Trackers"],"summary":"Update / assign a tag","operationId":"update_tracker_api_v1_trackers__tracker_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tracker_id","in":"path","required":true,"schema":{"type":"integer","title":"Tracker Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackerPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Trackers"],"summary":"Delete a tag","description":"Removes the tag, its keys and its location history.","operationId":"delete_tracker_api_v1_trackers__tracker_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tracker_id","in":"path","required":true,"schema":{"type":"integer","title":"Tracker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trackers/{tracker_id}/locations":{"get":{"tags":["Trackers"],"summary":"Reports from one tag","operationId":"tracker_locations_api_v1_trackers__tracker_id__locations_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tracker_id","in":"path","required":true,"schema":{"type":"integer","title":"Tracker Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Default: 24 hours ago","title":"Since"},"description":"Default: 24 hours ago"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20000,"minimum":1,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LocationOut"},"title":"Response Tracker Locations Api V1 Trackers  Tracker Id  Locations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/phones/report":{"post":{"tags":["Courier phones"],"summary":"Courier app: send GPS points","description":"Called by the courier app, every 15–30 s while the courier is on shift (batch the\npoints if offline and send them later; duplicates are ignored).\n\nAuthenticate with an API key with the **device** role (Settings → API keys), sent as\n`X-API-Key`. The first report from a `device_id` creates the phone as a source; it is\nassigned to the scooter given by `scooter_id` / `scooter_name`, and moved when that\nchanges. One phone per scooter: assigning a phone takes the scooter from any other phone.\n\n```json\n{\"device_id\": \"9b2f…\", \"courier\": \"Arben\", \"scooter_name\": \"SC-014\", \"battery\": 81,\n \"points\": [{\"lat\": 42.4636, \"lon\": 21.4694, \"accuracy_m\": 8,\n             \"recorded_at\": \"2026-11-16T09:15:02+01:00\", \"speed_mps\": 6.1}]}\n```","operationId":"report_api_v1_phones_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneReport"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneReportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/gps/traccar":{"post":{"tags":["GPS trackers"],"summary":"Traccar position forwarding","description":"Point Traccar's position forwarding here and every position arrives instantly.\nIn Traccar's `traccar.xml`:\n\n```xml\n<entry key='forward.enable'>true</entry>\n<entry key='forward.json'>true</entry>\n<entry key='forward.url'>https://xindmi.faqe.pro/api/v1/gps/traccar?key=YOUR_DEVICE_KEY</entry>\n```\n\nAccepts Traccar's JSON (`{\"position\": {...}, \"device\": {...}}`) or a list of them. New\ndevices appear under *Tags* (unassigned); assign each to its scooter.","operationId":"traccar_forward_api_v1_gps_traccar_post","parameters":[{"name":"key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API key in the URL, for senders that can't set headers (Traccar forwarding).","title":"Key"},"description":"API key in the URL, for senders that can't set headers (Traccar forwarding)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gps/report":{"post":{"tags":["GPS trackers"],"summary":"GPS tracker: send positions directly","description":"For trackers or gateways that can POST JSON themselves (no Traccar).","operationId":"gps_report_api_v1_gps_report_post","parameters":[{"name":"key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API key in the URL, for senders that can't set headers (Traccar forwarding).","title":"Key"},"description":"API key in the URL, for senders that can't set headers (Traccar forwarding)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpsReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/google-login/requirements":{"get":{"tags":["Accounts"],"summary":"Google sign-in: can the server run it?","operationId":"requirements_api_v1_google_login_requirements_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/google-login":{"post":{"tags":["Accounts"],"summary":"Google sign-in: start","description":"Starts a browser on the server and returns a session. Show it with the VNC\nWebSocket (`/google-login/{id}/vnc`, e.g. with noVNC) and poll `GET /google-login/{id}`\nuntil `state` is `done`. The session ends itself after 10 minutes. One at a time.","operationId":"start_api_v1_google_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginStart"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/google-login/{sid}":{"get":{"tags":["Accounts"],"summary":"Google sign-in: progress","operationId":"status_api_v1_google_login__sid__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/google-login/{sid}/cancel":{"post":{"tags":["Accounts"],"summary":"Google sign-in: cancel","operationId":"cancel_api_v1_google_login__sid__cancel_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts":{"get":{"tags":["Accounts"],"summary":"List accounts","operationId":"list_accounts_api_v1_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AccountOut"},"type":"array","title":"Response List Accounts Api V1 Accounts Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Accounts"],"summary":"Add an account","description":"Adds an account. What happens next depends on the provider:\n\n* **apple**: give `username` (Apple ID). Then call `POST /accounts/{id}/apple/login`\n  with the password and complete 2FA. Then import tags with\n  `POST /trackers/import/apple`.\n* **google**: give `secrets` (the contents of GoogleFindMyTools' `secrets.json`).\n  The account is active right away. Then `GET /accounts/{id}/discover` lists its tags.\n* **simulator**: fake moving tags for trying the system out.","operationId":"create_account_api_v1_accounts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/accounts/{account_id}":{"get":{"tags":["Accounts"],"summary":"Get one account","operationId":"get_account_api_v1_accounts__account_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Accounts"],"summary":"Update an account","operationId":"update_account_api_v1_accounts__account_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Accounts"],"summary":"Delete an account","description":"Deletes the account, **its tags and their location history**, and its stored\ncredentials.","operationId":"delete_account_api_v1_accounts__account_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/google/secrets":{"post":{"tags":["Accounts"],"summary":"Upload Google secrets.json","description":"Same as `PATCH` with `secrets`, but as a file upload (multipart).","operationId":"upload_google_secrets_api_v1_accounts__account_id__google_secrets_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_google_secrets_api_v1_accounts__account_id__google_secrets_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/apple/login":{"post":{"tags":["Accounts"],"summary":"Apple: sign in (step 1)","description":"Signs in to the Apple ID. Usually returns `require_2fa` with a list of `methods`.\nThen call `/apple/2fa/request` (sends the code) and `/apple/2fa/submit`.\n\nThe first sign-in can take up to a minute while the anisette data (device identity\nApple requires) is prepared.","operationId":"apple_login_api_v1_accounts__account_id__apple_login_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleLoginIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/apple/2fa/request":{"post":{"tags":["Accounts"],"summary":"Apple: send the 2FA code (step 2)","operationId":"apple_2fa_request_api_v1_accounts__account_id__apple_2fa_request_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/apple/2fa/submit":{"post":{"tags":["Accounts"],"summary":"Apple: submit the 2FA code (step 3)","operationId":"apple_2fa_submit_api_v1_accounts__account_id__apple_2fa_submit_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorSubmitIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/discover":{"get":{"tags":["Accounts"],"summary":"List the account's tags","description":"Asks Google (or the simulator) which tags the account has, and marks the ones already\nadded. Apple has no such list on the server side: import Apple tags from a Mac export.","operationId":"discover_api_v1_accounts__account_id__discover_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveredTag"},"title":"Response Discover Api V1 Accounts  Account Id  Discover Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/poll":{"post":{"tags":["Accounts"],"summary":"Poll now","description":"Fetches new reports for every enabled tag on this account right away and waits for\nthe result (Google can take up to a minute).","operationId":"poll_now_api_v1_accounts__account_id__poll_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/geofences":{"get":{"tags":["Zones"],"summary":"List zones","operationId":"list_geofences_api_v1_geofences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GeofenceOut"},"type":"array","title":"Response List Geofences Api V1 Geofences Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Zones"],"summary":"Add a zone","description":"A circle (centre + radius). Use it in alert rules (`geofence_exit`, `geofence_enter`).","operationId":"create_geofence_api_v1_geofences_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/geofences/bulk":{"post":{"tags":["Zones"],"summary":"Add many zones at once (e.g. all restaurants)","description":"Send a list of zones, e.g. every partner restaurant with `kind: \"restaurant\"` and a\nradius of 40–80 m. Stops inside a restaurant zone count as pickups.","operationId":"bulk_geofences_api_v1_geofences_bulk_post","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GeofenceIn"},"type":"array","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GeofenceOut"},"type":"array","title":"Response Bulk Geofences Api V1 Geofences Bulk Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/geofences/{geofence_id}":{"get":{"tags":["Zones"],"summary":"Get one zone","operationId":"get_geofence_api_v1_geofences__geofence_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"geofence_id","in":"path","required":true,"schema":{"type":"integer","title":"Geofence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Zones"],"summary":"Update a zone","operationId":"update_geofence_api_v1_geofences__geofence_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"geofence_id","in":"path","required":true,"schema":{"type":"integer","title":"Geofence Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofencePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Zones"],"summary":"Delete a zone","operationId":"delete_geofence_api_v1_geofences__geofence_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"geofence_id","in":"path","required":true,"schema":{"type":"integer","title":"Geofence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/geofences/{geofence_id}/scooters":{"get":{"tags":["Zones"],"summary":"Scooters inside a zone","operationId":"scooters_in_geofence_api_v1_geofences__geofence_id__scooters_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"geofence_id","in":"path","required":true,"schema":{"type":"integer","title":"Geofence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScooterOut"},"title":"Response Scooters In Geofence Api V1 Geofences  Geofence Id  Scooters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/channel-kinds":{"get":{"tags":["Notifications"],"summary":"Channel types and their fields","description":"Describes each channel type and the config fields it needs (used to build forms).","operationId":"channel_kinds_api_v1_notifications_channel_kinds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/notifications/channels":{"get":{"tags":["Notifications"],"summary":"List channels","operationId":"list_channels_api_v1_notifications_channels_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ChannelOut"},"type":"array","title":"Response List Channels Api V1 Notifications Channels Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Notifications"],"summary":"Add a channel","description":"Example (Telegram):\n\n```json\n{\"kind\": \"telegram\", \"name\": \"Ops group\",\n \"config\": {\"bot_token\": \"123:ABC\", \"chat_id\": \"-100123\"}, \"min_severity\": \"warning\"}\n```","operationId":"create_channel_api_v1_notifications_channels_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/notifications/channels/{channel_id}":{"patch":{"tags":["Notifications"],"summary":"Update a channel","operationId":"update_channel_api_v1_notifications_channels__channel_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Notifications"],"summary":"Delete a channel","operationId":"delete_channel_api_v1_notifications_channels__channel_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/channels/{channel_id}/test":{"post":{"tags":["Notifications"],"summary":"Send a test message","operationId":"test_channel_api_v1_notifications_channels__channel_id__test_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/telegram/chats":{"post":{"tags":["Notifications"],"summary":"Telegram: find chat ids","description":"Lists chats that recently messaged your bot (or added it to a group), so you can copy\nthe chat id. Send any message to the bot first.","operationId":"telegram_chats_api_v1_notifications_telegram_chats_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramChatsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/notifications/rule-kinds":{"get":{"tags":["Notifications"],"summary":"Alert rule types and their parameters","operationId":"rule_kinds_api_v1_notifications_rule_kinds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/notifications/rules":{"get":{"tags":["Notifications"],"summary":"List alert rules","operationId":"list_rules_api_v1_notifications_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RuleOut"},"type":"array","title":"Response List Rules Api V1 Notifications Rules Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Notifications"],"summary":"Add an alert rule","operationId":"create_rule_api_v1_notifications_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/notifications/rules/{rule_id}":{"patch":{"tags":["Notifications"],"summary":"Update an alert rule","operationId":"update_rule_api_v1_notifications_rules__rule_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Notifications"],"summary":"Delete an alert rule","operationId":"delete_rule_api_v1_notifications_rules__rule_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/rules/{rule_id}/firing":{"get":{"tags":["Notifications"],"summary":"What a rule is currently firing for","operationId":"rule_firing_api_v1_notifications_rules__rule_id__firing_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events":{"get":{"tags":["Events"],"summary":"Event log","description":"Everything that happened: alerts, resolutions, sign-ins, changes. Newest first.","operationId":"list_events_api_v1_events_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"info, warning or critical","title":"Severity"},"description":"info, warning or critical"},{"name":"min_severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"At or above this severity","title":"Min Severity"},"description":"At or above this severity"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"scooter_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"}},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"}},{"name":"unacknowledged","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unacknowledged"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events/{event_id}/ack":{"post":{"tags":["Events"],"summary":"Acknowledge an event","operationId":"ack_event_api_v1_events__event_id__ack_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"integer","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events/ack-all":{"post":{"tags":["Events"],"summary":"Acknowledge all events","operationId":"ack_all_api_v1_events_ack_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/stats":{"get":{"tags":["System"],"summary":"Fleet overview numbers","operationId":"stats_api_v1_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/status":{"get":{"tags":["System"],"summary":"Server and poller status","operationId":"status_api_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/roads":{"get":{"tags":["System"],"summary":"Road network status","description":"The OpenStreetMap road network used to draw tracks along streets.","operationId":"roads_status_api_v1_roads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/roads/rebuild":{"post":{"tags":["System"],"summary":"Rebuild the road network","description":"Re-cuts the roads around the current map centre (Settings). Takes about a minute;\ntracks are drawn straight until it's done.","operationId":"roads_rebuild_api_v1_roads_rebuild_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"Fetch the latest OpenStreetMap extract for Kosovo first (≈30 MB)","default":true,"title":"Download"},"description":"Fetch the latest OpenStreetMap extract for Kosovo first (≈30 MB)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/settings":{"get":{"tags":["System"],"summary":"Read settings","operationId":"get_settings_api_v1_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"patch":{"tags":["System"],"summary":"Change settings","description":"Send only the keys to change, e.g. `{\"timezone\": \"Europe/Belgrade\"}`.","operationId":"patch_settings_api_v1_settings_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/stream":{"get":{"tags":["System"],"summary":"Live updates (Server-Sent Events)","description":"A `text/event-stream` that pushes:\n\n* `event`: a new event (alert, resolution, change) as JSON\n* `locations`: new reports were stored (`{\"account_id\", \"stored\"}`)\n* `account`, `scooter`, `tracker`, `ack`: something changed; refetch\n* `ping`: every 20 s, to keep the connection open\n\nIn JavaScript: `new EventSource('/api/v1/stream')`.","operationId":"stream_api_v1_stream_get","responses":{"200":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/scooters/{scooter_id}/theft":{"get":{"tags":["Theft"],"summary":"Theft mode status","operationId":"theft_status_api_v1_scooters__scooter_id__theft_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Theft"],"summary":"Report stolen (start theft mode)","description":"Polls the scooter's tags much faster, alerts on every new position and creates a\npublic live-tracking link you can give to the police. All channels get a critical alert.","operationId":"theft_start_api_v1_scooters__scooter_id__theft_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheftStart"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/theft/end":{"post":{"tags":["Theft"],"summary":"End theft mode","description":"Turns the public link off and returns to normal polling. The recorded trail stays\navailable as evidence.","operationId":"theft_end_api_v1_scooters__scooter_id__theft_end_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheftEnd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/theft/evidence.csv":{"get":{"tags":["Theft"],"summary":"Theft evidence (CSV)","description":"Every position recorded since theft mode started: time seen, time received, source,\ncoordinates, accuracy, and a Google Maps link. Events follow at the end.","operationId":"evidence_csv_api_v1_scooters__scooter_id__theft_evidence_csv_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scooters/{scooter_id}/theft/evidence.geojson":{"get":{"tags":["Theft"],"summary":"Theft evidence (GeoJSON)","operationId":"evidence_geojson_api_v1_scooters__scooter_id__theft_evidence_geojson_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"scooter_id","in":"path","required":true,"schema":{"type":"integer","title":"Scooter Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/public/track/{token}":{"get":{"tags":["Theft"],"summary":"Public live tracking (no sign-in)","description":"Data behind the public tracking page. Works only while theft mode is on.","operationId":"public_track_api_v1_public_track__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["System"],"summary":"Liveness check (no auth)","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"AccountCreate":{"properties":{"provider":{"type":"string","enum":["apple","google","simulator","phone","traccar","gps"],"title":"Provider"},"label":{"type":"string","title":"Label","examples":["Fleet Apple ID #1"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Apple ID e-mail (Apple only)."},"secrets":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Secrets","description":"Contents of GoogleFindMyTools' `Auth/secrets.json` (Google only)."},"options":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Options","description":"Simulator options: `center` [lat, lon], `radius_m`."},"traccar":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Traccar","description":"Traccar server (GPS trackers): `url`, and `username` + `password` or `token`."},"poll_interval_s":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":30.0},{"type":"null"}],"title":"Poll Interval S"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["provider","label"],"title":"AccountCreate"},"AccountOut":{"properties":{"id":{"type":"integer","title":"Id"},"provider":{"type":"string","enum":["apple","google","simulator","phone","traccar","gps"],"title":"Provider"},"label":{"type":"string","title":"Label"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"status":{"type":"string","title":"Status","description":"pending, needs_2fa, needs_login, active, error, disabled"},"enabled":{"type":"boolean","title":"Enabled"},"poll_interval_s":{"type":"integer","title":"Poll Interval S"},"last_poll_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Poll At"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"tracker_count":{"type":"integer","title":"Tracker Count","default":0},"has_credentials":{"type":"boolean","title":"Has Credentials","default":false}},"type":"object","required":["id","provider","label","username","status","enabled","poll_interval_s","last_poll_at","last_success_at","last_error","consecutive_failures","notes","created_at"],"title":"AccountOut"},"AccountPatch":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"poll_interval_s":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":30.0},{"type":"null"}],"title":"Poll Interval S"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"secrets":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Secrets","description":"Replace Google secrets."},"traccar":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Traccar","description":"Replace Traccar login."}},"type":"object","title":"AccountPatch"},"ActivityBrief":{"properties":{"state":{"type":"string","title":"State"},"label":{"type":"string","title":"Label"},"icon":{"type":"string","title":"Icon"},"since":{"type":"string","format":"date-time","title":"Since"},"with_food":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"With Food"},"courier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier"},"courier_away_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Courier Away M"},"confidence":{"type":"string","title":"Confidence"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"scooter_moved":{"type":"boolean","title":"Scooter Moved"}},"type":"object","required":["state","label","icon","since","with_food","courier","courier_away_m","confidence","reason","scooter_moved"],"title":"ActivityBrief"},"ActivityOut":{"properties":{"id":{"type":"integer","title":"Id"},"state":{"type":"string","title":"State","description":"riding, stopped, picking_up, delivering, break, away, parked, no_data"},"label":{"type":"string","title":"Label"},"icon":{"type":"string","title":"Icon"},"since":{"type":"string","format":"date-time","title":"Since"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_s":{"type":"integer","title":"Duration S"},"courier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier"},"tracker_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tracker Id","description":"The courier's phone."},"with_food":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"With Food","description":"Whether the courier carries food (from the app's order status, or inferred). null = unknown."},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"courier_away_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Courier Away M","description":"Distance between courier and scooter."},"parked_lat":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Parked Lat"},"parked_lon":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Parked Lon"},"geofence_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Geofence Id","description":"Zone the scooter is parked in."},"confidence":{"type":"string","title":"Confidence","description":"high, medium or low"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"scooter_moved":{"type":"boolean","title":"Scooter Moved","description":"The tags report the scooter away from where it was parked while the courier is elsewhere (possible theft)."},"moved_m":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Moved M"}},"type":"object","required":["id","state","label","icon","since","ended_at","duration_s","courier","tracker_id","with_food","order_id","courier_away_m","parked_lat","parked_lon","geofence_id","confidence","reason","scooter_moved","moved_m"],"title":"ActivityOut"},"ApiKeyCreated":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"role":{"type":"string","enum":["admin","operator","viewer","device"],"title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"key":{"type":"string","title":"Key","description":"The full key. Shown only once; store it safely."}},"type":"object","required":["id","name","prefix","role","created_at","last_used_at","revoked_at","key"],"title":"ApiKeyCreated"},"ApiKeyIn":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name","examples":["Dispatch system"]},"role":{"type":"string","enum":["admin","operator","viewer","device"],"title":"Role","description":"What the key may do. `device` can only send courier-phone locations (for the courier app), `viewer` is read-only, `operator` can change scooters/tags/zones, `admin` everything.","default":"viewer"}},"type":"object","required":["name"],"title":"ApiKeyIn"},"ApiKeyOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"role":{"type":"string","enum":["admin","operator","viewer","device"],"title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","prefix","role","created_at","last_used_at","revoked_at"],"title":"ApiKeyOut"},"AppleImportResult":{"properties":{"created":{"items":{"$ref":"#/components/schemas/TrackerOut"},"type":"array","title":"Created"},"updated":{"items":{"$ref":"#/components/schemas/TrackerOut"},"type":"array","title":"Updated"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["created","updated","errors"],"title":"AppleImportResult"},"AppleLoginIn":{"properties":{"password":{"type":"string","title":"Password","description":"Apple ID password. Stored encrypted so the server can renew the session."}},"type":"object","required":["password"],"title":"AppleLoginIn"},"BatteryReplaced":{"properties":{"replaced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Replaced At","description":"Default: now"}},"type":"object","title":"BatteryReplaced"},"Body_import_apple_api_v1_trackers_import_apple_post":{"properties":{"account_id":{"type":"integer","title":"Account Id","description":"The Apple account that owns the tags"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"One or more of: the JSON made by `tools/export_apple_accessories.py`, FindMy.py accessory JSON, decrypted .plist, or encrypted .record files"},"beaconstore_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Beaconstore Key","description":"Hex BeaconStore key, needed only for encrypted .record files"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id","description":"Assign the imported tag(s) to this scooter"}},"type":"object","required":["account_id","files"],"title":"Body_import_apple_api_v1_trackers_import_apple_post"},"Body_upload_google_secrets_api_v1_accounts__account_id__google_secrets_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_google_secrets_api_v1_accounts__account_id__google_secrets_post"},"ChannelIn":{"properties":{"kind":{"type":"string","enum":["telegram","webhook","discord","slack","ntfy","email"],"title":"Kind"},"name":{"type":"string","title":"Name","examples":["Ops Telegram group"]},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Fields depend on `kind`; see `GET /notifications/channel-kinds`."},"min_severity":{"type":"string","enum":["info","warning","critical"],"title":"Min Severity","description":"Send events at or above.","default":"warning"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["kind","name","config"],"title":"ChannelIn"},"ChannelOut":{"properties":{"id":{"type":"integer","title":"Id"},"kind":{"type":"string","title":"Kind"},"name":{"type":"string","title":"Name"},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Secret fields are masked."},"min_severity":{"type":"string","enum":["info","warning","critical"],"title":"Min Severity"},"enabled":{"type":"boolean","title":"Enabled"},"last_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sent At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","name","config","min_severity","enabled","last_sent_at","last_error","created_at"],"title":"ChannelOut"},"ChannelPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Only the given fields change. Masked values (••••) are ignored."},"min_severity":{"anyOf":[{"type":"string","enum":["info","warning","critical"]},{"type":"null"}],"title":"Min Severity"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"ChannelPatch"},"ChannelTestOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["ok"],"title":"ChannelTestOut"},"DiscoveredTag":{"properties":{"external_id":{"type":"string","title":"External Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"already_added":{"type":"boolean","title":"Already Added","default":false},"tracker_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tracker Id"}},"type":"object","required":["external_id","name"],"title":"DiscoveredTag"},"EventOut":{"properties":{"id":{"type":"integer","title":"Id"},"kind":{"type":"string","title":"Kind"},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity"},"title":{"type":"string","title":"Title"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"tracker_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tracker Id"},"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"},"rule_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rule Id"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"notified":{"type":"boolean","title":"Notified"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At"},"acknowledged_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acknowledged By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","severity","title","message","scooter_id","tracker_id","account_id","rule_id","data","notified","acknowledged_at","acknowledged_by","created_at"],"title":"EventOut"},"EventPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EventOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"unacknowledged":{"type":"integer","title":"Unacknowledged"}},"type":"object","required":["items","total","unacknowledged"],"title":"EventPage"},"FusedLocation":{"properties":{"confidence":{"type":"integer","title":"Confidence","description":"0–100. 100 when at least two sources (Apple tag, Google tag, courier's phone) report the same place."},"confidence_level":{"type":"string","enum":["high","medium","low"],"title":"Confidence Level","description":"high ≥ 85, medium ≥ 50, low below."},"confidence_basis":{"type":"string","enum":["agree","roughly_agree","single","disagree"],"title":"Confidence Basis"},"confidence_reason":{"type":"string","title":"Confidence Reason","description":"Plain-language explanation."},"agreeing_sources":{"type":"integer","title":"Agreeing Sources","description":"How many sources agree (0 if none do)."},"lat":{"type":"number","title":"Lat"},"lon":{"type":"number","title":"Lon"},"accuracy_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy M"},"observed_at":{"type":"string","format":"date-time","title":"Observed At"},"age_s":{"type":"integer","title":"Age S","description":"Seconds since the report."},"source_tracker_id":{"type":"integer","title":"Source Tracker Id"},"source_provider":{"type":"string","title":"Source Provider"},"spread_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spread M","description":"Distance between the tags' last reports. A large value can mean one tag was removed."},"trackers_reporting":{"type":"integer","title":"Trackers Reporting"},"stale":{"type":"boolean","title":"Stale","description":"Older than the `fresh_after_s` setting.","default":false}},"type":"object","required":["confidence","confidence_level","confidence_basis","confidence_reason","agreeing_sources","lat","lon","accuracy_m","observed_at","age_s","source_tracker_id","source_provider","spread_m","trackers_reporting"],"title":"FusedLocation"},"GeofenceIn":{"properties":{"name":{"type":"string","title":"Name","examples":["Depot"]},"kind":{"type":"string","enum":["depot","restaurant","break_area","delivery_area","other"],"title":"Kind","description":"restaurant: stops here are pickups. depot: a scooter left here is dropped off. break_area: stops here are breaks.","default":"other"},"lat":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Lat"},"lon":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Lon"},"radius_m":{"type":"number","maximum":200000.0,"exclusiveMinimum":0.0,"title":"Radius M","examples":[250]},"color":{"type":"string","title":"Color","default":"#2563eb"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["name","lat","lon","radius_m"],"title":"GeofenceIn"},"GeofenceOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"lat":{"type":"number","title":"Lat"},"lon":{"type":"number","title":"Lon"},"radius_m":{"type":"number","title":"Radius M"},"color":{"type":"string","title":"Color"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"scooters_inside":{"type":"integer","title":"Scooters Inside","default":0}},"type":"object","required":["id","name","kind","lat","lon","radius_m","color","notes","created_at"],"title":"GeofenceOut"},"GeofencePatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"kind":{"anyOf":[{"type":"string","enum":["depot","restaurant","break_area","delivery_area","other"]},{"type":"null"}],"title":"Kind"},"lat":{"anyOf":[{"type":"number","maximum":90.0,"minimum":-90.0},{"type":"null"}],"title":"Lat"},"lon":{"anyOf":[{"type":"number","maximum":180.0,"minimum":-180.0},{"type":"null"}],"title":"Lon"},"radius_m":{"anyOf":[{"type":"number","maximum":200000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Radius M"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"GeofencePatch"},"GoogleLoginOut":{"properties":{"id":{"type":"string","title":"Id"},"state":{"type":"string","title":"State","description":"starting, signin, unlock, finishing, done, error, cancelled or expired"},"message":{"type":"string","title":"Message"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Page currently open in the sign-in browser."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"},"devices":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Devices"},"expires_in_s":{"type":"integer","title":"Expires In S"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["id","state","message","error","url","email","account_id","devices","expires_in_s","active"],"title":"GoogleLoginOut"},"GoogleLoginStart":{"properties":{"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id","description":"Re-connect this existing Google account. Leave empty to create a new one."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Name for a new account. Defaults to the Google e-mail address."}},"type":"object","title":"GoogleLoginStart"},"GpsPoint":{"properties":{"lat":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Lat"},"lon":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Lon"},"accuracy_m":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Accuracy M"},"recorded_at":{"type":"string","format":"date-time","title":"Recorded At"},"speed_mps":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Speed Mps"},"heading":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Heading"},"ignition":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ignition"}},"type":"object","required":["lat","lon","recorded_at"],"title":"GpsPoint"},"GpsReport":{"properties":{"device_id":{"type":"string","maxLength":64,"minLength":3,"title":"Device Id","description":"IMEI or another unique id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"battery":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Battery"},"points":{"items":{"$ref":"#/components/schemas/GpsPoint"},"type":"array","maxItems":1000,"title":"Points"}},"type":"object","required":["device_id","points"],"title":"GpsReport"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LocationOut":{"properties":{"id":{"type":"integer","title":"Id"},"tracker_id":{"type":"integer","title":"Tracker Id"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"provider":{"type":"string","title":"Provider"},"lat":{"type":"number","title":"Lat"},"lon":{"type":"number","title":"Lon"},"accuracy_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy M"},"observed_at":{"type":"string","format":"date-time","title":"Observed At","description":"When the tag was seen (UTC)."},"received_at":{"type":"string","format":"date-time","title":"Received At","description":"When this server received the report (UTC)."}},"type":"object","required":["id","tracker_id","scooter_id","provider","lat","lon","accuracy_m","observed_at","received_at"],"title":"LocationOut"},"LoginIn":{"properties":{"username":{"type":"string","title":"Username","examples":["admin"]},"password":{"type":"string","title":"Password","examples":["••••••••"]}},"type":"object","required":["username","password"],"title":"LoginIn"},"LoginOut":{"properties":{"user":{"$ref":"#/components/schemas/UserOut"},"token":{"type":"string","title":"Token","description":"Session token. Also set as the `xm_session` cookie. Send as `Authorization: Bearer <token>` from scripts."}},"type":"object","required":["user","token"],"title":"LoginOut"},"LoginStateOut":{"properties":{"state":{"type":"string","title":"State","description":"`logged_in`, `require_2fa` or another FindMy.py state."},"methods":{"items":{"$ref":"#/components/schemas/TwoFactorMethod"},"type":"array","title":"Methods","default":[]},"account":{"$ref":"#/components/schemas/AccountOut"}},"type":"object","required":["state","account"],"title":"LoginStateOut"},"Message":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","title":"Message"},"NearbyScooter":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"plate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plate"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"vin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vin"},"courier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier"},"status":{"type":"string","enum":["active","maintenance","retired"],"title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"theft_mode":{"type":"boolean","title":"Theft Mode","default":false},"theft_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Theft Started At"},"location":{"anyOf":[{"$ref":"#/components/schemas/FusedLocation"},{"type":"null"}]},"activity":{"anyOf":[{"$ref":"#/components/schemas/ActivityBrief"},{"type":"null"}],"description":"What the courier is doing; see the Activity endpoints."},"trackers":{"items":{"$ref":"#/components/schemas/TrackerBrief"},"type":"array","title":"Trackers","default":[]},"open_alerts":{"type":"integer","title":"Open Alerts","default":0},"distance_m":{"type":"number","title":"Distance M"}},"type":"object","required":["id","name","plate","model","color","vin","courier","status","notes","created_at","distance_m"],"title":"NearbyScooter"},"OrderIn":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Id","description":"Your order id."},"status":{"type":"string","title":"Status","description":"Order status as the app knows it: `assigned`, `at_restaurant`, `picked_up` (the courier has the food), `delivered`, `cancelled` or `none`.","examples":["picked_up"]},"pickup":{"anyOf":[{"$ref":"#/components/schemas/PlaceIn"},{"type":"null"}],"description":"Restaurant location."},"dropoff":{"anyOf":[{"$ref":"#/components/schemas/PlaceIn"},{"type":"null"}],"description":"Customer location."}},"type":"object","required":["status"],"title":"OrderIn"},"PasswordChange":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"PasswordChange"},"PhonePoint":{"properties":{"lat":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Lat"},"lon":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Lon"},"accuracy_m":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Accuracy M","description":"Horizontal accuracy (the phone's GPS reports it)."},"recorded_at":{"type":"string","format":"date-time","title":"Recorded At","description":"When the phone took the fix (ISO 8601, with time zone)."},"speed_mps":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Speed Mps"},"heading":{"anyOf":[{"type":"number","exclusiveMaximum":360.0,"minimum":0.0},{"type":"null"}],"title":"Heading"}},"type":"object","required":["lat","lon","recorded_at"],"title":"PhonePoint"},"PhoneReport":{"properties":{"device_id":{"type":"string","maxLength":128,"minLength":3,"title":"Device Id","description":"Stable id of the app installation (e.g. a UUID the app generates once).","examples":["9b2f6c1e-3e4a-4d5b-9b55-1f0a2c3d4e5f"]},"courier":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Courier","description":"Courier's name, shown in the dashboard.","examples":["Arben"]},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id","description":"The scooter the courier is riding. Send `null` when the shift ends. Leave the field out to keep the current assignment."},"scooter_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scooter Name","description":"Alternative to `scooter_id`: the scooter's name or number plate (e.g. from a QR code on the scooter)."},"battery":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Battery","description":"Phone battery %."},"shift":{"anyOf":[{"type":"string","pattern":"^(on|off|break)$"},{"type":"null"}],"title":"Shift","description":"Shift state in the app: `on`, `break` or `off`. Optional; improves the activity (break / scooter dropped off)."},"order":{"anyOf":[{"$ref":"#/components/schemas/OrderIn"},{"type":"null"}],"description":"The courier's current order, if any. Optional; tells whether the courier has food. Send `{\"status\": \"none\"}` when there is no order."},"points":{"items":{"$ref":"#/components/schemas/PhonePoint"},"type":"array","maxItems":500,"title":"Points","description":"GPS fixes since the last upload, any order. Can be empty (just updates the assignment)."}},"type":"object","required":["device_id"],"title":"PhoneReport"},"PhoneReportOut":{"properties":{"tracker_id":{"type":"integer","title":"Tracker Id"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"accepted":{"type":"integer","title":"Accepted"},"ignored":{"type":"integer","title":"Ignored"}},"type":"object","required":["tracker_id","scooter_id","accepted","ignored"],"title":"PhoneReportOut"},"PlaceIn":{"properties":{"lat":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Lat"},"lon":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Lon"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["lat","lon"],"title":"PlaceIn"},"PollResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"stored":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stored"},"trackers":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trackers"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["ok"],"title":"PollResult"},"RuleIn":{"properties":{"name":{"type":"string","title":"Name"},"kind":{"type":"string","enum":["stale_location","tracker_silent","tracker_mismatch","geofence_exit","geofence_enter","movement_after_hours","account_error","moved_without_courier","long_break","scooter_unattended","tag_battery","tag_health"],"title":"Kind"},"params":{"additionalProperties":true,"type":"object","title":"Params","description":"See `GET /notifications/rule-kinds`."},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity","default":"warning"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id","description":"Limit to one scooter; empty means all."},"enabled":{"type":"boolean","title":"Enabled","default":true},"cooldown_s":{"type":"integer","minimum":0.0,"title":"Cooldown S","description":"Remind every N seconds while still firing. 0 = only once.","default":0}},"type":"object","required":["name","kind"],"title":"RuleIn"},"RuleOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"enabled":{"type":"boolean","title":"Enabled"},"cooldown_s":{"type":"integer","title":"Cooldown S"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"firing":{"type":"integer","title":"Firing","description":"How many subjects are currently firing.","default":0}},"type":"object","required":["id","name","kind","params","severity","scooter_id","enabled","cooldown_s","created_at"],"title":"RuleOut"},"RulePatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"},"severity":{"anyOf":[{"type":"string","enum":["info","warning","critical"]},{"type":"null"}],"title":"Severity"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"cooldown_s":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Cooldown S"}},"type":"object","title":"RulePatch"},"ScooterActivity":{"properties":{"scooter_id":{"type":"integer","title":"Scooter Id"},"scooter":{"type":"string","title":"Scooter"},"activity":{"anyOf":[{"$ref":"#/components/schemas/ActivityOut"},{"type":"null"}]}},"type":"object","required":["scooter_id","scooter","activity"],"title":"ScooterActivity"},"ScooterIn":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name","examples":["SC-014"]},"plate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plate","examples":["01-123-AB"]},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","examples":["Honda PCX 125"]},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"vin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vin"},"courier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier","description":"Courier currently using it."},"status":{"type":"string","enum":["active","maintenance","retired"],"title":"Status","default":"active"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["name"],"title":"ScooterIn"},"ScooterOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"plate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plate"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"vin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vin"},"courier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier"},"status":{"type":"string","enum":["active","maintenance","retired"],"title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"theft_mode":{"type":"boolean","title":"Theft Mode","default":false},"theft_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Theft Started At"},"location":{"anyOf":[{"$ref":"#/components/schemas/FusedLocation"},{"type":"null"}]},"activity":{"anyOf":[{"$ref":"#/components/schemas/ActivityBrief"},{"type":"null"}],"description":"What the courier is doing; see the Activity endpoints."},"trackers":{"items":{"$ref":"#/components/schemas/TrackerBrief"},"type":"array","title":"Trackers","default":[]},"open_alerts":{"type":"integer","title":"Open Alerts","default":0}},"type":"object","required":["id","name","plate","model","color","vin","courier","status","notes","created_at"],"title":"ScooterOut"},"ScooterPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plate"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"vin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vin"},"courier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier"},"status":{"anyOf":[{"type":"string","enum":["active","maintenance","retired"]},{"type":"null"}],"title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"ScooterPatch"},"Stats":{"properties":{"scooters":{"type":"integer","title":"Scooters"},"scooters_active":{"type":"integer","title":"Scooters Active"},"scooters_located":{"type":"integer","title":"Scooters Located"},"scooters_fresh":{"type":"integer","title":"Scooters Fresh"},"trackers":{"type":"integer","title":"Trackers"},"trackers_reporting":{"type":"integer","title":"Trackers Reporting"},"accounts":{"type":"integer","title":"Accounts"},"accounts_ok":{"type":"integer","title":"Accounts Ok"},"open_alerts":{"type":"integer","title":"Open Alerts"},"unacknowledged_events":{"type":"integer","title":"Unacknowledged Events"},"locations_24h":{"type":"integer","title":"Locations 24H"},"by_provider":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Provider"}},"type":"object","required":["scooters","scooters_active","scooters_located","scooters_fresh","trackers","trackers_reporting","accounts","accounts_ok","open_alerts","unacknowledged_events","locations_24h","by_provider"],"title":"Stats"},"TelegramChatsIn":{"properties":{"bot_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Token","description":"Token to use. Omit to use the token stored on `channel_id`."},"channel_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Channel Id"}},"type":"object","title":"TelegramChatsIn"},"TheftEnd":{"properties":{"outcome":{"type":"string","enum":["recovered","false_alarm","lost"],"title":"Outcome","default":"recovered"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","title":"TheftEnd"},"TheftStart":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","examples":["Stolen outside Pizza Gjilan, reported to police"]}},"type":"object","title":"TheftStart"},"TrackerBrief":{"properties":{"id":{"type":"integer","title":"Id"},"provider":{"type":"string","title":"Provider"},"label":{"type":"string","title":"Label"},"enabled":{"type":"boolean","title":"Enabled"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"last_accuracy_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Accuracy M"}},"type":"object","required":["id","provider","label","enabled","last_seen_at","last_accuracy_m"],"title":"TrackerBrief"},"TrackerCreate":{"properties":{"account_id":{"type":"integer","title":"Account Id"},"external_id":{"type":"string","title":"External Id","description":"Google canonic id (from `GET /accounts/{id}/discover`) or a simulator id. Apple tags are added with the import endpoint."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","required":["account_id","external_id"],"title":"TrackerCreate"},"TrackerOut":{"properties":{"id":{"type":"integer","title":"Id"},"account_id":{"type":"integer","title":"Account Id"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id"},"provider":{"type":"string","title":"Provider"},"label":{"type":"string","title":"Label"},"external_id":{"type":"string","title":"External Id","description":"Apple accessory identifier or Google canonic id."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"serial_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Serial Number"},"enabled":{"type":"boolean","title":"Enabled"},"battery":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Battery"},"battery_reported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Battery Reported At"},"battery_replaced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Battery Replaced At"},"last_lat":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Lat"},"last_lon":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Lon"},"last_accuracy_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Accuracy M"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Checked At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","account_id","scooter_id","provider","label","external_id","model","serial_number","enabled","battery","last_lat","last_lon","last_accuracy_m","last_seen_at","last_checked_at","created_at"],"title":"TrackerOut"},"TrackerPatch":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"scooter_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scooter Id","description":"Assign to a scooter. Send `0` to unassign."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"battery":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Battery"}},"type":"object","title":"TrackerPatch"},"TwoFactorMethod":{"properties":{"index":{"type":"integer","title":"Index"},"type":{"type":"string","enum":["sms","trusted_device"],"title":"Type"},"label":{"type":"string","title":"Label"}},"type":"object","required":["index","type","label"],"title":"TwoFactorMethod"},"TwoFactorRequestIn":{"properties":{"method":{"type":"integer","title":"Method","description":"Index from the `methods` list.","default":0}},"type":"object","title":"TwoFactorRequestIn"},"TwoFactorSubmitIn":{"properties":{"method":{"type":"integer","title":"Method","default":0},"code":{"type":"string","maxLength":12,"minLength":4,"title":"Code","examples":["123456"]}},"type":"object","required":["code"],"title":"TwoFactorSubmitIn"},"UserIn":{"properties":{"username":{"type":"string","maxLength":64,"minLength":2,"title":"Username"},"password":{"type":"string","minLength":8,"title":"Password"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","enum":["admin","operator","viewer"],"title":"Role","default":"operator"}},"type":"object","required":["username","password"],"title":"UserIn"},"UserOut":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","enum":["admin","operator","viewer"],"title":"Role"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"}},"type":"object","required":["id","username","full_name","role","is_active","created_at","last_login_at"],"title":"UserOut"},"UserPatch":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"anyOf":[{"type":"string","enum":["admin","operator","viewer"]},{"type":"null"}],"title":"Role"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"password":{"anyOf":[{"type":"string","minLength":8},{"type":"null"}],"title":"Password"}},"type":"object","title":"UserPatch"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Session token from `POST /auth/login`, or an API key.","scheme":"bearer"},"APIKeyHeader":{"type":"apiKey","description":"API key created in the dashboard (Settings → API keys).","in":"header","name":"X-API-Key"}}},"tags":[{"name":"Scooters","description":"Vehicles, their fused position, history and search."},{"name":"Trackers","description":"Individual tags. Each belongs to one account and can be assigned to one scooter."},{"name":"Activity","description":"What each courier is doing: riding, picking up food, delivering, on a break, scooter dropped off. Inferred from the gap between the courier's phone and the scooter's tags, the zone, the time and the order status."},{"name":"Theft","description":"Theft mode: faster polling, an alert for every position, a public live-tracking link and an evidence export."},{"name":"GPS trackers","description":"4G GPS trackers, through a Traccar server (forwarding or polling) or posting directly."},{"name":"Courier phones","description":"The courier app sends its GPS here: the third location source, next to the two tags."},{"name":"Accounts","description":"Apple IDs and Google accounts that own the tags, including the Apple sign-in / 2FA flow."},{"name":"Zones","description":"Circular geofences used by alert rules."},{"name":"Notifications","description":"Where alerts go (channels) and what triggers them (rules)."},{"name":"Events","description":"The log of alerts and changes."},{"name":"System","description":"Overview numbers, settings, live stream, status."},{"name":"Auth","description":"Sign-in for people."},{"name":"Users","description":"Dashboard users (admin only)."},{"name":"API keys","description":"Keys for other programs (admin only)."}]}