{"openapi":"3.1.0","info":{"title":"LAKI Ops API","version":"1.0.0","description":"REST API for a driver's or fleet's own scripts and AI agents. Every call is written to the audit log. Money and hours-of-service changes are not available here; they need a person's yes in the app. Rate limit: 240 requests per minute per key.","contact":{"name":"Like A King Inc.","url":"https://lakiops.com/contact?topic=support"},"termsOfService":"https://lakiops.com/terms"},"externalDocs":{"description":"Guide for AI agents","url":"https://lakiops.com/agents"},"servers":[{"url":"https://lakiops.com/api/v1"}],"security":[{"bearer":[]}],"paths":{"/me":{"get":{"summary":"Who this key belongs to: user, role, company and key name","description":"Needs the driver:read or fleet:read scope.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loads":{"get":{"summary":"List loads the key can see","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"status","in":"query","description":"Filter by load status","required":false,"schema":{"type":"string"}},{"name":"active","in":"query","description":"1 or true for active loads only","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loads/{id}":{"get":{"summary":"One load with stops and references","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"id","in":"path","description":"Load id (UUID)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loads/{id}/detention":{"get":{"summary":"Detention clock and claim status for a load","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"id","in":"path","description":"Load id (UUID)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loads/{id}/appointment":{"get":{"summary":"Will the driver make the appointment, given position and hours left","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"id","in":"path","description":"Load id (UUID)","required":true,"schema":{"type":"string"}},{"name":"lat","in":"query","description":"Current latitude","required":false,"schema":{"type":"string"}},{"name":"lng","in":"query","description":"Current longitude","required":false,"schema":{"type":"string"}},{"name":"hosDriveMinutesLeft","in":"query","description":"Drive minutes left","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loads/{id}/eta":{"get":{"summary":"ETA to the next or a given stop","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"id","in":"path","description":"Load id (UUID)","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"query","description":"Stop id","required":false,"schema":{"type":"string"}},{"name":"lat","in":"query","description":"Current latitude","required":false,"schema":{"type":"string"}},{"name":"lng","in":"query","description":"Current longitude","required":false,"schema":{"type":"string"}},{"name":"hosDriveMinutesLeft","in":"query","description":"Drive minutes left","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loads/{id}/route":{"get":{"summary":"Truck route plan for a load","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"id","in":"path","description":"Load id (UUID)","required":true,"schema":{"type":"string"}},{"name":"lat","in":"query","description":"Start latitude","required":false,"schema":{"type":"string"}},{"name":"lng","in":"query","description":"Start longitude","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/stops/{id}/events":{"get":{"summary":"Arrival and departure events for a stop","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"id","in":"path","description":"Stop id (UUID)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Record an arrival or departure (driver keys only)","description":"Needs the driver:act or fleet:act scope.","parameters":[{"name":"id","in":"path","description":"Stop id (UUID)","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"enum":["arrive","depart"]},"lat":{"type":"number"},"lng":{"type":"number"},"at":{"type":"string","format":"date-time","description":"Within 6 hours of now"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/documents":{"get":{"summary":"Papers on file, optionally for one load","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"loadId","in":"query","description":"Load id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/messages":{"get":{"summary":"Inbox messages","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"driverId","in":"query","description":"Driver id (fleet keys)","required":false,"schema":{"type":"string"}},{"name":"loadId","in":"query","description":"Load id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Send a message in the LAKI Ops inbox","description":"Needs the driver:act or fleet:act scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string"},"loadId":{"type":"string"},"driverId":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/hos":{"get":{"summary":"Hours-of-service clocks and violations (LAKI Ops duty records, not a registered ELD)","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"driverId","in":"query","description":"Required for fleet keys","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/compliance":{"get":{"summary":"Licence, medical card and paper expiry status","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"driverId","in":"query","description":"Driver id (fleet keys)","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/equipment":{"get":{"summary":"Truck and trailer for a load","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"loadId","in":"query","description":"Load id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/fmcsa":{"get":{"summary":"Public FMCSA carrier lookup","description":"Needs the driver:read or fleet:read scope.","parameters":[{"name":"usdot","in":"query","description":"USDOT number","required":false,"schema":{"type":"string"}},{"name":"mc","in":"query","description":"MC number","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/feedback":{"post":{"summary":"Report a docs error, missing thing, bug or idea. No key needed; 20 per hour per address.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","message"],"properties":{"kind":{"enum":["docs_error","missing","bug","idea","praise"]},"message":{"type":"string","maxLength":4000},"page":{"type":"string"},"agent":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key (laki_...) made in the app, or an OAuth access token from https://lakiops.com/.well-known/oauth-authorization-server"}},"schemas":{"Data":{"type":"object","properties":{"data":{}}},"Ok":{"type":"object","properties":{"ok":{"type":"boolean"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}