{"info":{"title":"eTime API","version":"1.0.0","description":"Rosters, shifts, people and leave in eTime, for your own scripts and tools. Authenticate with an API key from Account → API keys, sent as `Authorization: Bearer etk_…`. A key acts as you, with your role and units; a read key can only read."},"servers":[{"url":"https://api.etime.my/v1/api"}],"tags":[{"name":"Account","description":"Who the key acts as."},{"name":"Units","description":"Sites and units."},{"name":"Rosters","description":"Roster periods, shifts, assignments and versions."},{"name":"People","description":"People and job roles."},{"name":"Rules","description":"Labour law, agreement and house rules."},{"name":"Shift offers","description":"Open shifts offered to staff."},{"name":"Swaps","description":"Shift swaps between staff."},{"name":"Leave and absence","description":"Sickness, leave and summer holidays."},{"name":"Time","description":"Planned and worked hours."},{"name":"Meetings","description":"Meetings you are in."},{"name":"Insights","description":"Fairness and open problems."}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"etk_live_…","description":"An API key from Account → API keys."}},"schemas":{"Error":{"type":"object","description":"Every error has the same shape. `message` is plain English you can show to people.","properties":{"code":{"type":"string","examples":["FORBIDDEN"]},"status":{"type":"integer","examples":[403]},"message":{"type":"string","examples":["Your role (employee) cannot do that."]},"data":{}},"required":["code","status","message"]}}},"security":[{"apiKey":[]}],"openapi":"3.1.1","paths":{"/me":{"get":{"operationId":"me","summary":"Who you are","description":"The member the key acts as: role, workplace, and what that role may do.","tags":["Account"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"memberId":{"type":"string"},"orgId":{"type":"string"},"role":{"enum":["owner","admin","scheduler","manager","employee","viewer","payroll","representative"],"type":"string"},"personId":{"anyOf":[{"type":"string"},{"type":"null"}]},"can":{"type":"array","items":{"enum":["roster.read","roster.edit","roster.publish","pay.read","people.read","people.edit","roles.edit","rules.edit","members.manage","billing.manage","budget.edit","settings.manage","audit.read","overview.read"],"type":"string"}},"hasPasskey":{"type":"boolean"}},"required":["userId","name","memberId","orgId","role","personId","can","hasPasskey"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/people":{"get":{"operationId":"people.list","summary":"List people","description":"Names are left out in ID mode; pay is left out unless your role may see pay.","tags":["People"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgName":{"type":"string"},"idMode":{"type":"boolean"},"currency":{"type":"string"},"units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"catalog":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"qualifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["roles","qualifications"]},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"alias":{"type":"string"},"payrollId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["active","onboarding","inactive"],"type":"string"},"employment":{"enum":["employee","contractor","temp","agency","on_call"],"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"homeUnitIds":{"type":"array","items":{"type":"string"}},"contract":{"anyOf":[{"type":"object","properties":{"validFrom":{"type":"string"},"fte":{"type":"number"},"hoursPerWeek":{"type":"number"},"baseRate":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"rateMultiplier":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["validFrom","fte","hoursPerWeek","baseRate","rateMultiplier"]},{"type":"null"}]},"qualifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","validUntil"]}},"account":{"anyOf":[{"type":"object","properties":{"role":{"enum":["owner","admin","scheduler","manager","employee","viewer","payroll","representative"],"type":"string"},"hasPasskey":{"type":"boolean"}},"required":["role","hasPasskey"]},{"type":"null"}]},"invite":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"expiresAt":{"type":"string"},"emailed":{"type":"boolean"}},"required":["id","expiresAt","emailed"]},{"type":"null"}]}},"required":["id","alias","payrollId","name","status","employment","roles","tags","homeUnitIds","contract","qualifications","account","invite"]}}},"required":["orgName","idMode","currency","units","catalog","people"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"},"post":{"operationId":"people.create","summary":"Add a person","tags":["People"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"alias":{"type":"string","minLength":1,"maxLength":40},"payrollId":{"type":"string","maxLength":40},"givenName":{"type":"string","minLength":1,"maxLength":80},"familyName":{"type":"string","maxLength":80},"roles":{"type":"array","minItems":1,"items":{"type":"string","minLength":3,"maxLength":120}},"employment":{"enum":["employee","contractor","temp","agency","on_call"],"type":"string"},"homeUnitId":{"type":"string","minLength":3,"maxLength":120},"homeUnitIds":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","minLength":3,"maxLength":120}},"tags":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":40}},"contract":{"type":"object","properties":{"hoursPerWeek":{"type":"number","minimum":0,"maximum":80},"baseRate":{"type":"integer","minimum":0,"maximum":9007199254740991},"rateMultiplier":{"type":"number","minimum":0,"maximum":10},"validFrom":{"type":"string"}},"required":["hoursPerWeek"]},"qualifications":{"type":"array","maxItems":50,"items":{"type":"string","minLength":3,"maxLength":120}}},"required":["roles","employment","homeUnitId","contract","qualifications"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120}},"required":["id"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/people/{id}":{"patch":{"operationId":"people.update","summary":"Change a person","tags":["People"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"alias":{"type":"string","minLength":1,"maxLength":40},"payrollId":{"type":"string","maxLength":40},"givenName":{"type":"string","minLength":1,"maxLength":80},"familyName":{"type":"string","maxLength":80},"roles":{"type":"array","minItems":1,"items":{"type":"string","minLength":3,"maxLength":120}},"employment":{"enum":["employee","contractor","temp","agency","on_call"],"type":"string"},"status":{"enum":["active","onboarding","inactive"],"type":"string"},"homeUnitId":{"type":"string","minLength":3,"maxLength":120},"homeUnitIds":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","minLength":3,"maxLength":120}},"tags":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":40}},"contract":{"type":"object","properties":{"hoursPerWeek":{"type":"number","minimum":0,"maximum":80},"baseRate":{"type":"integer","minimum":0,"maximum":9007199254740991},"rateMultiplier":{"type":"number","minimum":0,"maximum":10},"validFrom":{"type":"string"}},"required":["hoursPerWeek"]},"qualifications":{"type":"array","maxItems":50,"items":{"type":"string","minLength":3,"maxLength":120}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120}},"required":["id"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/roles":{"get":{"operationId":"roles.list","summary":"List job roles","tags":["People"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgName":{"type":"string"},"idMode":{"type":"boolean"},"currency":{"type":"string"},"country":{"type":"string"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"name":{"type":"string"},"pay":{"anyOf":[{"type":"object","properties":{"per":{"enum":["hour","month"],"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["per","amount"]},{"type":"null"}]},"hourly":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"grade":{"anyOf":[{"type":"string"},{"type":"null"}]},"hoursPerWeek":{"anyOf":[{"type":"number"},{"type":"null"}]},"qualifications":{"type":"array","items":{"type":"string"}},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"places":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","pay","hourly","grade","hoursPerWeek","qualifications","people","places"]}},"qualifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["orgName","idMode","currency","country","roles","qualifications"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/shift-types":{"get":{"operationId":"shiftTypes.list","summary":"List a unit's shift types","tags":["Rosters"],"parameters":[{"name":"unitId","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":120},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidBreak":{"type":"boolean"},"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"needs":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","minLength":3,"maxLength":120},"count":{"type":"integer","minimum":0,"maximum":50},"mustCover":{"type":"boolean"}},"required":["roleId","count"]}},"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"staffed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","name","start","end","breakMinutes","paidBreak","days","needs","upcoming","staffed"]}},"from":{"type":"string"},"tz":{"type":"string"}},"required":["types","from","tz"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rules":{"get":{"operationId":"rules.list","summary":"List the rules you work under","tags":["Rules"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgName":{"type":"string"},"country":{"type":"string"},"idMode":{"type":"boolean"},"packs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"kind":{"enum":["jurisdiction","agreement","org","local","ai_discovered"],"type":"string"},"version":{"type":"string"},"provenance":{"type":"string"},"notModelled":{"type":"array","items":{"type":"string"}},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"kind":{"type":"string"},"family":{"type":"string"},"severity":{"enum":["hard","soft"],"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"ref":{"type":"string"}},"required":["source","title"]}},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"confidence":{"enum":["high","medium","low"],"type":"string"},"provenance":{"type":"string"},"status":{"enum":["applies","overruled"],"type":"string"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliesTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"house":{"type":"boolean"},"houseType":{"anyOf":[{"type":"string"},{"type":"null"}]},"houseValue":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["key","kind","family","severity","title","summary","citations","params","status","note","appliesTo","house","houseType","houseValue"]}}},"required":["id","key","name","kind","version","provenance","notModelled","note","rules"]}}},"required":["orgName","country","idMode","packs"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/time/me":{"get":{"operationId":"time.mine","summary":"Your hours","tags":["Time"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"now":{"type":"string"},"tz":{"type":"string"},"running":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"shiftId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"endedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"enum":["app","kiosk","manager"],"type":"string"},"status":{"enum":["open","submitted","approved","disputed"],"type":"string"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"location":{"anyOf":[{"enum":["inside","outside","unchecked"],"type":"string"},{"type":"null"}]},"rounded":{"anyOf":[{"type":"object","properties":{"startedAt":{"type":"string"},"endedAt":{"type":"string"}},"required":["startedAt","endedAt"]},{"type":"null"}]}},"required":["id","personId","shiftId","startedAt","endedAt","breakMinutes","source","status","note","version"]},{"type":"null"}]},"shift":{"anyOf":[{"type":"object","properties":{"shiftId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"paidMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unpaidBreakMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["shiftId","name","startsAt","endsAt","paidMin","unpaidBreakMin"]},{"type":"null"}]},"recent":{"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"shiftId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"endedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"enum":["app","kiosk","manager"],"type":"string"},"status":{"enum":["open","submitted","approved","disputed"],"type":"string"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"location":{"anyOf":[{"enum":["inside","outside","unchecked"],"type":"string"},{"type":"null"}]},"rounded":{"anyOf":[{"type":"object","properties":{"startedAt":{"type":"string"},"endedAt":{"type":"string"}},"required":["startedAt","endedAt"]},{"type":"null"}]}},"required":["id","personId","shiftId","startedAt","endedAt","breakMinutes","source","status","note","version"]},"shift":{"anyOf":[{"type":"object","properties":{"shiftId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"paidMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unpaidBreakMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["shiftId","name","startsAt","endsAt","paidMin","unpaidBreakMin"]},{"type":"null"}]}},"required":["entry","shift"]}},"locationCheck":{"anyOf":[{"type":"object","properties":{"outside":{"enum":["refuse","flag"],"type":"string"}},"required":["outside"]},{"type":"null"}]},"pinSet":{"type":"boolean"},"rounding":{"type":"object","properties":{"stepMin":{"anyOf":[{"const":0},{"const":5},{"const":10},{"const":15}]},"mode":{"enum":["nearest","favour"],"type":"string"},"graceMin":{"type":"integer","minimum":0,"maximum":15}},"required":["stepMin","mode","graceMin"]}},"required":["now","tz","running","shift","recent"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/time/team":{"get":{"operationId":"time.team","summary":"The team's planned and worked hours","tags":["Time"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"allowEmptyValue":true,"allowReserved":true},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"tz":{"type":"string"},"idMode":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"alias":{"type":"string"},"planned":{"anyOf":[{"type":"object","properties":{"shiftId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"paidMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unpaidBreakMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["shiftId","name","startsAt","endsAt","paidMin","unpaidBreakMin"]},{"type":"null"}]},"entry":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"shiftId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"endedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"enum":["app","kiosk","manager"],"type":"string"},"status":{"enum":["open","submitted","approved","disputed"],"type":"string"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"location":{"anyOf":[{"enum":["inside","outside","unchecked"],"type":"string"},{"type":"null"}]},"rounded":{"anyOf":[{"type":"object","properties":{"startedAt":{"type":"string"},"endedAt":{"type":"string"}},"required":["startedAt","endedAt"]},{"type":"null"}]}},"required":["id","personId","shiftId","startedAt","endedAt","breakMinutes","source","status","note","version"]},{"type":"null"}]}},"required":["personId","alias","planned","entry"]}},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"alias":{"type":"string"}},"required":["id","alias"]}},"costs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"planned":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},"worked":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]}},"required":["personId","planned","worked"]}},{"type":"null"}]}},"required":["from","to","tz","idMode","rows","names","people","costs"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}/worked":{"get":{"operationId":"time.worked","summary":"Worked hours for a roster (pay access)","tags":["Time"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"shiftId":{"anyOf":[{"type":"string"},{"type":"null"}]},"start":{"type":"string"},"end":{"type":"string"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","personId","shiftId","start","end","breakMinutes"]}},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["entries","pending"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/meetings":{"get":{"operationId":"meetings.list","summary":"List your meetings","tags":["Meetings"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgName":{"type":"string"},"idMode":{"type":"boolean"},"tz":{"type":"string"},"meetings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"location":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizerId":{"type":"string"},"attendees":{"type":"array","items":{"type":"string"}},"attendance":{"enum":["fixed","on_shift"],"type":"string"},"status":{"enum":["confirmed","moved","cancelled","skipped"],"type":"string"},"outside":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["personId","minutes"]}},"extraCost":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]}},"required":["id","title","startsAt","endsAt","location","organizerId","attendees","attendance","status","outside","extraCost"]}},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"alias":{"type":"string"}},"required":["id","alias"]}}},"required":["orgName","idMode","tz","meetings","names","people"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/absences/sick":{"post":{"operationId":"absences.reportSick","summary":"Report sick","description":"Report yourself (or, if you run the unit, someone else) sick. Their shifts are offered to others.","tags":["Leave and absence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"personId":{"type":"string","minLength":3,"maxLength":120},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["until"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"absenceId":{"type":"string","minLength":3,"maxLength":120},"vacated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offeredTo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["absenceId","vacated","offeredTo"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/leave":{"get":{"operationId":"leave.overview","summary":"Leave and balances","description":"Your requests and balance; for people who run the roster, also the team's and the inbox.","tags":["Leave and absence"],"parameters":[{"name":"year","in":"query","schema":{"type":"integer","minimum":2020,"maximum":2100},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tz":{"type":"string"},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"year":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"idMode":{"type":"boolean"},"orgName":{"type":"string"},"jurisdiction":{"type":"string"},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"alias":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}}},"required":["id","alias","roles"]}},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"rules":{"type":"object","properties":{"entitlement":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["title","url"]}}},"required":["title","summary","citations"]},{"type":"null"}]},"blocks":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["title","url"]}}},"required":["title","summary","citations"]},{"type":"null"}]},"dayCount":{"anyOf":[{"enum":["mon_sat_no_holidays","mon_fri"],"type":"string"},{"type":"null"}]}},"required":["entitlement","blocks","dayCount"]},"mine":{"anyOf":[{"type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"type":{"enum":["sick","sick_child","vacation","parental","maternity","paternity","long_term","training","comp_time","unpaid","public_duty","other"],"type":"string"},"status":{"enum":["requested","approved","rejected","cancelled"],"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"partialPercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":"number"},"requestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","personId","type","status","from","to","partialPercent","days","requestedAt","decidedAt","version"]}},"balance":{"type":"object","properties":{"personId":{"type":"string"},"alias":{"type":"string"},"vacation":{"anyOf":[{"type":"object","properties":{"entitled":{"type":"number"},"accrued":{"type":"number"},"why":{"enum":["full","late_start","part_year","first_year","not_employed"],"type":"string"},"adjusted":{"type":"number"},"used":{"type":"number"},"planned":{"type":"number"},"requested":{"type":"number"},"left":{"type":"number"}},"required":["entitled","accrued","why","adjusted","used","planned","requested","left"]},{"type":"null"}]},"compTime":{"type":"object","properties":{"earned":{"type":"number"},"used":{"type":"number"},"left":{"type":"number"}},"required":["earned","used","left"]},"flex":{"type":"object","properties":{"hours":{"type":"number"}},"required":["hours"]}},"required":["personId","alias","vacation","compTime","flex"]}},"required":["requests","balance"]},{"type":"null"}]},"inbox":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"type":{"enum":["sick","sick_child","vacation","parental","maternity","paternity","long_term","training","comp_time","unpaid","public_duty","other"],"type":"string"},"status":{"enum":["requested","approved","rejected","cancelled"],"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"partialPercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":"number"},"requestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","personId","type","status","from","to","partialPercent","days","requestedAt","decidedAt","version"]}},{"type":"null"}]},"team":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"type":{"enum":["sick","sick_child","vacation","parental","maternity","paternity","long_term","training","comp_time","unpaid","public_duty","other"],"type":"string"},"status":{"enum":["requested","approved","rejected","cancelled"],"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"partialPercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":"number"},"requestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","personId","type","status","from","to","partialPercent","days","requestedAt","decidedAt","version"]}},{"type":"null"}]},"balances":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"alias":{"type":"string"},"vacation":{"anyOf":[{"type":"object","properties":{"entitled":{"type":"number"},"accrued":{"type":"number"},"why":{"enum":["full","late_start","part_year","first_year","not_employed"],"type":"string"},"adjusted":{"type":"number"},"used":{"type":"number"},"planned":{"type":"number"},"requested":{"type":"number"},"left":{"type":"number"}},"required":["entitled","accrued","why","adjusted","used","planned","requested","left"]},{"type":"null"}]},"compTime":{"type":"object","properties":{"earned":{"type":"number"},"used":{"type":"number"},"left":{"type":"number"}},"required":["earned","used","left"]},"flex":{"type":"object","properties":{"hours":{"type":"number"}},"required":["hours"]}},"required":["personId","alias","vacation","compTime","flex"]}},{"type":"null"}]}},"required":["tz","today","year","idMode","orgName","jurisdiction","names","people","roles","units","rules","mine","inbox","team","balances"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"},"post":{"operationId":"leave.request","summary":"Ask for leave","tags":["Leave and absence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"personId":{"type":"string","minLength":3,"maxLength":120},"type":{"enum":["sick","sick_child","vacation","parental","maternity","paternity","long_term","training","comp_time","unpaid","public_duty","other"],"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"partialPercent":{"type":"integer","minimum":10,"maximum":90}},"required":["type","from","to"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"type":{"enum":["sick","sick_child","vacation","parental","maternity","paternity","long_term","training","comp_time","unpaid","public_duty","other"],"type":"string"},"status":{"enum":["requested","approved","rejected","cancelled"],"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"partialPercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":"number"},"requestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","personId","type","status","from","to","partialPercent","days","requestedAt","decidedAt","version"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/leave/{id}/impact":{"get":{"operationId":"leave.impact","summary":"What approving leave would mean","tags":["Leave and absence"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leaveId":{"type":"string"},"shifts":{"type":"array","items":{"type":"object","properties":{"shiftId":{"type":"string"},"slotId":{"type":"string"},"rosterId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"roleId":{"type":"string"},"mustCover":{"type":"boolean"},"coverCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"best":{"anyOf":[{"type":"string"},{"type":"null"}]},"bestCost":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"theirCost":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]}},"required":["shiftId","slotId","rosterId","name","startsAt","endsAt","roleId","mustCover","coverCount","best","bestCost","theirCost"]}},"uncovered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costChange":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"rosteredUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"partial":{"type":"boolean"},"balance":{"anyOf":[{"type":"object","properties":{"left":{"type":"number"},"after":{"type":"number"}},"required":["left","after"]},{"type":"null"}]},"backfill":{"anyOf":[{"type":"object","properties":{"weeks":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"openMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"helperMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tempMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"enum":["roster","contract"],"type":"string"}},"required":["start","openMin","helperMin","tempMin","source"]}},"helpers":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"minPerWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spareMinPerWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["personId","minPerWeek","spareMinPerWeek"]}},"totals":{"type":"object","properties":{"openMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"helperMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tempMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"helperCost":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"tempCost":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"overtimeCost":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]}},"required":["openMin","helperMin","tempMin","helperCost","tempCost","overtimeCost"]},"tempFte":{"type":"number"},"fullTimeMinPerWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["weeks","helpers","totals","tempFte","fullTimeMinPerWeek"]},{"type":"null"}]}},"required":["leaveId","shifts","uncovered","costChange","rosteredUntil","partial","balance","backfill"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/leave/{id}/decide":{"post":{"operationId":"leave.decide","summary":"Approve or turn down leave","tags":["Leave and absence"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision":{"enum":["approve","reject"],"type":"string"},"sendCallouts":{"type":"boolean","default":false}},"required":["version","decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"vacated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offeredTo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","vacated","offeredTo"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/leave/{id}/cancel":{"post":{"operationId":"leave.cancel","summary":"Cancel leave","tags":["Leave and absence"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"type":{"enum":["sick","sick_child","vacation","parental","maternity","paternity","long_term","training","comp_time","unpaid","public_duty","other"],"type":"string"},"status":{"enum":["requested","approved","rejected","cancelled"],"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"partialPercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":"number"},"requestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","personId","type","status","from","to","partialPercent","days","requestedAt","decidedAt","version"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/holiday-rounds":{"get":{"operationId":"holidays.list","summary":"List summer holiday rounds","tags":["Leave and absence"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rounds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"unitId":{"type":"string"},"year":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"periodFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"weeks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peakFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"peakTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"closesOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"capacity":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"status":{"enum":["open","allocated","published"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"starts":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"peakStarts":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"wishCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"myWishes":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","minimum":1,"maximum":3},"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["rank","start"]}},"mine":{"anyOf":[{"type":"object","properties":{"personId":{"type":"string"},"start":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"wishRank":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reason":{"enum":["wish","nearest","no_wishes","no_room","not_eligible","manager"],"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peakLastYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peakWeeks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"firstWishTakenBy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["personId","start","end","wishRank","reason","priority","peakLastYear","peakWeeks","firstWishTakenBy"]},{"type":"null"}]},"people":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"group":{"type":"string"},"wishes":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","minimum":1,"maximum":3},"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["rank","start"]}},"allocation":{"anyOf":[{"type":"object","properties":{"personId":{"type":"string"},"start":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"wishRank":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reason":{"enum":["wish","nearest","no_wishes","no_room","not_eligible","manager"],"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peakLastYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peakWeeks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"firstWishTakenBy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["personId","start","end","wishRank","reason","priority","peakLastYear","peakWeeks","firstWishTakenBy"]},{"type":"null"}]}},"required":["personId","group","wishes","allocation"]}},{"type":"null"}]}},"required":["id","unitId","year","periodFrom","periodTo","weeks","peakFrom","peakTo","closesOn","capacity","status","version","starts","peakStarts","wishCount","myWishes","mine","people"]}}},"required":["rounds"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}/callouts":{"get":{"operationId":"callouts.list","summary":"List a roster's shift offers","tags":["Shift offers"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"rosterId":{"type":"string","minLength":3,"maxLength":120},"slotId":{"type":"string","minLength":3,"maxLength":120},"reason":{"enum":["sick","absence","new_demand","unfilled","swap_failed"],"type":"string"},"policy":{"enum":["employer_picks","first_eligible_wins","auto_pick_best"],"type":"string"},"status":{"enum":["open","filled","expired","cancelled"],"type":"string"},"createdAt":{"type":"string"},"filledBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"replaces":{"anyOf":[{"type":"string"},{"type":"null"}]},"audienceCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responses":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"answer":{"enum":["accept","decline"],"type":"string"},"respondedAt":{"type":"string"},"eligible":{"type":"boolean"},"rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},"reasons":{"type":"array","items":{"type":"string"}},"blocked":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["personId","answer","respondedAt","eligible","rank","cost","reasons","blocked"]}},"best":{"anyOf":[{"type":"string"},{"type":"null"}]},"mine":{"anyOf":[{"type":"object","properties":{"answer":{"anyOf":[{"enum":["accept","decline"],"type":"string"},{"type":"null"}]},"eligible":{"type":"boolean"},"blocked":{"anyOf":[{"type":"string"},{"type":"null"}]},"pay":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"weekHours":{"type":"number"},"result":{"anyOf":[{"type":"object","properties":{"picked":{"type":"boolean"},"why":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["picked","why"]},{"type":"null"}]}},"required":["answer","eligible","blocked","pay","weekHours","result"]},{"type":"null"}]}},"required":["id","rosterId","slotId","reason","policy","status","createdAt","filledBy","replaces","audienceCount","responses","best","mine"]}}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/callouts":{"post":{"operationId":"callouts.create","summary":"Offer an open shift","description":"Offer an open slot to the people who can take it. They are told by push and email.","tags":["Shift offers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rosterId":{"type":"string","minLength":3,"maxLength":120},"slotId":{"type":"string","minLength":3,"maxLength":120}},"required":["rosterId","slotId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"offeredTo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","offeredTo"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/callouts/{calloutId}/respond":{"post":{"operationId":"callouts.respond","summary":"Answer a shift offer","tags":["Shift offers"],"parameters":[{"name":"calloutId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"enum":["accept","decline"],"type":"string"}},"required":["answer"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"picked":{"type":"boolean"}},"required":["picked"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/callouts/{calloutId}/pick":{"post":{"operationId":"callouts.pick","summary":"Choose who gets an offered shift","tags":["Shift offers"],"parameters":[{"name":"calloutId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"personId":{"type":"string","minLength":3,"maxLength":120}},"required":["personId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/callouts/{calloutId}/cancel":{"post":{"operationId":"callouts.cancel","summary":"Withdraw a shift offer","tags":["Shift offers"],"parameters":[{"name":"calloutId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/swaps":{"get":{"operationId":"swaps.list","summary":"List shift swaps","tags":["Swaps"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"swaps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"rosterId":{"type":"string","minLength":3,"maxLength":120},"unitId":{"type":"string","minLength":3,"maxLength":120},"kind":{"enum":["exchange","giveaway"],"type":"string"},"status":{"enum":["asked","accepted","applied","declined","rejected","cancelled"],"type":"string"},"fromPersonId":{"type":"string"},"from":{"type":"object","properties":{"slotId":{"type":"string"},"shiftId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"}},"required":["slotId","shiftId","name","startsAt","endsAt"]},"toPersonId":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"anyOf":[{"type":"object","properties":{"slotId":{"type":"string"},"shiftId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"}},"required":["slotId","shiftId","name","startsAt","endsAt"]},{"type":"null"}]},"createdAt":{"type":"string"},"role":{"enum":["asker","asked","taker","manager"],"type":"string"},"check":{"anyOf":[{"type":"object","properties":{"ok":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"text":{"type":"string"}},"required":["personId","text"]}}},"required":["ok","reasons"]},{"type":"null"}]},"costDelta":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]},"takers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"needsApproval":{"type":"boolean"},"overBudget":{"type":"boolean"}},"required":["id","rosterId","unitId","kind","status","fromPersonId","from","toPersonId","to","createdAt","role","check","costDelta","takers","needsApproval","overBudget"]}},"policy":{"enum":["manager","no_cost","auto"],"type":"string"}},"required":["swaps","policy"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"},"post":{"operationId":"swaps.ask","summary":"Ask for a swap","tags":["Swaps"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slotId":{"type":"string","minLength":3,"maxLength":120},"withSlotId":{"type":"string","minLength":3,"maxLength":120}},"required":["slotId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"status":{"enum":["asked","accepted","applied","declined","rejected","cancelled"],"type":"string"}},"required":["id","status"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/swaps/options":{"post":{"operationId":"swaps.options","summary":"Find shifts to swap with","tags":["Swaps"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slotId":{"type":"string","minLength":3,"maxLength":120}},"required":["slotId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"exchange":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"with":{"type":"object","properties":{"slotId":{"type":"string"},"shiftId":{"type":"string"},"name":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"}},"required":["slotId","shiftId","name","startsAt","endsAt"]},"costDelta":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},{"type":"null"}]}},"required":["personId","with","costDelta"]}},"takers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"policy":{"enum":["manager","no_cost","auto"],"type":"string"}},"required":["exchange","takers","policy"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/swaps/{id}/answer":{"post":{"operationId":"swaps.answer","summary":"Answer a swap request","tags":["Swaps"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"enum":["accept","decline"],"type":"string"}},"required":["answer"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"status":{"enum":["asked","accepted","applied","declined","rejected","cancelled"],"type":"string"}},"required":["id","status"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/swaps/{id}/decide":{"post":{"operationId":"swaps.decide","summary":"Approve or turn down a swap","tags":["Swaps"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"enum":["approve","reject"],"type":"string"}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"status":{"enum":["asked","accepted","applied","declined","rejected","cancelled"],"type":"string"}},"required":["id","status"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/swaps/{id}/cancel":{"post":{"operationId":"swaps.cancel","summary":"Withdraw a swap request","tags":["Swaps"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"status":{"enum":["asked","accepted","applied","declined","rejected","cancelled"],"type":"string"}},"required":["id","status"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/swaps/policy":{"get":{"operationId":"swaps.policy","summary":"Who approves swaps","tags":["Swaps"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"enum":["manager","no_cost","auto"],"type":"string"}},"required":["policy"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters":{"get":{"operationId":"roster.list","summary":"List rosters","description":"Roster periods of the units you can see, oldest first. Filter by unit with `unitId`.","tags":["Rosters"],"parameters":[{"name":"unitId","in":"query","schema":{"type":"string","minLength":3,"maxLength":120},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"unitId":{"type":"string","minLength":3,"maxLength":120},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"status":{"enum":["draft","proposed","published","locked"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"publishedVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","unitId","periodStart","periodEnd","status","version","publishedVersion"]}}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}":{"get":{"operationId":"roster.get","summary":"Get a roster","description":"The roster with every shift, slot and assignment, as the rule engine sees it, plus display names. Pay, absence reasons and colleagues' preferences are removed unless your role may see pay.","tags":["Rosters"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"roster":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"unitId":{"type":"string","minLength":3,"maxLength":120},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"status":{"enum":["draft","proposed","published","locked"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"publishedVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","unitId","periodStart","periodEnd","status","version","publishedVersion"]},"snapshot":{"not":{}},"names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"me":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"memberId":{"type":"string"},"orgId":{"type":"string"},"role":{"enum":["owner","admin","scheduler","manager","employee","viewer","payroll","representative"],"type":"string"},"personId":{"anyOf":[{"type":"string"},{"type":"null"}]},"can":{"type":"array","items":{"enum":["roster.read","roster.edit","roster.publish","pay.read","people.read","people.edit","roles.edit","rules.edit","members.manage","billing.manage","budget.edit","settings.manage","audit.read","overview.read"],"type":"string"}},"hasPasskey":{"type":"boolean"}},"required":["userId","name","memberId","orgId","role","personId","can","hasPasskey"]},"catalog":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"qualifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["roles","qualifications"]},"unitName":{"type":"string"}},"required":["roster","snapshot","names","me","catalog","unitName"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}/operations":{"post":{"operationId":"roster.apply","summary":"Change a roster","description":"Assign or unassign people. Send the roster's current `version` as `baseVersion`; the change is checked against every rule and refused with plain reasons when it breaks one. Retrying with the same `clientOpId` is safe.","tags":["Rosters"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op":{"anyOf":[{"type":"object","properties":{"kind":{"const":"assign"},"slotId":{"type":"string","minLength":3,"maxLength":120},"personId":{"type":"string","minLength":3,"maxLength":120},"override":{"type":"object","properties":{"reason":{"type":"string","minLength":3}},"required":["reason"]}},"required":["kind","slotId","personId"]},{"type":"object","properties":{"kind":{"const":"unassign"},"slotId":{"type":"string","minLength":3,"maxLength":120}},"required":["kind","slotId"]},{"type":"object","properties":{"kind":{"const":"bulk"},"changes":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"object","properties":{"slotId":{"type":"string","minLength":3,"maxLength":120},"personId":{"anyOf":[{"type":"string","minLength":3,"maxLength":120},{"type":"null"}]}},"required":["slotId","personId"]}},"source":{"enum":["solver","swap","manual","ai_chat"],"type":"string"},"override":{"type":"object","properties":{"reason":{"type":"string","minLength":3}},"required":["reason"]}},"required":["kind","changes","source"]}]},"clientOpId":{"type":"string","minLength":8,"maxLength":64}},"required":["baseVersion","op","clientOpId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ok":{"const":true},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eventIds":{"type":"array","items":{"type":"string"}}},"required":["ok","version","eventIds"]},{"type":"object","properties":{"ok":{"const":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"ruleKey":{"type":"string"},"personId":{"type":"string"},"message":{"type":"string"}},"required":["ruleKey","personId","message"]}}},"required":["ok","version","reason","violations"]}]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/rosters/{rosterId}/publish":{"post":{"operationId":"roster.publish","summary":"Publish a roster","description":"Publish the roster at `version`. Staff are told.","tags":["Rosters"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ok":{"const":true},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eventIds":{"type":"array","items":{"type":"string"}}},"required":["ok","version","eventIds"]},{"type":"object","properties":{"ok":{"const":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"ruleKey":{"type":"string"},"personId":{"type":"string"},"message":{"type":"string"}},"required":["ruleKey","personId","message"]}}},"required":["ok","version","reason","violations"]}]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"write"}},"/settings/me":{"get":{"operationId":"settings.mine","summary":"Your workplace settings","description":"Which modes are on and what staff are shown.","tags":["Account"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orgId":{"type":"string"},"orgName":{"type":"string"},"role":{"enum":["owner","admin","scheduler","manager","employee","viewer","payroll","representative"],"type":"string"},"modes":{"type":"object","properties":{"meetings":{"type":"boolean"},"timeTracking":{"type":"boolean"},"homeVisits":{"type":"boolean"}},"required":["meetings","timeTracking","homeVisits"]},"transparency":{"type":"object","properties":{"ownPay":{"type":"boolean"},"ownFairness":{"type":"boolean"},"whyPicked":{"type":"boolean"},"rosterReasons":{"type":"boolean"}},"required":["ownPay","ownFairness","whyPicked","rosterReasons"]},"canManage":{"type":"boolean"}},"required":["orgId","orgName","role","modes","transparency","canManage"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/units":{"get":{"operationId":"units.list","summary":"List sites and units you can see","tags":["Units"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timeZone":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","name","timeZone","archived"]}},"units":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"siteId":{"type":"string"},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","name","siteId","people","archived"]}},"siteLimit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"plan":{"type":"string"},"canManage":{"type":"boolean"}},"required":["sites","units","siteLimit","plan","canManage"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/fairness/me":{"get":{"operationId":"fairness.mine","summary":"Your fairness against the team","tags":["Insights"],"parameters":[{"name":"rosterId","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":120},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"mine":{"type":"object","properties":{"nights":{"type":"number"},"weekends":{"type":"number"},"holidays":{"type":"number"}},"required":["nights","weekends","holidays"]},"thisPeriod":{"type":"object","properties":{"nights":{"type":"number"},"weekends":{"type":"number"},"holidays":{"type":"number"}},"required":["nights","weekends","holidays"]},"team":{"type":"object","properties":{"nights":{"type":"object","properties":{"average":{"type":"number"},"low":{"type":"number"},"high":{"type":"number"}},"required":["average","low","high"]},"weekends":{"type":"object","properties":{"average":{"type":"number"},"low":{"type":"number"},"high":{"type":"number"}},"required":["average","low","high"]},"holidays":{"type":"object","properties":{"average":{"type":"number"},"low":{"type":"number"},"high":{"type":"number"}},"required":["average","low","high"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["nights","weekends","holidays","people"]},"vsAverage":{"type":"object","properties":{"nights":{"type":"number"},"weekends":{"type":"number"},"holidays":{"type":"number"}},"required":["nights","weekends","holidays"]}},"required":["period","mine","thisPeriod","team","vsAverage"]},{"type":"null"}]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rotations":{"get":{"operationId":"rotations.list","summary":"List rotations","tags":["Rosters"],"parameters":[{"name":"unitId","in":"query","schema":{"type":"string","minLength":3,"maxLength":120},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rotations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":120},"unitId":{"type":"string","minLength":3,"maxLength":120},"name":{"type":"string"},"weeks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"anchor":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pattern":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null"}]}},"members":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string","minLength":3,"maxLength":120},"offsetWeeks":{"type":"integer","minimum":0,"maximum":51}},"required":["personId","offsetWeeks"]}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","unitId","name","weeks","anchor","pattern","members","version"]}}},"required":["rotations"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}/versions":{"get":{"operationId":"rosterVersions.list","summary":"List a roster's versions","tags":["Rosters"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"filled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"current":{"type":"boolean"},"stored":{"type":"boolean"}},"required":["version","publishedAt","publishedBy","filled","open","current","stored"]}}},"required":["versions"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}/versions/{version}":{"get":{"operationId":"rosterVersions.get","summary":"Get a roster version","description":"Who was on which slot in that version.","tags":["Rosters"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"assignments":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["version","assignments"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}},"/rosters/{rosterId}/heal":{"get":{"operationId":"heal.state","summary":"Open problems and suggested fixes","tags":["Insights"],"parameters":[{"name":"rosterId","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"enum":["suggest","auto_no_cost"],"type":"string"},"canChange":{"type":"boolean"},"recent":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string"},"at":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changes":{"type":"array","items":{"type":"object","properties":{"slotId":{"type":"string","minLength":3,"maxLength":120},"personId":{"anyOf":[{"type":"string","minLength":3,"maxLength":120},{"type":"null"}]}},"required":["slotId","personId"]}}},"required":["eventId","at","version","changes"]}}},"required":["mode","canChange","recent"]}}}},"4XX":{"description":"Refused: 400 bad input or a broken rule, 401 no or bad key, 403 not allowed (role, unit, or a read key), 404 not found, 429 too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-etime-access":"read"}}}}