{"openapi":"3.1.0","info":{"title":"Regsta Public API","version":"1.0.0","description":"Read-only, versioned REST API for time-registration data. Authenticate with a tenant-scoped API key (Bearer). Cursor pagination and a consistent error envelope."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Tenant-scoped API key. New keys use rk_live_<24 hex>.<64 hex>."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"NOT_FOUND"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"]}}},"Pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}}},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fullName":{"type":"string"},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]},"employeeNumber":{"type":["string","null"]},"isActive":{"type":"boolean"},"hasLogin":{"type":"boolean"},"latestShift":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date"},"status":{"type":["string","null"]}}},{"type":"null"}]}}},"Shift":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"employeeName":{"type":"string"},"date":{"type":"string","format":"date"},"startTime":{"type":["string","null"],"format":"date-time"},"endTime":{"type":["string","null"],"format":"date-time"},"pauseMinutes":{"type":"integer"},"workMinutes":{"type":["integer","null"]},"source":{"type":"string"},"status":{"type":"string"},"version":{"type":"integer"}}},"PlannedShift":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"employee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"department":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"vehicle":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":["string","null"]}},"required":["id","label"]},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"breakMinutes":{"type":"integer","minimum":0},"title":{"type":["string","null"]},"status":{"type":"string","enum":["published","cancelled"]},"version":{"type":"integer","minimum":1},"publishedAt":{"type":["string","null"],"format":"date-time"},"cancelledAt":{"type":["string","null"],"format":"date-time"}},"required":["id","employee","department","vehicle","startsAt","endsAt","breakMinutes","title","status","version","publishedAt","cancelledAt"]}},"parameters":{"limit":{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},"cursor":{"name":"cursor","in":"query","schema":{"type":"string"}}},"headers":{"RequestId":{"description":"Request correlation identifier for support and diagnostics.","schema":{"type":"string","format":"uuid"}}}},"security":[{"apiKey":[]}],"paths":{"/health":{"get":{"summary":"Service + API version","security":[],"responses":{"200":{"description":"OK"}}}},"/employees":{"get":{"summary":"List employees, including configured contact details","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"Employees and configured contact details, keyset-paginated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing employees:read scope"}}}},"/shifts":{"get":{"summary":"List time records","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Time records, keyset-paginated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Shift"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing shifts:read scope"},"422":{"description":"Invalid date range"}}}},"/schedule":{"get":{"summary":"List published and cancelled planned shifts","description":"Returns a privacy-minimized schedule projection. Drafts, internal notes, cancellation reasons and vehicle registration plates are excluded. Date boundaries use the company's calendar.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"from","in":"query","description":"First included company-calendar date; defaults to today.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"Last included company-calendar date; defaults to 13 days after today. The inclusive range may not exceed 61 days.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Published and cancelled planned shifts, keyset-paginated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlannedShift"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]}}}},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing schedule:read scope or scheduling is disabled"},"404":{"description":"Company not found"},"422":{"description":"Invalid date range or cursor"}}}}}}