{"openapi":"3.1.0","info":{"title":"Manifest Portal API","version":"1.0.0","summary":"Read open trips and suggest Personal or Business.","description":"A portal key (mf_live_…) lets a server-side agent read unfiled trips and suggest Personal or Business. Suggestions wait in the app for a person. POST /trips/{id}/file writes the mileage log — only if you mean it. This API never talks to the car and never wakes a Tesla. Do not put a key in a browser app."},"servers":[{"url":"https://drivemanifest.com/api/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Account"},{"name":"Trips"},{"name":"Places"},{"name":"Vehicles"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"mf_live_","description":"Portal key from Settings. Starts with mf_live_. Shown once. Send as Authorization: Bearer."}},"schemas":{"Trip":{"type":"object","properties":{"id":{"type":"integer"},"vehicleId":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"start":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"end":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"miles":{"type":"number"},"kwh":{"type":"number"},"category":{"type":["string","null"],"enum":["personal","business",null]},"suggestion":{"type":["object","null"],"properties":{"category":{"type":"string","enum":["personal","business"]},"reason":{"type":["string","null"]},"confidence":{"type":["number","null"]}}}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}},"paths":{"/me":{"get":{"tags":["Account"],"summary":"Account snapshot","description":"Mileage rate, vehicle and trip counts, and whether you classify with a bot or Remember last.","responses":{"200":{"description":"Account snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"classifier":{"type":"string","enum":["bot","remember_last"]},"mileageRate":{"type":"number"},"vehicles":{"type":"integer"},"trips":{"type":"integer"},"open":{"type":"integer"}}}}}},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}},"/trips":{"get":{"tags":["Trips"],"summary":"List trips","description":"Unfiled trips waiting for a Personal or Business label. status=open (default), filed, or all. Up to 200.","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["open","filed","all"],"default":"open"},"description":"open = still needs a label. filed = already labeled. all = both."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Trip list","content":{"application/json":{"schema":{"type":"object","properties":{"trips":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"vehicleId":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"start":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"end":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"miles":{"type":"number"},"kwh":{"type":"number"},"category":{"type":["string","null"],"enum":["personal","business",null]},"suggestion":{"type":["object","null"],"properties":{"category":{"type":"string","enum":["personal","business"]},"reason":{"type":["string","null"]},"confidence":{"type":["number","null"]}}}}}}}}}}},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}},"/trips/{id}":{"get":{"tags":["Trips"],"summary":"One trip","description":"Start, end, miles, current label, and any pending suggestion. Does not change the trip.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Trip","content":{"application/json":{"schema":{"type":"object","properties":{"trip":{"type":"object","properties":{"id":{"type":"integer"},"vehicleId":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"start":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"end":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"miles":{"type":"number"},"kwh":{"type":"number"},"category":{"type":["string","null"],"enum":["personal","business",null]},"suggestion":{"type":["object","null"],"properties":{"category":{"type":"string","enum":["personal","business"]},"reason":{"type":["string","null"]},"confidence":{"type":["number","null"]}}}}}}}}}},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"404":{"description":"Unknown trip","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}},"/trips/{id}/suggest":{"post":{"tags":["Trips"],"summary":"Suggest a label (does not file)","description":"Propose Personal or Business. It waits in the app for you to review. Does not write the mileage log.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["category"],"properties":{"category":{"type":"string","enum":["personal","business"]},"reason":{"type":"string","maxLength":180},"confidence":{"type":"number","minimum":0,"maximum":1}}}}}},"responses":{"200":{"description":"Updated trip with suggestion","content":{"application/json":{"schema":{"type":"object","properties":{"trip":{"type":"object","properties":{"id":{"type":"integer"},"vehicleId":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"start":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"end":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"miles":{"type":"number"},"kwh":{"type":"number"},"category":{"type":["string","null"],"enum":["personal","business",null]},"suggestion":{"type":["object","null"],"properties":{"category":{"type":"string","enum":["personal","business"]},"reason":{"type":["string","null"]},"confidence":{"type":["number","null"]}}}}}}}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"403":{"description":"Trip is already filed. Suggest only works on open trips.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"404":{"description":"Unknown trip","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}},"/trips/{id}/file":{"post":{"tags":["Trips"],"summary":"File a label","description":"Writes Personal or Business on the mileage log. Only call this if the bot should file without a person reviewing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["category"],"properties":{"category":{"type":"string","enum":["personal","business"]}}}}}},"responses":{"200":{"description":"Filed trip","content":{"application/json":{"schema":{"type":"object","properties":{"trip":{"type":"object","properties":{"id":{"type":"integer"},"vehicleId":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"start":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"end":{"type":"object","properties":{"label":{"type":"string"},"placeId":{"type":["integer","null"]},"lat":{"type":"number"},"lng":{"type":"number"}}},"miles":{"type":"number"},"kwh":{"type":"number"},"category":{"type":["string","null"],"enum":["personal","business",null]},"suggestion":{"type":["object","null"],"properties":{"category":{"type":"string","enum":["personal","business"]},"reason":{"type":["string","null"]},"confidence":{"type":["number","null"]}}}}}}}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"404":{"description":"Unknown trip","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}},"/places":{"get":{"tags":["Places"],"summary":"Destinations","description":"Home, Work, and places Manifest has learned. Destinations only — not a live car location.","responses":{"200":{"description":"Destinations"},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}},"/vehicles":{"get":{"tags":["Vehicles"],"summary":"Vehicles","description":"Cars on the account. VIN last four only. Does not wake or query the car.","responses":{"200":{"description":"Vehicles"},"401":{"description":"Missing, unknown, or revoked key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests. Wait and retry; see Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","invalid","not_found","method_not_allowed","rate_limited","server_error"]},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message"]}}}}}}}}}}}