{"info":{"title":"Routeta API","version":"1.0.0","description":"Send orders to Routeta and read published plans.\n\nAuthenticate with `Authorization: Bearer rk_live_…`. Keys are made by an owner or admin under\nSettings → API keys and carry scopes (orders:read, orders:write, customers:write, plans:read).\nEvery answer is `{ success, data, error, meta }`. Errors carry a stable `error.code`.\nLimit: 120 requests a minute per key (HTTP 429 `RATE_LIMITED` with `Retry-After`)."},"servers":[{"url":"/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key, rk_live_…"}},"schemas":{"Error":{"type":"object","properties":{"success":{"const":false},"data":{"type":"null"},"error":{"type":"object","properties":{"code":{"enum":["UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","VALIDATION_FAILED","CONFLICT","PLAN_VERSION_CONFLICT","PUBLISH_BLOCKED","ENGINE_UNAVAILABLE","SOLVER_RESULT_INVALID","GEOCODER_UNAVAILABLE","RATE_LIMITED","LINK_EXPIRED","STOP_HAS_EVENTS","STOP_ALREADY_WORKED","READ_ONLY","VAN_LIMIT","BILLING_UNAVAILABLE","INTERNAL"],"type":"string"},"message":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"]},"meta":{"type":"null"}},"required":["success","data","error","meta"]}}},"openapi":"3.1.1","paths":{"/orders/batch":{"post":{"operationId":"orders.batch","summary":"Create or update orders in bulk","description":"Up to 500 orders by externalRef, with their customers and locations. One result per item. Send an Idempotency-Key header to make a retry safe for 24 hours.","tags":["Orders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":100},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"customer":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"location":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":200},"addressLine":{"type":"string","minLength":1,"maxLength":200},"postalCode":{"type":"string","maxLength":20},"city":{"type":"string","maxLength":120},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"required":["addressLine"],"additionalProperties":false},"demand":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"additionalProperties":{"type":"integer","minimum":0,"maximum":1000000}},"window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"windows":{"anyOf":[{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["externalRef","date","customer","location"],"additionalProperties":false}}},"required":["items"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"outcome":{"enum":["created","updated","skipped","failed"],"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["path","message"]}},"orderId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"geocodeStatus":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["index","outcome","code","orderId","locationId","geocodeStatus"]}},"counts":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"}},"required":["created","updated","skipped","failed"]}},"required":["results","counts"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}},"headers":{"Idempotent-Replay":{"description":"`true` when this is the stored answer of an earlier request with the same key","schema":{"type":"string","enum":["true"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"1 to 100 printable characters; a retry with the same key and body within 24 hours gets the stored answer.","schema":{"type":"string","minLength":1,"maxLength":100}}]}},"/orders":{"get":{"operationId":"orders.list","summary":"List orders","tags":["Orders"],"parameters":[{"name":"date","in":"query","schema":{"type":"string","format":"date"},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"enum":["open","planned","dispatched","delivered","failed","cancelled"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"externalRef","in":"query","schema":{"type":"string","minLength":1,"maxLength":100},"allowEmptyValue":true,"allowReserved":true},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["open","planned","dispatched","delivered","failed","cancelled"],"type":"string"},"date":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","externalRef","name"]},"location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"addressLine":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"geocodeStatus":{"enum":["pending","ok","approximate","failed","manual"],"type":"string"}},"required":["id","externalRef","name","addressLine","postalCode","city","country","geocodeStatus"]},"demand":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"windows":{"anyOf":[{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},{"type":"null"}]},"priority":{"enum":["normal","must_go"],"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"}},"required":["id","externalRef","status","date","customer","location","demand","windows","priority","notes","source"]}},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"orders:read"}},"/orders/{id}":{"get":{"operationId":"orders.get","summary":"Get an order","tags":["Orders"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["open","planned","dispatched","delivered","failed","cancelled"],"type":"string"},"date":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","externalRef","name"]},"location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"addressLine":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"geocodeStatus":{"enum":["pending","ok","approximate","failed","manual"],"type":"string"}},"required":["id","externalRef","name","addressLine","postalCode","city","country","geocodeStatus"]},"demand":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"windows":{"anyOf":[{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},{"type":"null"}]},"priority":{"enum":["normal","must_go"],"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"}},"required":["id","externalRef","status","date","customer","location","demand","windows","priority","notes","source"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"orders:read"},"patch":{"operationId":"orders.patch","summary":"Change an order","tags":["Orders"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","format":"date"},"demand":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"additionalProperties":{"type":"integer","minimum":0,"maximum":1000000}},"window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"windows":{"anyOf":[{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"priority":{"enum":["normal","must_go"],"type":"string"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["open","planned","dispatched","delivered","failed","cancelled"],"type":"string"},"date":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","externalRef","name"]},"location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"addressLine":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"geocodeStatus":{"enum":["pending","ok","approximate","failed","manual"],"type":"string"}},"required":["id","externalRef","name","addressLine","postalCode","city","country","geocodeStatus"]},"demand":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"windows":{"anyOf":[{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},{"type":"null"}]},"priority":{"enum":["normal","must_go"],"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"}},"required":["id","externalRef","status","date","customer","location","demand","windows","priority","notes","source"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"orders:write"},"delete":{"operationId":"orders.cancel","summary":"Cancel an order","description":"Cancels an open order that is not in a published plan; answers the cancelled order.","tags":["Orders"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["open","planned","dispatched","delivered","failed","cancelled"],"type":"string"},"date":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","externalRef","name"]},"location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"addressLine":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"geocodeStatus":{"enum":["pending","ok","approximate","failed","manual"],"type":"string"}},"required":["id","externalRef","name","addressLine","postalCode","city","country","geocodeStatus"]},"demand":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"windows":{"anyOf":[{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},{"type":"null"}]},"priority":{"enum":["normal","must_go"],"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"}},"required":["id","externalRef","status","date","customer","location","demand","windows","priority","notes","source"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"orders:write"}},"/customers/batch":{"post":{"operationId":"customers.batch","summary":"Create or update customers in bulk","description":"Up to 500 customers with up to 20 locations each, by externalRef. One result per item. Send an Idempotency-Key header to make a retry safe for 24 hours.","tags":["Customers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":200},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"locations":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","maxLength":200},"addressLine":{"type":"string","minLength":1,"maxLength":200},"postalCode":{"type":"string","maxLength":20},"city":{"type":"string","maxLength":120},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"required":["addressLine"],"additionalProperties":false}}},"required":["name"],"additionalProperties":false}}},"required":["items"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"outcome":{"enum":["created","updated","failed"],"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["path","message"]}},"customerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"locationId":{"type":"string","format":"uuid"},"outcome":{"enum":["created","updated"],"type":"string"},"geocodeStatus":{"type":"string"}},"required":["locationId","outcome","geocodeStatus"]}}},"required":["index","outcome","code","customerId","locations"]}},"counts":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"}},"required":["created","updated","skipped","failed"]}},"required":["results","counts"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}},"headers":{"Idempotent-Replay":{"description":"`true` when this is the stored answer of an earlier request with the same key","schema":{"type":"string","enum":["true"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"customers:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"1 to 100 printable characters; a retry with the same key and body within 24 hours gets the stored answer.","schema":{"type":"string","minLength":1,"maxLength":100}}]}},"/plans/{date}":{"get":{"operationId":"plans.get","summary":"The published plan of a day","description":"Routes and stops as last published, with each stop's status. NOT_FOUND until published.","tags":["Plans"],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"date":{"type":"string"},"publishedVersion":{"type":"number"},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"vehicle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","number","name"]},"driver":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"shiftStart":{"type":"string"},"shiftEnd":{"type":"string"},"stops":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"position":{"type":"number"},"order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","externalRef"]},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","externalRef","name"]},"location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"addressLine":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","externalRef","name","addressLine","postalCode","city","country","lat","lng"]},"plannedArrival":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedServiceStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDeparture":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"actualArrival":{"anyOf":[{"type":"string"},{"type":"null"}]},"actualDeparture":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","position","order","customer","location","plannedArrival","plannedServiceStart","plannedDeparture","windowStart","windowEnd","status","actualArrival","actualDeparture"]}}},"required":["id","vehicle","driver","shiftStart","shiftEnd","stops"]}}},"required":["id","date","publishedVersion","publishedAt","routes"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"plans:read"}},"/stops/{id}":{"get":{"operationId":"stops.get","summary":"A stop of a published plan","description":"Status, planned and actual times of one stop of a published plan.","tags":["Plans"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"position":{"type":"number"},"order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","externalRef"]},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","externalRef","name"]},"location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"addressLine":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","externalRef","name","addressLine","postalCode","city","country","lat","lng"]},"plannedArrival":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedServiceStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDeparture":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"actualArrival":{"anyOf":[{"type":"string"},{"type":"null"}]},"actualDeparture":{"anyOf":[{"type":"string"},{"type":"null"}]},"planDate":{"type":"string"},"routeId":{"type":"string","format":"uuid"},"proofs":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"]}}},"required":["id","position","order","customer","location","plannedArrival","plannedServiceStart","plannedDeparture","windowStart","windowEnd","status","actualArrival","actualDeparture","planDate","routeId","proofs"]},"error":{"type":"null"},"meta":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["total","page","limit"]},{"type":"null"}]}},"required":["success","data","error","meta"]}}}},"400":{"description":"VALIDATION_FAILED: the input, `details.issues` names the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHENTICATED: no valid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN: the key lacks the scope (`details.scope`) or the database refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND: nothing of that id in the key's organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT: see `details.reason`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"RATE_LIMITED: `Retry-After` header and `details.retryAfterSeconds`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL: unexpected error; details only in the server log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-rondo-scope":"plans:read"}}}}