{"openapi":"3.1.0","info":{"title":"Fivexer Platform API","description":"Routing-as-a-service: create workers and tasks, the platform matches continuously. `/v1` authenticates with a workspace API key (`Authorization: Bearer sk_...`); `/console` with a session token from `/auth`; `/admin` with the operator token.","version":"0.1.0"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Workspace API key (sk_test_/sk_live_)"},"session":{"type":"http","scheme":"bearer","description":"Console session token (st_...)"},"adminToken":{"type":"http","scheme":"bearer","description":"Operator ADMIN_TOKEN"},"workerToken":{"type":"http","scheme":"bearer","description":"Worker session token (wt_...)"},"supervisorToken":{"type":"http","scheme":"bearer","description":"Supervisor session token (sv_...), scoped to one workspace and optionally one team"}},"schemas":{}},"paths":{"/public/status":{"get":{"summary":"Public platform status and uptime history (no authentication)","tags":["status"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"days","required":false}],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/public/rota/{token}":{"get":{"summary":"A published rota, as a public page shows it (no authentication)","tags":["roster"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"week","required":false},{"schema":{"type":"string","maxLength":8},"in":"query","name":"code","required":false},{"schema":{"type":"string","pattern":"^[a-z0-9-]{8,64}$"},"in":"path","name":"token","required":true}],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/public/rota/{token}/calendar.ics":{"get":{"summary":"One person's shifts from a public rota page, as a calendar feed (no authentication)","tags":["roster"],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{12}$"},"in":"query","name":"person","required":true},{"schema":{"type":"string","maxLength":8},"in":"query","name":"code","required":false},{"schema":{"type":"string","pattern":"^[a-z0-9-]{8,64}$"},"in":"path","name":"token","required":true}],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/portal/photos/{file}":{"get":{"summary":"A worker profile photo (no authentication; the URL is the credential)","tags":["workers"],"parameters":[{"schema":{"type":"string","pattern":"^wph_[A-Za-z0-9_-]{12}\\.jpg$"},"in":"path","name":"file","required":true}],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/g/{shareId}":{"get":{"summary":"A shared knowledge graph","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"in":"path","name":"shareId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/g/{shareId}/nodes/{node}":{"get":{"summary":"One canvas of a shared knowledge graph","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"in":"path","name":"shareId","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/g/{shareId}/events":{"post":{"summary":"Report views and feedback on a shared graph","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","additionalProperties":false,"required":["node","kind"],"properties":{"node":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"kind":{"type":"string","enum":["view","dwell","followed","helpful","confusing","wrong","not-relevant"]},"blockId":{"type":"string","maxLength":64},"value":{"type":"integer","minimum":0,"maximum":86400},"note":{"type":"string","maxLength":1000}}}}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"in":"path","name":"shareId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/asset/{token}":{"get":{"summary":"A stored image of a canvas","tags":["knowledge"],"parameters":[{"schema":{"type":"string","maxLength":64},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/html/{token}":{"get":{"summary":"One html block of a canvas, served sandboxed","tags":["knowledge"],"parameters":[{"schema":{"type":"string","enum":["light","dark"]},"in":"query","name":"theme","required":false},{"schema":{"type":"string","maxLength":64},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/screens/{token}":{"get":{"summary":"A live screen: waits up to 25 s for something newer than `after`","tags":["knowledge"],"parameters":[{"schema":{"type":"integer","minimum":0},"in":"query","name":"after","required":false},{"schema":{"type":"integer","minimum":0,"maximum":25000},"in":"query","name":"waitMs","required":false},{"schema":{"type":"string","maxLength":64},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/knowledge/screens/{token}/events":{"post":{"summary":"Report views and feedback from a live screen","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","additionalProperties":false,"required":["node","kind"],"properties":{"node":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"kind":{"type":"string","enum":["view","dwell","followed","helpful","confusing","wrong","not-relevant"]},"blockId":{"type":"string","maxLength":64},"value":{"type":"integer","minimum":0,"maximum":86400},"note":{"type":"string","maxLength":1000}}}}}}}}},"parameters":[{"schema":{"type":"string","maxLength":64},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/portal/{workspaceId}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/portal/{workspaceId}/":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/portal/{workspaceId}/{*}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks":{"post":{"summary":"Create a task (queued for matching)","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["tags"],"properties":{"id":{"type":"string","maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32},"priority":{"type":"number"},"skillThresholds":{"type":"object","additionalProperties":{"type":"number"},"maxProperties":32},"requiredSkills":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["skillId","minLevel"],"properties":{"skillId":{"type":"string","maxLength":64},"minLevel":{"type":"number","minimum":1,"maximum":5}}}},"vetoedWorkers":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":64},"meta":{"type":"object"},"title":{"type":"string","minLength":1,"maxLength":300},"description":{"type":"string","minLength":1,"maxLength":10000},"context":{"type":"object"},"resultContract":{"type":"object"},"references":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"label":{"type":"string","maxLength":200},"contentType":{"type":"string","maxLength":128}}}},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxDistanceKm":{"type":"number","minimum":0},"requireGeo":{"type":"boolean"},"allowedCidrs":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32},"escalation":{"type":["object","null"],"additionalProperties":false,"required":["respondWithinMs"],"properties":{"respondWithinMs":{"type":"number","minimum":1000,"maximum":86400000},"onNoResponse":{"type":"string","enum":["block","allow"]},"offerCooldownMs":{"type":"number","minimum":1000,"maximum":86400000},"priorityBoost":{"type":"number"},"tiers":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32}},"maxEscalations":{"type":"number","minimum":0,"maximum":8},"onExhausted":{"type":"string","enum":["queue","park"]}}},"sla":{"type":["object","null"],"additionalProperties":false,"properties":{"completeWithinMs":{"type":"number","minimum":1000,"maximum":7776000000},"expireAfterMs":{"type":"number","minimum":1000,"maximum":7776000000},"maxRejections":{"type":"number","minimum":1,"maximum":100},"onCompletionBreach":{"type":"string","enum":["notify","requeue","fail","park"]},"onMaxRejections":{"type":"string","enum":["park","fail","keep"]},"onExpire":{"type":"string","enum":["drop","park"]}}},"schedule":{"type":"object","additionalProperties":false,"properties":{"notBefore":{"type":"number","minimum":0},"notAfter":{"type":"number","minimum":0},"onMiss":{"type":"string","enum":["park","drop"]}}},"slot":{"type":"object","additionalProperties":false,"required":["startAt","durationMs"],"properties":{"startAt":{"type":"number","minimum":0},"durationMs":{"type":"number","minimum":60000,"maximum":86400000},"bookAheadMs":{"type":"number","minimum":0},"onUnbooked":{"type":"string","enum":["queue","park","drop"]}}},"recurrence":{"type":"object","additionalProperties":false,"required":["everyMs"],"properties":{"everyMs":{"type":"number","minimum":60000,"maximum":31536000000},"times":{"type":"integer","minimum":1,"maximum":1000},"startAt":{"type":"number","minimum":0},"windowMs":{"type":"number","minimum":60000,"maximum":31536000000},"onMiss":{"type":"string","enum":["park","drop"]},"until":{"type":"number","minimum":0},"maxOccurrences":{"type":"number","minimum":1,"maximum":10000},"catchUp":{"type":"string","enum":["skip","all"]}}},"teamId":{"type":"string","maxLength":64},"preferTeamId":{"type":"string","maxLength":64}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List tasks by status (paginated)","tags":["tasks"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/bulk":{"post":{"summary":"Create many tasks in one call, reporting each one","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["tasks"],"properties":{"tasks":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","additionalProperties":false,"required":["tags"],"properties":{"id":{"type":"string","maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32},"priority":{"type":"number"},"skillThresholds":{"type":"object","additionalProperties":{"type":"number"},"maxProperties":32},"requiredSkills":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["skillId","minLevel"],"properties":{"skillId":{"type":"string","maxLength":64},"minLevel":{"type":"number","minimum":1,"maximum":5}}}},"vetoedWorkers":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":64},"meta":{"type":"object"},"title":{"type":"string","minLength":1,"maxLength":300},"description":{"type":"string","minLength":1,"maxLength":10000},"context":{"type":"object"},"resultContract":{"type":"object"},"references":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"label":{"type":"string","maxLength":200},"contentType":{"type":"string","maxLength":128}}}},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxDistanceKm":{"type":"number","minimum":0},"requireGeo":{"type":"boolean"},"allowedCidrs":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32},"escalation":{"type":["object","null"],"additionalProperties":false,"required":["respondWithinMs"],"properties":{"respondWithinMs":{"type":"number","minimum":1000,"maximum":86400000},"onNoResponse":{"type":"string","enum":["block","allow"]},"offerCooldownMs":{"type":"number","minimum":1000,"maximum":86400000},"priorityBoost":{"type":"number"},"tiers":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32}},"maxEscalations":{"type":"number","minimum":0,"maximum":8},"onExhausted":{"type":"string","enum":["queue","park"]}}},"sla":{"type":["object","null"],"additionalProperties":false,"properties":{"completeWithinMs":{"type":"number","minimum":1000,"maximum":7776000000},"expireAfterMs":{"type":"number","minimum":1000,"maximum":7776000000},"maxRejections":{"type":"number","minimum":1,"maximum":100},"onCompletionBreach":{"type":"string","enum":["notify","requeue","fail","park"]},"onMaxRejections":{"type":"string","enum":["park","fail","keep"]},"onExpire":{"type":"string","enum":["drop","park"]}}},"schedule":{"type":"object","additionalProperties":false,"properties":{"notBefore":{"type":"number","minimum":0},"notAfter":{"type":"number","minimum":0},"onMiss":{"type":"string","enum":["park","drop"]}}},"slot":{"type":"object","additionalProperties":false,"required":["startAt","durationMs"],"properties":{"startAt":{"type":"number","minimum":0},"durationMs":{"type":"number","minimum":60000,"maximum":86400000},"bookAheadMs":{"type":"number","minimum":0},"onUnbooked":{"type":"string","enum":["queue","park","drop"]}}},"recurrence":{"type":"object","additionalProperties":false,"required":["everyMs"],"properties":{"everyMs":{"type":"number","minimum":60000,"maximum":31536000000},"times":{"type":"integer","minimum":1,"maximum":1000},"startAt":{"type":"number","minimum":0},"windowMs":{"type":"number","minimum":60000,"maximum":31536000000},"onMiss":{"type":"string","enum":["park","drop"]},"until":{"type":"number","minimum":0},"maxOccurrences":{"type":"number","minimum":1,"maximum":10000},"catchUp":{"type":"string","enum":["skip","all"]}}},"teamId":{"type":"string","maxLength":64},"preferTeamId":{"type":"string","maxLength":64}}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}":{"get":{"summary":"Get a task (falls back to the archive after the hot window)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Cancel a task (archived as cancelled)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a live task (routing, title, description, context)","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32},"priority":{"type":"number"},"title":{"type":["string","null"],"minLength":1,"maxLength":300},"description":{"type":["string","null"],"minLength":1,"maxLength":10000},"context":{"type":["object","null"]},"references":{"type":["array","null"],"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"label":{"type":"string","maxLength":200},"contentType":{"type":"string","maxLength":128}}}},"meta":{"type":["object","null"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/accept":{"post":{"summary":"Worker accepts a pending task","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/ack":{"post":{"summary":"Worker acknowledges a pending task (alias of accept)","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/escalate":{"post":{"summary":"Escalate a pending task now, without waiting out its response deadline","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"workerId":{"type":"string","maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/parked":{"get":{"summary":"List tasks parked by an escalation or SLA policy","tags":["tasks"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/scheduled":{"get":{"summary":"List tasks held by a schedule, soonest activation first","tags":["tasks"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/bookings":{"get":{"summary":"Booked appointments in a window — the planner calendar","tags":["tasks"],"parameters":[{"schema":{"type":"number","minimum":0},"in":"query","name":"from","required":true},{"schema":{"type":"number","minimum":0},"in":"query","name":"to","required":true},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/booking/candidates":{"get":{"summary":"Rank workers for a task’s appointment, with the reason each is or is not bookable","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/booking":{"post":{"summary":"Reserve a worker for a task’s appointment","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","minLength":1,"maxLength":128},"force":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Release a task’s reservation","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/recurring":{"get":{"summary":"List recurring task templates, soonest next occurrence first","tags":["tasks"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/recurring/{id}":{"delete":{"summary":"Remove a recurring template (already-created occurrences live on)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/check":{"post":{"summary":"Dry-run a task: who could take it, which tags nobody covers, policy problems","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["tags"],"properties":{"id":{"type":"string","maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32},"priority":{"type":"number"},"skillThresholds":{"type":"object","additionalProperties":{"type":"number"},"maxProperties":32},"requiredSkills":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["skillId","minLevel"],"properties":{"skillId":{"type":"string","maxLength":64},"minLevel":{"type":"number","minimum":1,"maximum":5}}}},"vetoedWorkers":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":64},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxDistanceKm":{"type":"number","minimum":0},"requireGeo":{"type":"boolean"},"escalation":{"type":["object","null"],"additionalProperties":false,"required":["respondWithinMs"],"properties":{"respondWithinMs":{"type":"number","minimum":1000,"maximum":86400000},"onNoResponse":{"type":"string","enum":["block","allow"]},"offerCooldownMs":{"type":"number","minimum":1000,"maximum":86400000},"priorityBoost":{"type":"number"},"tiers":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32}},"maxEscalations":{"type":"number","minimum":0,"maximum":8},"onExhausted":{"type":"string","enum":["queue","park"]}}},"sla":{"type":["object","null"],"additionalProperties":false,"properties":{"completeWithinMs":{"type":"number","minimum":1000,"maximum":7776000000},"expireAfterMs":{"type":"number","minimum":1000,"maximum":7776000000},"maxRejections":{"type":"number","minimum":1,"maximum":100},"onCompletionBreach":{"type":"string","enum":["notify","requeue","fail","park"]},"onMaxRejections":{"type":"string","enum":["park","fail","keep"]},"onExpire":{"type":"string","enum":["drop","park"]}}},"schedule":{"type":"object","additionalProperties":false,"properties":{"notBefore":{"type":"number","minimum":0},"notAfter":{"type":"number","minimum":0},"onMiss":{"type":"string","enum":["park","drop"]}}},"slot":{"type":"object","additionalProperties":false,"required":["startAt","durationMs"],"properties":{"startAt":{"type":"number","minimum":0},"durationMs":{"type":"number","minimum":60000,"maximum":86400000},"bookAheadMs":{"type":"number","minimum":0},"onUnbooked":{"type":"string","enum":["queue","park","drop"]}}},"teamId":{"type":"string","maxLength":64},"preferTeamId":{"type":"string","maxLength":64},"resultContract":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/unpark":{"post":{"summary":"Return a parked task to the queue","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"resetEscalation":{"type":"boolean"},"resetSla":{"type":"boolean"},"resetSchedule":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/reject":{"post":{"summary":"Worker rejects a task (requeued for others)","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/assign":{"post":{"summary":"Operator override: assign a task directly to a worker","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"force":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/complete":{"post":{"summary":"Worker completes a task","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/fail":{"post":{"summary":"Worker reports that an accepted task could not be done","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"reason":{"type":"string","maxLength":500}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/suggest-workers":{"post":{"summary":"Preview the best workers for a hypothetical task","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["tags"],"properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32},"priority":{"type":"number"},"requiredSkills":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["skillId","minLevel"],"properties":{"skillId":{"type":"string","maxLength":64},"minLevel":{"type":"number","minimum":1,"maximum":5}}}},"vetoedWorkers":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":64},"limit":{"type":"number","minimum":1,"maximum":100},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxDistanceKm":{"type":"number","minimum":0},"requireGeo":{"type":"boolean"},"allowedCidrs":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/history":{"get":{"summary":"List finished tasks (paginated)","tags":["tasks"],"parameters":[{"schema":{"type":"string","maxLength":64},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"tag","required":false},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/context":{"get":{"summary":"Get a task’s rich context (title, data, references)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Replace a task’s rich context","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","minLength":1,"maxLength":300},"description":{"type":"string","minLength":1,"maxLength":10000},"context":{"type":"object"},"references":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"label":{"type":"string","maxLength":200},"contentType":{"type":"string","maxLength":128}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a task’s rich context","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/outcome":{"get":{"summary":"A task’s outcome: done or not, who holds it, and its result — optionally long-polled","tags":["tasks"],"parameters":[{"schema":{"type":"integer","minimum":0,"maximum":25000},"in":"query","name":"waitMs","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs":{"post":{"summary":"Open an agent run: a goal the caller will pursue, with every action recorded and its reason","tags":["runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["goal"],"properties":{"goal":{"type":"string","minLength":1,"maxLength":2000},"goalKey":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z0-9][a-z0-9._-]*$"},"inputs":{"type":"object"},"mode":{"type":"string","enum":["discover","workflow"]},"workflowId":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List agent runs, newest first","tags":["runs"],"parameters":[{"schema":{"type":"string","enum":["running","blocked","done","failed","abandoned"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"goalKey","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0},"in":"query","name":"before","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}":{"get":{"summary":"An agent run, with the question it is waiting on if it is blocked","tags":["runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/events":{"get":{"summary":"A run’s recorded events after a seq — optionally long-polled until there are new ones","tags":["runs"],"parameters":[{"schema":{"type":"integer","minimum":0},"in":"query","name":"after","required":false},{"schema":{"type":"integer","minimum":1,"maximum":1000},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"maximum":25000},"in":"query","name":"waitMs","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/tasks":{"get":{"summary":"Every task a run created or ran, with who did it and where it stands","tags":["runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/run":{"get":{"summary":"The agent run a task was part of — its step and why it was created","tags":["runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/decisions":{"post":{"summary":"Record a choice the agent made, and why — branches of a saved workflow come from these","tags":["runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["why","chose"],"properties":{"why":{"type":"string","minLength":1,"maxLength":1000},"chose":{"type":"string","minLength":1,"maxLength":200},"basedOn":{"type":"object","additionalProperties":false,"required":["taskId","field"],"properties":{"taskId":{"type":"string","minLength":1,"maxLength":128},"field":{"type":"string","minLength":1,"maxLength":64,"pattern":"^\\w+$"}}},"value":{}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/notes":{"post":{"summary":"Record reasoning the agent did outside 5xer that a reviewer would need","tags":["runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":4000}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/blockers":{"post":{"summary":"Stop and ask a person — only when the run cannot go on without one","tags":["runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["question"],"properties":{"question":{"type":"string","minLength":1,"maxLength":1000},"options":{"type":"array","maxItems":6,"items":{"type":"string","minLength":1,"maxLength":200}},"taskId":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/workflow":{"post":{"summary":"Save a finished run as a fixed workflow — or, with dryRun, see what it would be and its gaps","tags":["runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"workflowId":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"dryRun":{"type":"boolean"},"replace":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/finish":{"post":{"summary":"Close a run with its outcome","tags":["runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["success"],"properties":{"success":{"type":"boolean"},"summary":{"type":"string","minLength":1,"maxLength":2000},"result":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/runs/{id}/abandon":{"post":{"summary":"Give a run up without an outcome","tags":["runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/executors":{"get":{"summary":"Who can do what right now: every person and agent who can be handed work, their skills, and whether they are online","tags":["agents"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/agent-links":{"post":{"summary":"Make a single-use link that connects one AI agent as a worker — for the whole workspace, or as one worker’s assistant. Skills are named in plain words; missing ones are added to the catalog.","tags":["agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"ownerWorkerId":{"type":"string","minLength":1,"maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"skills":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["skill"],"properties":{"skill":{"type":"string","minLength":1,"maxLength":128},"level":{"type":"number","minimum":1,"maximum":5}}}},"teamId":{"type":"string","maxLength":64}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/hosted-agents":{"post":{"summary":"Connect an agent that runs at Anthropic (Claude Managed Agents) or OpenAI (Agents API) as a worker. The key and agent are checked with the provider first; the key is stored sealed and never returned.","tags":["agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["provider","apiKey","agentId"],"properties":{"provider":{"type":"string","enum":["anthropic","openai"]},"apiKey":{"type":"string","minLength":8,"maxLength":512},"agentId":{"type":"string","minLength":1,"maxLength":256},"environmentId":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":128},"ownerWorkerId":{"type":"string","minLength":1,"maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"skills":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["skill"],"properties":{"skill":{"type":"string","minLength":1,"maxLength":128},"level":{"type":"number","minimum":1,"maximum":5}}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Agents connected from Anthropic or OpenAI, without their keys","tags":["agents"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/hosted-agents/{workerId}":{"delete":{"summary":"Disconnect a hosted agent: its key is deleted and its worker removed","tags":["agents"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs":{"get":{"summary":"List knowledge graphs with their health","tags":["knowledge"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a knowledge graph","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000},"agent":{"type":["string","null"],"minLength":1,"maxLength":128},"visibility":{"type":"string","enum":["private","workspace","link","public"]},"layers":{"type":"array","minItems":1,"maxItems":12,"items":{"type":"string","minLength":1,"maxLength":80}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}":{"get":{"summary":"A graph with its nodes and edges","tags":["knowledge"],"parameters":[{"schema":{"type":"boolean"},"in":"query","name":"archived","required":false},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Change a graph: title, visibility, layers, auto-archive, or rotate its share link","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000},"agent":{"type":["string","null"],"minLength":1,"maxLength":128},"visibility":{"type":"string","enum":["private","workspace","link","public"]},"autoArchive":{"type":"boolean"},"layers":{"type":"array","minItems":1,"maxItems":12,"items":{"type":"string","minLength":1,"maxLength":80}},"rotateShareLink":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a graph and every canvas in it — permanently","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}/nodes/{node}":{"put":{"summary":"Write a canvas: the whole scene becomes the node’s next version (creates the node, and the graph when `createGraph` is set)","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["title","scene"],"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":["string","null"],"maxLength":1000},"layer":{"type":"integer","minimum":0,"maximum":11},"parent":{"type":["string","null"],"pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"pos":{"type":"object","additionalProperties":false,"required":["x","y"],"properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000}}},"reviewBy":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"visibility":{"type":"string","enum":["inherit","private"]},"scene":{"type":"object"},"baseVersion":{"type":"integer","minimum":0},"createGraph":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"agent":{"type":"string","minLength":1,"maxLength":128}}}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Patch a canvas by block id against the version it was read at; placement-only changes make no new version","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"baseVersion":{"type":"integer","minimum":1},"upsert":{"type":"array","maxItems":200,"items":{"type":"object"}},"remove":{"type":"array","maxItems":200,"items":{"type":"string","maxLength":64}},"size":{"type":["object","null"]},"title":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":["string","null"],"maxLength":1000},"pos":{"type":"object","additionalProperties":false,"required":["x","y"],"properties":{"x":{"type":"number","minimum":-1000000,"maximum":1000000},"y":{"type":"number","minimum":-1000000,"maximum":1000000}}},"reviewBy":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"visibility":{"type":"string","enum":["inherit","private"]}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Read a canvas: the node, its scene (current or a given version) and its links","tags":["knowledge"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"version","required":false},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a canvas and all its versions — permanently","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}/nodes/{node}/versions":{"get":{"summary":"A canvas’s version history, newest first","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}/nodes/{node}/restore":{"post":{"summary":"Make an earlier version current again (as a new version)","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["version"],"properties":{"version":{"type":"integer","minimum":1}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}/nodes/{node}/archive":{"post":{"summary":"Archive a canvas: its link still opens, it no longer comes back from search","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}/nodes/{node}/unarchive":{"post":{"summary":"Bring an archived canvas back into use","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"node","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/graphs/{graph}/edges":{"put":{"summary":"Link two canvases: expands (one layer deeper), depends or cites","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["from","to","kind"],"properties":{"from":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"to":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"kind":{"type":"string","enum":["expands","relates","depends","cites"]},"label":{"type":["string","null"],"maxLength":120}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a link between two canvases","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"query","name":"to","required":true},{"schema":{"type":"string","enum":["expands","relates","depends","cites"]},"in":"query","name":"kind","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"path","name":"graph","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/search":{"get":{"summary":"Find the passages that answer a question, grouped by canvas, with a citation; says `answer: none` when the judge finds nothing that answers","tags":["knowledge"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":500},"in":"query","name":"q","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"query","name":"graph","required":false},{"schema":{"type":"integer","minimum":1,"maximum":25},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/index":{"get":{"summary":"How much of the workspace’s knowledge is searchable: live canvases, their passages, and how many passages each embedding model has covered","tags":["knowledge"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/events":{"post":{"summary":"Report how canvases are used: views, dwell, follows and feedback","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["graph","node","kind"],"properties":{"graph":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"node":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"kind":{"type":"string","enum":["view","dwell","retrieved","shown","followed","helpful","confusing","wrong","not-relevant"]},"blockId":{"type":"string","maxLength":64},"value":{"type":"integer","minimum":0,"maximum":86400},"note":{"type":"string","maxLength":1000}}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/attention":{"get":{"summary":"Knowledge that needs a look: stale, low-trust, duplicate, orphaned or unused canvases, worst first — and questions nothing answered in the last 30 days","tags":["knowledge"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"in":"query","name":"graph","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/screens":{"post":{"summary":"Open a live screen: a link a person keeps open while you show them canvases","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"label":{"type":"string","minLength":1,"maxLength":120}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/screens/{screen}/show":{"post":{"summary":"Put a canvas on a live screen, optionally scrolled to one block","tags":["knowledge"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["graph","node"],"properties":{"graph":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"node":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$","maxLength":80},"focus":{"type":"string","maxLength":64},"note":{"type":"string","maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","maxLength":64},"in":"path","name":"screen","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/comments":{"post":{"summary":"Comment on a task","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["body"],"properties":{"body":{"type":"string","minLength":1},"workerId":{"type":"string","maxLength":128},"authorLabel":{"type":"string","maxLength":200}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List a task’s comments (oldest first)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/comments/{commentId}":{"delete":{"summary":"Delete a comment","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"commentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/attachments":{"post":{"summary":"Start an attachment upload (returns a presigned PUT)","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["filename","contentType","sizeBytes"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","minLength":3,"maxLength":128,"pattern":"^[\\w.+-]+/[\\w.+-]+$"},"sizeBytes":{"type":"number","minimum":1},"workerId":{"type":"string","maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List a task’s attachments","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/attachments/{attachmentId}/confirm":{"post":{"summary":"Confirm an upload (verifies the object landed in storage)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/attachments/{attachmentId}/download":{"get":{"summary":"Get a short-lived presigned download URL","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/attachments/{attachmentId}":{"delete":{"summary":"Delete an attachment (row + stored object)","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/approvals":{"get":{"summary":"People waiting for approval to join, oldest first","tags":["workers"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Approve or reject people waiting to join, many at once","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerIds","decision"],"properties":{"workerIds":{"type":"array","minItems":1,"maxItems":200,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"decision":{"type":"string","enum":["approve","reject"]}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers":{"post":{"summary":"Create or update a worker","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"routingWeights":{"type":"object","additionalProperties":{"type":"number","minimum":0},"maxProperties":128},"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5},"weightOverride":{"type":"number","minimum":0,"maximum":100},"validFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}},"teamIds":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32},"ip":{"type":"string","maxLength":45},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxTravelDistanceKm":{"type":"number","minimum":0},"maxBacklogSize":{"type":"number","minimum":0},"available":{"type":"boolean"},"locale":{"type":["string","null"]}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List worker ids","tags":["workers"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}":{"get":{"summary":"Worker detail: routing profile, availability, load","tags":["workers"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a worker in place (partial)","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"routingWeights":{"type":"object","additionalProperties":{"type":"number","minimum":0},"maxProperties":128},"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5},"weightOverride":{"type":"number","minimum":0,"maximum":100},"validFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}},"teamIds":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32},"ip":{"type":"string","maxLength":45},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxTravelDistanceKm":{"type":"number","minimum":0},"maxBacklogSize":{"type":"number","minimum":0},"available":{"type":"boolean"},"locale":{"type":["string","null"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove (offboard) a worker","tags":["workers"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"lastDay","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/availability":{"post":{"summary":"Pause or resume a worker (backlog preserved unless releaseBacklog)","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["available"],"properties":{"available":{"type":"boolean"},"releaseBacklog":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/queue":{"get":{"summary":"A worker's current task queue","tags":["workers"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/metrics":{"get":{"summary":"Worked time, breaks and throughput for one worker","tags":["workers"],"parameters":[{"schema":{"type":"string","default":"7d"},"in":"query","name":"window","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/task-time":{"get":{"summary":"What one worker spent time on, measured from task transitions","tags":["workers"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/time/day":{"get":{"summary":"One worker's day as a timeline","tags":["workers"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"date","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/time-entries":{"get":{"summary":"The shift and break log for one worker over a window","tags":["workers"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","enum":["json","csv"]},"in":"query","name":"format","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Record a shift that was worked but never logged","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt","note"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"note":{"type":"string","minLength":3,"maxLength":500},"breaks":{"type":"array","maxItems":24,"items":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"}}}},"description":{"type":["string","null"],"maxLength":1000},"taskId":{"type":["string","null"],"maxLength":200},"roles":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["positionId","startedAt","endedAt"],"properties":{"positionId":{"type":["string","null"],"maxLength":64},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/time-entries/{entryId}":{"patch":{"summary":"Correct one recorded shift or break, keeping what it said before","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["note"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"note":{"type":"string","minLength":3,"maxLength":500},"type":{"type":"string","enum":["shift","break"]},"breaks":{"type":"array","maxItems":24,"items":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt"],"properties":{"id":{"type":"string","maxLength":64},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}}},"description":{"type":["string","null"],"maxLength":1000},"taskId":{"type":["string","null"],"maxLength":200},"roles":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["positionId","startedAt","endedAt"],"properties":{"positionId":{"type":["string","null"],"maxLength":64},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"entryId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/time-entries/{entryId}/metadata":{"patch":{"summary":"Add a description or task link to a recorded shift or break","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","enum":["shift","break"]},"description":{"type":["string","null"],"maxLength":1000},"taskId":{"type":["string","null"],"maxLength":200}},"anyOf":[{"required":["description"]},{"required":["taskId"]}]}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"entryId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/time-entries/{entryId}/roles":{"put":{"summary":"State the roles a recorded shift was worked in","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["roles","note"],"properties":{"roles":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["positionId","startedAt","endedAt"],"properties":{"positionId":{"type":["string","null"],"maxLength":64},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}}},"note":{"type":"string","minLength":3,"maxLength":500}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"entryId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/role":{"post":{"summary":"Change the role a worker on shift is doing","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["positionId"],"properties":{"positionId":{"type":["string","null"],"maxLength":64}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/time-corrections":{"get":{"summary":"Changes made to one worker's time records","tags":["workers"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/offboarding":{"get":{"summary":"Preview what removing a worker hands back and frees","tags":["workers"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"lastDay","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/links":{"get":{"summary":"List worker ↔ connector user links","tags":["workers"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"in":"query","name":"connector","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/links/{connector}":{"put":{"summary":"Link a worker to their user in a connected system","tags":["workers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["vendorUserId"],"properties":{"vendorUserId":{"type":"string","minLength":1,"maxLength":256},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64}}}}}},"parameters":[{"schema":{"type":"string","maxLength":128},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"in":"path","name":"connector","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a worker’s link to a connected system","tags":["workers"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"in":"path","name":"connector","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/photo":{"delete":{"summary":"Remove a worker’s profile photo","tags":["workers"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/leave-settlements":{"get":{"summary":"List removed workers whose leave is not yet settled","tags":["workers"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/settle-leave":{"post":{"summary":"Settle a removed worker’s leave","tags":["workers"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-identities":{"get":{"summary":"List worker portal identities","tags":["worker-identities"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-identities/invite":{"post":{"summary":"Invite a worker by email with a set-your-own-PIN magic link","tags":["worker-identities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","format":"email","maxLength":256},"workerId":{"type":"string","minLength":1,"maxLength":128},"label":{"type":"string","minLength":1,"maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5},"weightOverride":{"type":"number","minimum":0,"maximum":100},"validFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}},"teamIds":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-identities/{workerId}/invite/resend":{"post":{"summary":"Mint a fresh invite link for a pending identity (invalidates old links)","tags":["worker-identities"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{workerId}/identity":{"post":{"summary":"Create a worker identity and PIN for the portal","tags":["worker-identities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["label","pin"],"properties":{"label":{"type":"string","minLength":1,"maxLength":128},"pin":{"type":"string","minLength":4,"maxLength":256},"email":{"type":"string","format":"email","maxLength":256},"agent":{"type":"boolean","description":"An AI agent, issued as one by this key: it may use the workspace’s knowledge"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a worker identity (PIN, label, email, status)","tags":["worker-identities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":128},"pin":{"type":"string","minLength":4,"maxLength":256},"email":{"type":["string","null"],"format":"email","maxLength":256},"status":{"type":"string","enum":["active","revoked"]},"executorKind":{"type":"string","enum":["human","agent"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a worker identity and all its sessions","tags":["worker-identities"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{workerId}/identity/agent":{"post":{"summary":"Mark a worker’s identity as an AI agent issued by this workspace — it may then read and keep knowledge from its own session. Idempotent.","tags":["worker-identities"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/join-links":{"post":{"summary":"Create a QR join link for worker self-registration","tags":["worker-identities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1,"maxLength":128},"teamId":{"type":"string","maxLength":64},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5},"weightOverride":{"type":"number","minimum":0,"maximum":100},"validFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}},"requiresApproval":{"type":"boolean"},"maxUses":{"type":"number","minimum":1,"maximum":10000},"expiresInMs":{"type":"number","minimum":60000,"maximum":7776000000}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List QR join links (tokens are never returned after creation)","tags":["worker-identities"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/join-links/{id}":{"delete":{"summary":"Revoke a QR join link immediately","tags":["worker-identities"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal":{"get":{"summary":"Worker portal status and login URL","tags":["worker-identities"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skills":{"post":{"summary":"Create a skill in the workspace catalog","tags":["skills"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["key","name"],"properties":{"key":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":512}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List skills (or autocomplete with ?q=)","tags":["skills"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"q","required":false},{"schema":{"type":"number","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skills/{id}":{"get":{"summary":"Get a skill by id","tags":["skills"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a skill name/description","tags":["skills"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a skill from the catalog","tags":["skills"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skills/expiring":{"get":{"summary":"List qualifications that have lapsed or are about to","tags":["skills"],"parameters":[{"schema":{"type":"integer","minimum":0,"maximum":365},"in":"query","name":"withinDays","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skills/suggest":{"get":{"summary":"Suggest skills to add to a worker profile","tags":["skills"],"parameters":[{"schema":{"type":"string","maxLength":1024},"in":"query","name":"selected","required":false},{"schema":{"type":"number","minimum":1,"maximum":50},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skill-imports":{"post":{"summary":"Map uploaded rows onto the skill taxonomy","tags":["skill-imports"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"source":{"type":"string","maxLength":200},"rows":{"type":"array","minItems":1,"maxItems":250,"items":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"workerId":{"type":"string","maxLength":128},"text":{"type":"string","minLength":1,"maxLength":2000},"context":{"type":"object","additionalProperties":{"type":"string","maxLength":200}}}}},"thresholds":{"type":"object","additionalProperties":false,"properties":{"applyAt":{"type":"number","exclusiveMinimum":0,"maximum":1},"reviewAt":{"type":"number","exclusiveMinimum":0,"maximum":1}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List recent skill imports","tags":["skill-imports"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skill-imports/{importId}/rows":{"get":{"summary":"The review queue for one import","tags":["skill-imports"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"importId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/skill-imports/{importId}/rows/{rowId}/confirm":{"post":{"summary":"Record a human's answer for one row","tags":["skill-imports"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["answer"],"properties":{"answer":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"importId","required":true},{"schema":{"type":"string"},"in":"path","name":"rowId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/intake/messages":{"post":{"summary":"Classify an inbound message into a task, or the tray","tags":["intake"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["body"],"properties":{"externalId":{"type":"string","maxLength":200},"channel":{"type":"string","maxLength":40},"sender":{"type":"string","maxLength":320},"subject":{"type":"string","maxLength":500},"body":{"type":"string","minLength":1,"maxLength":20000},"recipients":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":320}},"thresholds":{"type":"object","additionalProperties":false,"properties":{"applyAt":{"type":"number","exclusiveMinimum":0,"maximum":1},"reviewAt":{"type":"number","exclusiveMinimum":0,"maximum":1}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/intake/tray":{"get":{"summary":"Messages waiting for a human","tags":["intake"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/intake/tray/{messageId}/resolve":{"post":{"summary":"Accept a tray message as a task, or dismiss it","tags":["intake"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"type":"string","enum":["accept","dismiss"]},"title":{"type":"string","maxLength":200},"skillId":{"type":"string","maxLength":128},"priority":{"type":"number"},"priorityLevel":{"type":"string","enum":["routine","this_week","today","blocking"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"messageId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/suggestions":{"get":{"summary":"Machine suggestions, with the confidence and threshold behind each","tags":["intake"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/teams":{"post":{"summary":"Create a team","tags":["teams"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["key","name"],"properties":{"key":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":512},"color":{"type":"string","maxLength":32}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List teams","tags":["teams"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/teams/{id}":{"get":{"summary":"Get a team by id","tags":["teams"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a team name/description/color","tags":["teams"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":["string","null"],"maxLength":512},"color":{"type":["string","null"],"maxLength":32}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a team","tags":["teams"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/teams/{id}/members":{"get":{"summary":"List a team’s members","tags":["teams"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Replace a team’s membership roster","tags":["teams"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerIds"],"properties":{"workerIds":{"type":"array","maxItems":1000,"items":{"type":"string","minLength":1,"maxLength":128}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/status":{"get":{"summary":"Get workspace learning status and stats","tags":["learning"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/workers/{workerId}":{"get":{"summary":"Per-worker learning tag stats mapped to the skill catalog","tags":["learning"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/weights/preview":{"get":{"summary":"Preview synthesized routing weights before applying","tags":["learning"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"boolean"},"in":"query","name":"overrideManual","required":false},{"schema":{"type":"boolean"},"in":"query","name":"includeUnexploredTags","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/weights/apply":{"post":{"summary":"Apply synthesized routing weights to workers","tags":["learning"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"workerIds":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100},"overrideManual":{"type":"boolean"},"includeUnexploredTags":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/weights/revert":{"post":{"summary":"Restore routing weights saved before the last sync","tags":["learning"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"workerIds":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/feedback":{"post":{"summary":"Record external learning signals for a task","tags":["learning"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["signals"],"properties":{"signals":{"type":"object","additionalProperties":{"type":"number"}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/reward":{"post":{"summary":"Record a manual learning reward for a task","tags":["learning"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["reward"],"properties":{"reward":{"type":"number"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/feedback":{"post":{"summary":"Bulk feedback/reward import for many tasks","tags":["learning"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["taskId"],"properties":{"taskId":{"type":"string","maxLength":128},"signals":{"type":"object","additionalProperties":{"type":"number"}},"reward":{"type":"number"}}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/learning/reset":{"post":{"summary":"Reset the learned model and tag stats","tags":["learning"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/decisions":{"get":{"summary":"Query decision traces (who was matched, and why)","tags":["decisions"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats":{"get":{"summary":"Live workspace snapshot: counts, wait age, per-worker load, meter","tags":["stats"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/live":{"get":{"summary":"Live-ops overview: the queue by lane (routing tag), wait distribution, flow in and out over the last hour, every worker's state, and — when the workspace has sites — post cover right now","tags":["stats"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/live/lanes/{tag}":{"get":{"summary":"One lane (routing tag): its oldest queued tasks, oldest first, and everyone who could take them","tags":["stats"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"tag","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/sla":{"get":{"summary":"SLA attainment counters for tasks carrying an sla policy","tags":["stats"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"tag","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/queue-audit":{"get":{"summary":"Why queued tasks are waiting, plus whether the deadline sweeps are keeping up","tags":["stats"],"parameters":[{"schema":{"type":"number","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"number","minimum":0},"in":"query","name":"minWaitingMs","required":false},{"schema":{"type":"boolean"},"in":"query","name":"includeHealthy","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/timeseries":{"get":{"summary":"Historical task stats bucketed by hour or day","tags":["stats"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","enum":["hour","day"]},"in":"query","name":"bucket","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/workers":{"get":{"summary":"Per-worker historical productivity over a window","tags":["stats"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","enum":["hour","day"]},"in":"query","name":"bucket","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"teamId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/workers/{workerId}/timeseries":{"get":{"summary":"One worker’s historical stats bucketed by hour or day, with worked/break time per day","tags":["stats"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","enum":["hour","day"]},"in":"query","name":"bucket","required":false},{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/presence":{"get":{"summary":"Workspace team presence: each worker is working, on break, or paused. Requires the control plane.","tags":["stats"],"parameters":[{"schema":{"type":"string","maxLength":64},"in":"query","name":"teamId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/breaks/metrics":{"get":{"summary":"Per-worker break totals for a window (defaults to today). Requires the control plane.","tags":["stats"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"teamId","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time":{"get":{"summary":"The team's shift, break and worked time for a window. Requires the control plane.","tags":["stats"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"teamId","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"boolean","default":false},"in":"query","name":"entries","required":false},{"schema":{"type":"string","enum":["json","csv"]},"in":"query","name":"format","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/payroll/export":{"get":{"summary":"The period as a vendor-shaped CSV","tags":["stats"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","maxLength":64},"in":"query","name":"profile","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/payroll":{"get":{"summary":"Recorded hours priced by the pay brackets, set against the published rota","tags":["stats"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","maxLength":64},"in":"query","name":"teamId","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","enum":["json","csv"]},"in":"query","name":"format","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/closures":{"get":{"summary":"Pay periods that have been closed, and any that were reopened","tags":["stats"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"boolean","default":false},"in":"query","name":"activeOnly","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/payroll/analysis":{"get":{"summary":"What payroll has cost, from the ledger of closed periods","tags":["stats"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"string","enum":["period","jurisdiction","worker","component","taxYear","currency"],"default":"period"},"in":"query","name":"groupBy","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","maxLength":6},"in":"query","name":"jurisdiction","required":false},{"schema":{"type":"string","maxLength":8},"in":"query","name":"taxYearId","required":false},{"schema":{"type":"string","enum":["gross","employee","employer"]},"in":"query","name":"side","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/closures/{closureId}/statutory":{"get":{"summary":"The statutory figures a closed period was signed off on","tags":["stats"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"closureId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/close":{"post":{"summary":"Close a pay period, so its records can no longer be changed","tags":["stats"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"note":{"type":"string","maxLength":500},"force":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/closures/{id}/reopen":{"post":{"summary":"Reopen a closed pay period","tags":["stats"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":"string","maxLength":500}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/payroll/send-plan":{"get":{"summary":"What a payroll system would be sent for this period, and anything in the way","tags":["stats"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","maxLength":8000},"in":"query","name":"exclude","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/payroll/send":{"post":{"summary":"Send a closed period's hours to the payroll system","tags":["stats"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exclude":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":500}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/payroll/pay-types":{"put":{"summary":"Match each kind of hour to a payroll pay type, and choose review or automatic","tags":["stats"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"payTypes":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","additionalProperties":false,"required":["code"],"properties":{"code":{"type":"string","minLength":1,"maxLength":32},"label":{"type":"string","maxLength":120}}},{"type":"null"}]}},"sendMode":{"type":"string","enum":["review","auto"]}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/team/time/closures/covering":{"get":{"summary":"The closed period covering a date, if any","tags":["stats"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"date","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/stats/automation":{"get":{"summary":"Share of people-work agents took on, by skill, team, agent and week; agent time to an accepted result","tags":["stats"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tasks/{id}/verdict":{"get":{"summary":"Whether a finished task’s result was accepted or sent back","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Accept a finished task’s result, or send it back","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["verdict"],"properties":{"verdict":{"type":"string","enum":["accepted","rejected"]},"reason":{"type":"string","maxLength":2000}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Undo an answer: the result is pending again until the auto-accept window passes","tags":["tasks"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflows":{"get":{"summary":"List workflow definitions","tags":["workflows"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflows/{id}":{"get":{"summary":"Get a workflow definition","tags":["workflows"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Create or replace a workflow definition","tags":["workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["name","steps"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"number"},"initialStepId":{"type":"string","maxLength":128},"steps":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","required":["id","name"],"additionalProperties":true,"properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"taskType":{"type":"string","enum":["assignment","machine","external"]},"data":{"type":"object","description":"What the step’s work is and what a finished result must look like: { title?, description?, resultContract? }"}}}},"defaultTimeoutMs":{"type":"number"},"metadata":{"type":"object"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a workflow definition","tags":["workflows"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflows/{id}/runs":{"post":{"summary":"Start a workflow run","tags":["workflow-runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"context":{"type":"object"},"initiatorWorkerId":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List runs of a workflow definition","tags":["workflow-runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflow-runs":{"get":{"summary":"List workflow runs","tags":["workflow-runs"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflow-runs/{runId}":{"get":{"summary":"Get a workflow run","tags":["workflow-runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"runId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflow-runs/{runId}/steps":{"get":{"summary":"Get a run's per-step state","tags":["workflow-runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"runId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflow-runs/{runId}/cancel":{"post":{"summary":"Cancel a workflow run","tags":["workflow-runs"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"runId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflow-runs/{runId}/steps/{stepId}/complete":{"post":{"summary":"Complete an external workflow step","tags":["workflow-runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object"},"error":{"type":"string","maxLength":2000}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"runId","required":true},{"schema":{"type":"string"},"in":"path","name":"stepId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workflow-runs/{runId}/steps/{stepId}/fail":{"post":{"summary":"Fail an external workflow step","tags":["workflow-runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"object"},"error":{"type":"string","maxLength":2000}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"runId","required":true},{"schema":{"type":"string"},"in":"path","name":"stepId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/notification-sequences":{"get":{"summary":"List notification sequences","tags":["notifications"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a notification sequence","tags":["notifications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","steps"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"enabled":{"type":"boolean"},"steps":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["trigger","eventType"],"properties":{"trigger":{"type":"string","enum":["matched","expiring","expired","accepted","rejected","completed"]},"offsetMs":{"type":"number"},"eventType":{"type":"string","minLength":1,"maxLength":128}}}},"filterTags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":32}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/notification-sequences/{id}":{"get":{"summary":"Get a notification sequence","tags":["notifications"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a notification sequence","tags":["notifications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"enabled":{"type":"boolean"},"steps":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["trigger","eventType"],"properties":{"trigger":{"type":"string","enum":["matched","expiring","expired","accepted","rejected","completed"]},"offsetMs":{"type":"number"},"eventType":{"type":"string","minLength":1,"maxLength":128}}}},"filterTags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":32}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a notification sequence","tags":["notifications"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/notification-channels":{"get":{"summary":"List notification channels","tags":["notifications"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a notification channel","tags":["notifications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["type","target","events"],"properties":{"type":{"type":"string","enum":["webhook","websocket"]},"target":{"type":"string","minLength":1,"maxLength":2048},"events":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"maxLength":128},"maxItems":64},"secret":{"type":"string","maxLength":512}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/notification-channels/{id}":{"get":{"summary":"Get a notification channel","tags":["notifications"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a notification channel","tags":["notifications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["webhook","websocket"]},"target":{"type":"string","minLength":1,"maxLength":2048},"events":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"maxLength":128},"maxItems":64},"secret":{"type":"string","maxLength":512},"disabled":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a notification channel","tags":["notifications"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/public-pages":{"get":{"summary":"List public rota pages","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a public rota page for a site, a team or both","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"siteId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"namesMode":{"type":"string","enum":["initial","full","none"]},"accessCode":{"anyOf":[{"type":"string","pattern":"^[0-9]{4}$"},{"type":"null"}]},"requireCode":{"type":"boolean"},"showTimeOff":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/public-pages/{id}":{"patch":{"summary":"Turn a public rota page on or off, or change who can read it","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"rotateLink":{"type":"boolean"},"namesMode":{"type":"string","enum":["initial","full","none"]},"accessCode":{"anyOf":[{"type":"string","pattern":"^[0-9]{4}$"},{"type":"null"}]},"requireCode":{"type":"boolean"},"showTimeOff":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a public rota page","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles":{"get":{"summary":"List planning cycles","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs":{"get":{"summary":"List planning cycle runs","tags":["roster"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"scope","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs/{id}":{"get":{"summary":"Read a planning cycle run and its log","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs/{id}/remind":{"post":{"summary":"Remind a planning run's crew to send their wishes","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs/{id}/hold":{"post":{"summary":"Hold a planned rota so it does not go out on its own, or release it","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"held":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs/{id}/waive-drafts":{"post":{"summary":"Waive a planned run's current draft busy periods so it can publish without them","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs/{id}/replan":{"post":{"summary":"Send a planned run back to be solved again, at once","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/runs/{id}/approve":{"post":{"summary":"Approve a planned rota: publish it now and offer its empty shifts","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"versionId":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/preview":{"post":{"summary":"Preview the dates a planning cycle would give","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["cadence","anchorDate","openLeadDays","wishDeadline","reviewHours"],"properties":{"cadence":{"type":"object","additionalProperties":false,"required":["unit","every"],"properties":{"unit":{"type":"string","enum":["weeks","months"]},"every":{"type":"integer","minimum":1,"maximum":8}}},"anchorDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"openLeadDays":{"type":"integer","minimum":1,"maximum":90},"wishDeadline":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["beforeStart","dayOfMonth"]},"days":{"type":"integer","minimum":1,"maximum":60},"day":{"type":"integer","minimum":1,"maximum":28}}},"reviewHours":{"type":"integer","minimum":0,"maximum":168}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/cycles/{scope}":{"get":{"summary":"Read a planning cycle","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"scope","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Save a planning cycle","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["cadence","anchorDate","openLeadDays","wishDeadline","reviewHours","autonomy"],"properties":{"cadence":{"type":"object","additionalProperties":false,"required":["unit","every"],"properties":{"unit":{"type":"string","enum":["weeks","months"]},"every":{"type":"integer","minimum":1,"maximum":8}}},"anchorDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"openLeadDays":{"type":"integer","minimum":1,"maximum":90},"wishDeadline":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["beforeStart","dayOfMonth"]},"days":{"type":"integer","minimum":1,"maximum":60},"day":{"type":"integer","minimum":1,"maximum":28}}},"reviewHours":{"type":"integer","minimum":0,"maximum":168},"autonomy":{"type":"string","enum":["off","shadow","supervised","autonomous"]},"approverIds":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":128}},"publishPolicy":{"type":"object","additionalProperties":false,"properties":{"maxHardBreaches":{"type":"integer"},"minWishesMetPercent":{"type":"integer"},"maxMediumBreaches":{"type":"integer"}}},"coverPolicy":{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["manual","cascade"]},"firstWave":{"type":"integer"},"waveMinutes":{"type":"integer"},"maxWaves":{"type":"integer"},"escalateBeforeMinutes":{"type":"integer"},"modeStated":{"type":"boolean"}}},"swapPolicy":{"type":"object","additionalProperties":false,"properties":{"approval":{"type":"string","enum":["never","always","crossSite","premium"]},"modeStated":{"type":"boolean"}}},"timeOffPolicy":{"type":"object","additionalProperties":false,"properties":{"autoApprove":{"type":"string","enum":["none","noImpact"]},"modeStated":{"type":"boolean"}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"scope","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/policy-sets":{"get":{"summary":"List leave policy sets","tags":["leave"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"query","name":"status","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Create or update leave policy sets","tags":["leave"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["sets"],"properties":{"sets":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","additionalProperties":false,"required":["name","scopeKind","rules"],"properties":{"id":{"type":"string","maxLength":64},"revision":{"type":"integer","minimum":0},"name":{"type":"string","minLength":1,"maxLength":120},"scopeKind":{"type":"string","enum":["jurisdiction","workspace","site","team","agreement"]},"scopeIds":{"type":"array","maxItems":500,"items":{"type":"string","minLength":1,"maxLength":128}},"leaveTypeId":{"type":["string","null"],"maxLength":64},"category":{"type":["string","null"],"enum":["annual","sick","parental","care","unpaid","toil","other",null]},"rules":{"type":"object"},"effectiveFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effectiveTo":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"priority":{"type":"integer","minimum":0,"maximum":1000},"status":{"type":"string","enum":["active","draft","archived"]}}}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/policy-sets/{id}":{"delete":{"summary":"Archive a leave policy set","tags":["leave"],"parameters":[{"schema":{"type":"integer","minimum":0},"in":"query","name":"revision","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/packs":{"get":{"summary":"List leave packs","tags":["leave"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/packs/{id}/apply":{"post":{"summary":"Apply a leave pack","tags":["leave"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/rules/explain":{"get":{"summary":"Explain the leave rules for a type","tags":["leave"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"query","name":"leaveTypeId","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"onDate","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/notices":{"get":{"summary":"List year-end leave notices","tags":["leave"],"description":"Who was told how much leave is left and by when, on which channels, and whether they opened it. Each notice has a `status`: `sent`, `unsent` (nobody got it yet), or `due` — due within the lead days with leave that would go, but not written yet (no `id`). The first page starts with the `due` ones, soonest first, at most `limit` of them, and `dueTotal` counts them all; ask with `workerId` for one person. With `held=true`, the expiries that did not happen because nobody was told. With `askManager=true`, the notices a manager was asked to give by hand (the person has no app login or email), each with `days` in the person’s own working week.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"query","name":"leaveTypeId","required":false},{"schema":{"type":"boolean"},"in":"query","name":"held","required":false},{"schema":{"type":"boolean"},"in":"query","name":"askManager","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/carry-requests":{"get":{"summary":"List carry-over requests","tags":["leave"],"description":"Requests from workers to carry leave over into next year, oldest first. `status` is a comma list of pending, approved and denied. A request still pending on the last day of its leave year is declined.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/notices/{id}/told":{"post":{"summary":"Record that a manager told the person","tags":["leave"],"description":"For a person no notice can reach (no app login or email), once their manager was asked: the manager told them, so the notice counts as sent, on channel `manager`, now. Where the law lets leave expire only after a notice, the expiry then goes ahead at the next pass. Audited. 409 `notice_already_sent` when it already went out, `notice_not_asked` when no manager was asked to pass it on.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/carry-requests/{id}/approve":{"post":{"summary":"Approve a carry-over request","tags":["leave"],"description":"The approval is the written agreement on record. Refused with 409 `carry_year_closed` on or after the last day of the leave year the request is about.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512},"revision":{"type":"integer","minimum":0}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/carry-requests/{id}/deny":{"post":{"summary":"Decline a carry-over request","tags":["leave"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512},"revision":{"type":"integer","minimum":0}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/settings":{"get":{"summary":"Read rostering settings","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update rostering settings","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"timeZone":{"type":"string","minLength":1,"maxLength":64},"rules":{"type":"object"},"defaultTimeBudgetMs":{"type":"integer","minimum":0,"maximum":30000},"travelSpeedKmh":{"type":["integer","null"],"minimum":1,"maximum":300},"holidayCountry":{"type":["string","null"],"minLength":2,"maxLength":2},"holidayRegion":{"type":["string","null"],"minLength":1,"maxLength":16},"rulePackId":{"type":["string","null"],"maxLength":64},"preferencesEnabled":{"type":"boolean"},"importantWishesPerMonth":{"type":"integer","minimum":0,"maximum":10},"importantWishWeight":{"type":"string","enum":["bit","more","much"]},"preferencesEqualWeight":{"type":"boolean"},"leaveAuthority":{"type":"string","enum":["fivexer","hr","fivexer_writeback"]},"leaveConnectionId":{"type":["string","null"],"minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/holiday-locations":{"get":{"summary":"Countries and regions the holiday calendar covers","tags":["roster"],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":2},"in":"query","name":"country","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/holidays":{"get":{"summary":"Public holidays in a window, from the workspace’s calendar","tags":["roster"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/pay":{"get":{"summary":"Read the workspace pay setup","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update the workspace pay setup","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/terms/{workerId}/tax-profile":{"get":{"summary":"One worker's statutory tax profile","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/tax-jurisdictions":{"get":{"summary":"The countries whose payroll rules this deployment ships","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/terms":{"get":{"summary":"Every worker's terms — contract, rate, overtime consent","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/terms/{workerId}/preferences":{"get":{"summary":"Read one worker's schedule wishes","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Replace one worker's schedule wishes","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/terms/{workerId}":{"put":{"summary":"Replace one worker's terms","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"weeklyMinutes":{"type":["integer","null"],"minimum":0,"maximum":10080},"fte":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1},"maxDaysInPeriod":{"type":["integer","null"],"minimum":1,"maximum":31},"rateCents":{"type":["integer","null"],"minimum":0,"maximum":1000000},"payrollId":{"type":["string","null"],"maxLength":64},"overtimeConsent":{"type":["boolean","null"]},"homeSiteId":{"type":["string","null"],"maxLength":128},"siteIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"weeklyPattern":{"type":["array","null"],"minItems":7,"maxItems":7,"items":{"type":"integer","minimum":0,"maximum":1440}},"jurisdiction":{"type":["string","null"],"pattern":"^[A-Za-z]{2}(-[A-Za-z0-9]{1,3})?$"},"protections":{"type":["array","null"],"maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["minor","hazardousNight","pregnancyNightExclusion"]},"fallback":{"type":"string","enum":["dayShift","leave"]}}}},"rulesOverride":{"type":["object","null"]},"dateOfBirth":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"taxFacts":{"type":["object","null"]},"serviceStartDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"contractEndDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"rateChanges":{"type":["object","null"]},"positionRates":{"type":["object","null"],"maxProperties":100,"propertyNames":{"minLength":1,"maxLength":64},"additionalProperties":{"type":["integer","null"],"minimum":0,"maximum":1000000}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/planned-hours":{"get":{"summary":"Planned hours by worker and pay bracket, from the rota","tags":["roster"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","enum":["published","draft"]},"in":"query","name":"source","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/starting-points":{"get":{"summary":"Rule packs, shift patterns and site shapes to start from","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/patterns/{id}/apply":{"post":{"summary":"Create a shift pattern’s templates","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/templates":{"get":{"summary":"List shift templates","tags":["roster"],"parameters":[{"schema":{"type":"string","enum":["events"]},"in":"query","name":"include","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a shift template","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","startTime","endTime"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"color":{"type":["string","null"],"maxLength":32},"teamId":{"type":["string","null"],"maxLength":128},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"daysOfWeek":{"type":["array","null"],"maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"dates":{"type":["array","null"],"maxItems":366,"items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":1,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"demandOverrides":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}},"staffingInheritedFields":{"type":"array","maxItems":5,"uniqueItems":true,"items":{"type":"string","enum":["minEmployees","maxEmployees","requiredTags","tagRequirements","tagMaximums"]}},"stationId":{"type":["string","null"],"maxLength":128},"bandId":{"type":["string","null"],"maxLength":128},"siteId":{"type":["string","null"],"maxLength":128},"unpaidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"paidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"shiftTypeTag":{"type":["string","null"],"maxLength":64},"active":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/templates/{id}":{"patch":{"summary":"Update a shift template","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"color":{"type":["string","null"],"maxLength":32},"teamId":{"type":["string","null"],"maxLength":128},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"daysOfWeek":{"type":["array","null"],"maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"dates":{"type":["array","null"],"maxItems":366,"items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":1,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"demandOverrides":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}},"staffingInheritedFields":{"type":"array","maxItems":5,"uniqueItems":true,"items":{"type":"string","enum":["minEmployees","maxEmployees","requiredTags","tagRequirements","tagMaximums"]}},"stationId":{"type":["string","null"],"maxLength":128},"bandId":{"type":["string","null"],"maxLength":128},"siteId":{"type":["string","null"],"maxLength":128},"unpaidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"paidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"shiftTypeTag":{"type":["string","null"],"maxLength":64},"active":{"type":"boolean"},"demandOverridesBase":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a shift template","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/site-shapes/{id}/apply":{"post":{"summary":"Seed a coverage grid from a site shape","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/coverage":{"get":{"summary":"Stations, bands and the shifts that fill them","tags":["roster"],"parameters":[{"schema":{"type":"string","enum":["events"]},"in":"query","name":"include","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Empty the coverage grid","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/sites":{"get":{"summary":"List sites and their travel times","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a site","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"address":{"type":["string","null"],"maxLength":512},"lat":{"type":["number","null"],"minimum":-90,"maximum":90},"lng":{"type":["number","null"],"minimum":-180,"maximum":180},"travelMinutesTo":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1440}},"country":{"type":["string","null"],"minLength":2,"maxLength":2},"region":{"type":["string","null"],"maxLength":8},"holidayCountry":{"type":["string","null"],"minLength":2,"maxLength":2},"holidayRegion":{"type":["string","null"],"maxLength":8},"timeZone":{"type":["string","null"],"maxLength":64},"rulePackId":{"type":["string","null"],"maxLength":64},"ownerIds":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":128}},"sortOrder":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/sites/{id}":{"patch":{"summary":"Update a site or its travel times","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"address":{"type":["string","null"],"maxLength":512},"lat":{"type":["number","null"],"minimum":-90,"maximum":90},"lng":{"type":["number","null"],"minimum":-180,"maximum":180},"travelMinutesTo":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1440}},"country":{"type":["string","null"],"minLength":2,"maxLength":2},"region":{"type":["string","null"],"maxLength":8},"holidayCountry":{"type":["string","null"],"minLength":2,"maxLength":2},"holidayRegion":{"type":["string","null"],"maxLength":8},"timeZone":{"type":["string","null"],"maxLength":64},"rulePackId":{"type":["string","null"],"maxLength":64},"ownerIds":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":128}},"sortOrder":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a site","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/geocode":{"get":{"summary":"Find a place by address","tags":["roster"],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":200},"in":"query","name":"q","required":true},{"schema":{"type":"integer","minimum":1,"maximum":10},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/sites/travel/estimate":{"post":{"summary":"Estimate travel times between sites","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["car","transit","bike"]},"siteIds":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":64}}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/stations":{"get":{"summary":"List coverage posts","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a coverage post","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"staffingDefaults":{"type":["object","null"],"additionalProperties":false,"properties":{"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":1,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}}}},"name":{"type":"string","minLength":1,"maxLength":128},"note":{"type":["string","null"],"maxLength":512},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"teamId":{"type":["string","null"],"maxLength":128},"siteId":{"type":["string","null"],"maxLength":128},"sortOrder":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"},"promoteLooseShifts":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/stations/{id}":{"patch":{"summary":"Update a coverage post","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"staffingDefaults":{"type":["object","null"],"additionalProperties":false,"properties":{"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":1,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}}}},"name":{"type":"string","minLength":1,"maxLength":128},"note":{"type":["string","null"],"maxLength":512},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"teamId":{"type":["string","null"],"maxLength":128},"siteId":{"type":["string","null"],"maxLength":128},"sortOrder":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a coverage post and its shifts","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/bands":{"get":{"summary":"List shift bands","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a shift band","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","startTime","endTime"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"unpaidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"paidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"shiftTypeTag":{"type":["string","null"],"maxLength":64},"color":{"type":["string","null"],"maxLength":32},"sortOrder":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/bands/{id}":{"patch":{"summary":"Update a shift band and the shifts in it","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"unpaidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"paidBreakMinutes":{"type":"integer","minimum":0,"maximum":1440},"shiftTypeTag":{"type":["string","null"],"maxLength":64},"color":{"type":["string","null"],"maxLength":32},"sortOrder":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a shift band and its shifts","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/coverage/{stationId}/{bandId}":{"put":{"summary":"Replace the shifts in one coverage cell","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["shifts"],"properties":{"shifts":{"type":"array","maxItems":14,"items":{"type":"object","additionalProperties":false,"properties":{"staffingInheritedFields":{"type":"array","maxItems":5,"uniqueItems":true,"items":{"type":"string","enum":["minEmployees","maxEmployees","requiredTags","tagRequirements","tagMaximums"]}},"name":{"type":"string","minLength":1,"maxLength":128},"daysOfWeek":{"type":"array","minItems":1,"maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":1,"maximum":1000},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"demandOverrides":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}},"templateId":{"type":"string","minLength":1,"maxLength":128},"demandOverridesBase":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}},"teamId":{"type":["string","null"],"maxLength":128}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"stationId","required":true},{"schema":{"type":"string"},"in":"path","name":"bandId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters":{"get":{"summary":"List rosters overlapping a window","tags":["roster"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"teamId","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a draft roster","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","periodStart","periodEnd"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"teamId":{"type":["string","null"],"maxLength":128},"templateIds":{"type":"array","maxItems":200,"items":{"type":"string","maxLength":128}},"notify":{"type":"boolean"},"fillToContract":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}":{"get":{"summary":"Get a roster with its grid and assignments","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a roster’s name, team, staffing strategy or time zone","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"teamId":{"type":["string","null"],"maxLength":128},"fillToContract":{"type":"boolean"},"timeZone":{"type":"string","minLength":1,"maxLength":64}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a roster","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/demand":{"put":{"summary":"Set what a draft roster needs on particular dates","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["demand"],"properties":{"demand":{"type":"array","maxItems":200,"items":{"type":"object","additionalProperties":false,"required":["templateId","demandOverrides"],"properties":{"templateId":{"type":"string","minLength":1,"maxLength":128},"demandOverrides":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}},"demandOverridesBase":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"daysOfWeek":{"type":"array","maxItems":7,"items":{"type":"integer","minimum":1,"maximum":7}},"label":{"type":"string","maxLength":128},"minEmployees":{"type":"integer","minimum":0,"maximum":1000},"maxEmployees":{"type":["integer","null"],"minimum":0,"maximum":1000},"extraEmployees":{"type":"integer","minimum":0,"maximum":1000},"tagRequirements":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"tagMaximums":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":1000}},"requiredTags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"runs":{"type":"boolean"}}}}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/versions":{"get":{"summary":"List a roster’s versions","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/assignments":{"put":{"summary":"Replace a roster’s assignments, creating a version","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["assignments"],"properties":{"assignments":{"type":"array","maxItems":50000,"items":{"type":"object","additionalProperties":false,"required":["employeeId","shiftInstanceId"],"properties":{"employeeId":{"type":"string","minLength":1,"maxLength":128},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256}}}},"baseVersion":{"type":"integer","minimum":0},"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/lint":{"post":{"summary":"Check a roster against every rule","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"assignments":{"type":"array","maxItems":50000,"items":{"type":"object","additionalProperties":false,"required":["employeeId","shiftInstanceId"],"properties":{"employeeId":{"type":"string","minLength":1,"maxLength":128},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/explain":{"post":{"summary":"Explain whether one person can take one shift","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["employeeId","shiftInstanceId"],"properties":{"employeeId":{"type":"string","minLength":1,"maxLength":128},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256},"assignments":{"type":"array","maxItems":50000,"items":{"type":"object","additionalProperties":false,"required":["employeeId","shiftInstanceId"],"properties":{"employeeId":{"type":"string","minLength":1,"maxLength":128},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/candidates":{"post":{"summary":"Rank who could take a shift, with reasons","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["shiftInstanceId"],"properties":{"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256},"assignments":{"type":"array","maxItems":50000,"items":{"type":"object","additionalProperties":false,"required":["employeeId","shiftInstanceId"],"properties":{"employeeId":{"type":"string","minLength":1,"maxLength":128},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/diagnose":{"post":{"summary":"Diagnose an unstaffable roster","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover":{"post":{"summary":"Report an absence and open the shifts it leaves short","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","minLength":1,"maxLength":128},"reason":{"type":"string","enum":["sick","no_show","other"]},"fromDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256},"note":{"type":"string","maxLength":512}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Absences on this roster that need cover","tags":["roster"],"parameters":[{"schema":{"type":"string","enum":["open","resolved","cancelled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/candidates":{"get":{"summary":"Who can cover, nearest first","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/openings/{openingId}/fill":{"post":{"summary":"Assign a replacement to one open shift","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true},{"schema":{"type":"string"},"in":"path","name":"openingId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/openings/{openingId}/drop":{"post":{"summary":"Leave one shift uncovered, on purpose","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true},{"schema":{"type":"string"},"in":"path","name":"openingId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/extend":{"post":{"summary":"Change the last day of an absence","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["toDate"],"properties":{"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/shorten":{"post":{"summary":"End an absence earlier","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["toDate"],"properties":{"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/cancel":{"post":{"summary":"Withdraw an absence report","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/cover/{coverId}/openings/{openingId}/offer":{"post":{"summary":"Offer one shift to several people; first to accept wins","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerIds"],"properties":{"workerIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":128}},"expiresInMinutes":{"type":"integer","minimum":1,"maximum":1440}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"coverId","required":true},{"schema":{"type":"string"},"in":"path","name":"openingId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/solve":{"post":{"summary":"Queue a solve for a roster","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"timeBudgetMs":{"type":"integer","minimum":0,"maximum":30000},"pinned":{"type":"array","maxItems":50000,"items":{"type":"object","additionalProperties":false,"required":["employeeId","shiftInstanceId"],"properties":{"employeeId":{"type":"string","minLength":1,"maxLength":128},"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256}}}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Read the latest solve job","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/solve/finish":{"post":{"summary":"Stop a running solve early and keep its best roster","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/solve/cancel":{"post":{"summary":"Cancel a running solve","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/publish/preflight":{"get":{"summary":"What publishing would change","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/publish":{"post":{"summary":"Publish a roster version","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"versionId":{"type":"string","maxLength":128},"note":{"type":["string","null"],"maxLength":512},"force":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/rosters/{id}/open-shifts":{"post":{"summary":"Post a shift to the team for anybody eligible to claim","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["shiftInstanceId"],"properties":{"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256},"note":{"type":["string","null"],"maxLength":500}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/open-shifts":{"get":{"summary":"Shifts posted to the team and still unclaimed","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/swaps":{"get":{"summary":"Shift swaps","tags":["roster"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","enum":["proposed","accepted","declined","withdrawn","expired"]},"in":"query","name":"status","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/swaps/{id}/apply":{"post":{"summary":"Approve and apply a proposed swap","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/swaps/{id}/decline":{"post":{"summary":"Decline a proposed swap","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/agreements":{"get":{"summary":"List working agreements","tags":["roster"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/agreements/{name}":{"put":{"summary":"Create or update a working agreement","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"source":{"type":["string","null"],"maxLength":512},"rules":{"type":"object"},"leave":{"type":"object","additionalProperties":false,"properties":{"categories":{"type":"object","maxProperties":7,"additionalProperties":{"type":"object"}},"types":{"type":"object","maxProperties":200,"additionalProperties":{"type":"object"}}}},"siteIds":{"type":"array","maxItems":200,"items":{"type":"string","maxLength":128}},"workerIds":{"type":"array","maxItems":2000,"items":{"type":"string","maxLength":128}},"effectiveFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effectiveTo":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"active":{"type":"boolean"},"priority":{"type":"integer","minimum":0,"maximum":1000}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/agreements/{id}":{"delete":{"summary":"Delete a working agreement","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/roster/rules/effective/{workerId}":{"get":{"summary":"The rules that apply to one worker","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/types":{"get":{"summary":"List leave types","tags":["roster"],"parameters":[{"schema":{"type":"boolean"},"in":"query","name":"activeOnly","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/types/{code}":{"put":{"summary":"Create or update a leave type","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"paid":{"type":"boolean"},"deductsFromBalance":{"type":"boolean"},"absenceKind":{"type":"string","maxLength":32},"category":{"type":"string","enum":["annual","sick","parental","care","unpaid","toil","other"]},"payComponentKey":{"type":["string","null"],"maxLength":64},"requiresApproval":{"type":"boolean"},"active":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":0,"maximum":999}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"code","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/types/{id}":{"delete":{"summary":"Retire a leave type","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/policies":{"get":{"summary":"List leave policies","tags":["roster"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/policies/{workerId}/{leaveTypeId}":{"put":{"summary":"Set a worker’s leave policy for one type","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entitlementMinutesPerYear"],"properties":{"entitlementMinutesPerYear":{"type":"integer","minimum":0,"maximum":1000000},"leaveYearStart":{"type":"string","pattern":"^\\d{2}-\\d{2}$"},"accrual":{"type":"string","enum":["upfront","monthly","perHourWorked"]},"proRataByFte":{"type":"boolean"},"carryOverMaxMinutes":{"type":["integer","null"],"minimum":0,"maximum":1000000},"carryOverExpiresAfterMonths":{"type":["integer","null"],"minimum":0,"maximum":60},"accrualPerWorkedMinute":{"type":["number","null"],"minimum":0,"maximum":1}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true},{"schema":{"type":"string"},"in":"path","name":"leaveTypeId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a worker’s leave policy for one type","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true},{"schema":{"type":"string"},"in":"path","name":"leaveTypeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/balances":{"get":{"summary":"Leave balances","tags":["roster"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/ledger":{"get":{"summary":"Read the leave ledger","tags":["roster"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"leaveTypeId","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/leave/adjustments":{"post":{"summary":"Adjust a leave balance","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId","leaveTypeId","minutes","note"],"properties":{"workerId":{"type":"string","minLength":1,"maxLength":128},"leaveTypeId":{"type":"string","minLength":1,"maxLength":64},"minutes":{"type":"integer","minimum":-1000000,"maximum":1000000},"pot":{"type":"string","enum":["main","statutory","extra"]},"occurredOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"note":{"type":"string","minLength":1,"maxLength":512}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff":{"get":{"summary":"List time-off requests","tags":["roster"],"parameters":[{"schema":{"type":"string","enum":["pending","approved","denied","cancelled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","pattern":"^(pending|approved|denied|cancelled)(,(pending|approved|denied|cancelled))*$"},"in":"query","name":"statuses","required":false},{"schema":{"type":"string","pattern":"^(local|pending_push|synced|push_failed|unknown|conflict)(,(local|pending_push|synced|push_failed|unknown|conflict))*$"},"in":"query","name":"syncStates","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"workerId","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string","enum":["upcoming","past"]},"in":"query","name":"direction","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Record time off — a request, or leave already agreed","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId","startDate","endDate"],"properties":{"overrideOverdraft":{"type":"boolean"},"workerId":{"type":"string","minLength":1,"maxLength":128},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string","enum":["vacation","sick","personal","other"]},"leaveTypeId":{"type":["string","null"],"maxLength":64},"dayPortion":{"type":"number","exclusiveMinimum":0,"maximum":1},"note":{"type":["string","null"],"maxLength":1000},"status":{"type":"string","enum":["pending","approved"]}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/preview":{"get":{"summary":"What recording this time off would do, before it is recorded","tags":["roster"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"query","name":"workerId","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"startDate","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"endDate","required":true},{"schema":{"type":"string","maxLength":64},"in":"query","name":"leaveTypeId","required":false},{"schema":{"type":"number","exclusiveMinimum":0,"maximum":1},"in":"query","name":"dayPortion","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"excludeId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/impact":{"get":{"summary":"What approving this request would cost","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}":{"patch":{"summary":"Change the dates, kind, type or portion of time off this workspace owns","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["revision"],"properties":{"overrideOverdraft":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string","enum":["vacation","sick","personal","other"]},"leaveTypeId":{"type":["string","null"],"maxLength":64},"dayPortion":{"type":"number","exclusiveMinimum":0,"maximum":1},"note":{"type":["string","null"],"maxLength":1000}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/resolve-conflict":{"post":{"summary":"Keep this version or the HR system’s, where the two disagree","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["revision","keep"],"properties":{"overrideOverdraft":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"keep":{"type":"string","enum":["local","incoming"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/approve":{"post":{"summary":"Approve a time-off request","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"overrideOverdraft":{"type":"boolean"},"note":{"type":["string","null"],"maxLength":512},"leaveTypeId":{"type":"string","minLength":1,"maxLength":64},"revision":{"type":"integer","minimum":0}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/cancel":{"post":{"summary":"Cancel an approved time-off request and give the entitlement back","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512},"revision":{"type":"integer","minimum":0}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/deny":{"post":{"summary":"Deny a time-off request","tags":["roster"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512},"revision":{"type":"integer","minimum":0}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/workers/{id}/absences":{"get":{"summary":"One person’s leave and sick calls, newest first","tags":["roster"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/off-today":{"get":{"summary":"Who is off today, and until when","tags":["roster"],"parameters":[{"schema":{"type":"string","maxLength":20000},"in":"query","name":"workerIds","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/decline-cancel":{"post":{"summary":"Keep approved leave a worker asked to cancel","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/timeoff/{id}/retry-push":{"post":{"summary":"Send time off the HR system refused again","tags":["roster"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/alerts":{"get":{"summary":"List capacity alerts, soonest act-by first","tags":["capacity"],"parameters":[{"schema":{"type":"string","enum":["open","resolved"]},"in":"query","name":"status","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/alerts/{id}/ack":{"post":{"summary":"Acknowledge a capacity alert","tags":["capacity"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/alerts/{id}/action":{"post":{"summary":"Record what was done about a capacity alert","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"type":"string","enum":["raise-ceiling","standby-ask","offer","agency","reduce-work","dismissed"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/alerts/{id}/standby":{"post":{"summary":"Ask people to stand by for an alert’s shift — not a shift yet","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerIds"],"properties":{"workerIds":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/radar":{"get":{"summary":"The next 72 hours of published shifts, judged","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/today":{"get":{"summary":"Where each routing lane is heading over the next 8 hours","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/precision":{"get":{"summary":"How often each alert tier was followed by a short shift, and shortages avoided","tags":["capacity"],"parameters":[{"schema":{"type":"string","maxLength":64,"pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?(Z|[+-]\\d{2}:\\d{2})?)?$"},"in":"query","name":"since","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/settings":{"get":{"summary":"Capacity radar settings","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Change capacity radar settings","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"expectedAbsencePct":{"type":"number","minimum":0,"maximum":30},"standbyLeadHours":{"type":"integer","minimum":1,"maximum":168},"offerLeadHours":{"type":"integer","minimum":1,"maximum":168},"agencyLeadHours":{"type":"integer","minimum":1,"maximum":168},"agencyContact":{"type":["string","null"],"maxLength":200},"tagConcurrency":{"type":"object","maxProperties":50,"propertyNames":{"minLength":1,"maxLength":64},"additionalProperties":{"type":"integer","minimum":1,"maximum":20}},"forecastEnabled":{"type":"boolean"},"serviceTargetPct":{"type":"number","minimum":1,"maximum":99},"serviceTargetMinutes":{"type":"integer","minimum":0,"maximum":1440},"tagServiceTargets":{"type":"object","maxProperties":60,"propertyNames":{"minLength":1,"maxLength":80},"additionalProperties":{"type":"object","additionalProperties":false,"required":["pct","minutes"],"properties":{"pct":{"type":"number","minimum":1,"maximum":99},"minutes":{"type":"integer","minimum":0,"maximum":1440}}}},"seriesConversions":{"type":"object","maxProperties":60,"propertyNames":{"minLength":1,"maxLength":80},"additionalProperties":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["simulate","headcount","none"]}}},{"type":"object","additionalProperties":false,"required":["kind","unitsPerPersonHour"],"properties":{"kind":{"enum":["rate"]},"unitsPerPersonHour":{"type":"number","exclusiveMinimum":0,"maximum":100000}}}]}},"shrinkagePct":{"type":["number","null"],"minimum":0,"maximum":90}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events":{"get":{"summary":"List capacity events","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Record a known busy or closed period","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","fromDate","toDate","effect"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","minLength":1,"maxLength":40},"label":{"type":["string","null"],"minLength":1,"maxLength":80},"fromDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"scope":{"type":"object","additionalProperties":false,"properties":{"siteIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"teamIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"shiftTemplateIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}}}},"effect":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","likely"],"properties":{"kind":{"enum":["percent"]},"likely":{"type":"number","minimum":-100,"maximum":1000},"low":{"type":"number","minimum":-100,"maximum":1000},"high":{"type":"number","minimum":-100,"maximum":1000}}},{"type":"object","additionalProperties":false,"required":["kind","likely"],"properties":{"kind":{"enum":["people"]},"likely":{"type":"integer","minimum":-1000,"maximum":1000}}},{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["closed"]}}}]},"daysOfWeek":{"type":["array","null"],"maxItems":7,"uniqueItems":true,"items":{"type":"integer","minimum":1,"maximum":7}},"timeFrom":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timeTo":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"skipDates":{"type":["array","null"],"maxItems":366,"items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"cover":{"type":"string","enum":["raise","shift"]}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}":{"patch":{"summary":"Change a capacity event (an applied one returns to draft)","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","minLength":1,"maxLength":40},"label":{"type":["string","null"],"minLength":1,"maxLength":80},"fromDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"scope":{"type":"object","additionalProperties":false,"properties":{"siteIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"teamIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"shiftTemplateIds":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}}}},"effect":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","likely"],"properties":{"kind":{"enum":["percent"]},"likely":{"type":"number","minimum":-100,"maximum":1000},"low":{"type":"number","minimum":-100,"maximum":1000},"high":{"type":"number","minimum":-100,"maximum":1000}}},{"type":"object","additionalProperties":false,"required":["kind","likely"],"properties":{"kind":{"enum":["people"]},"likely":{"type":"integer","minimum":-1000,"maximum":1000}}},{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["closed"]}}}]},"daysOfWeek":{"type":["array","null"],"maxItems":7,"uniqueItems":true,"items":{"type":"integer","minimum":1,"maximum":7}},"timeFrom":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timeTo":{"type":["string","null"],"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"skipDates":{"type":["array","null"],"maxItems":366,"items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"cover":{"type":"string","enum":["raise","shift"]}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Withdraw and archive a capacity event","tags":["capacity"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/preview":{"get":{"summary":"What accepting a capacity event would change","tags":["capacity"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/accept":{"post":{"summary":"Apply a capacity event to the shift templates it touches","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"includeReductions":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/withdraw":{"post":{"summary":"Take a capacity event off its templates","tags":["capacity"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/occurrences/{date}/skip":{"post":{"summary":"Skip one day of a busy period (an applied one stays applied)","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"includeReductions":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"path","name":"date","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/occurrences/{date}/unskip":{"post":{"summary":"Bring back a skipped day of a busy period","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"includeReductions":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"path","name":"date","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/occurrences/{date}/move":{"post":{"summary":"Move one day of a busy period to another day, as a period of its own","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["to"],"properties":{"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"includeReductions":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"path","name":"date","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/occurrences/{date}/move-back":{"post":{"summary":"Put a moved day of a busy period back on the day it came from","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":["object","null"],"additionalProperties":false,"properties":{"includeReductions":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"path","name":"date","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/{id}/series/move":{"post":{"summary":"Move every day of a busy period by a few days (every Friday to Saturday)","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["days"],"properties":{"days":{"type":"integer","minimum":-6,"maximum":6,"not":{"enum":[0]}},"includeReductions":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast":{"get":{"summary":"The workspace forecast: series, accuracy and staffing groups","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/series/{series}":{"get":{"summary":"One series, hour by hour (nowcast re-applied) and week by week","tags":["capacity"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":28},"in":"query","name":"days","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"series","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/staffing/{group}":{"get":{"summary":"People a staffing group needs each hour, against what is rostered","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"group","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/weeks":{"get":{"summary":"Week by week for six months: volume, the people-hours it takes, and what is rostered","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"query","name":"group","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/spikes":{"get":{"summary":"Days the forecast could not explain","tags":["capacity"],"parameters":[{"schema":{"enum":["open","named","dismissed"]},"in":"query","name":"status","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/spikes/{id}/name":{"post":{"summary":"Name a spike: it becomes a past event the forecast learns from","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","minLength":1,"maxLength":40},"label":{"type":"string","minLength":1,"maxLength":80}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/spikes/{id}/dismiss":{"post":{"summary":"Nothing to name: hide a spike","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/coming-up":{"get":{"summary":"Busy or quiet days the platform noticed coming","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/coming-up/accept":{"post":{"summary":"Record a suggestion as a draft event (never applied without its own accept)","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["key"],"properties":{"key":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/coming-up/dismiss":{"post":{"summary":"Stop suggesting this","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["key"],"properties":{"key":{"type":"string","minLength":1,"maxLength":200}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/events/suggest":{"post":{"summary":"Fill in an event from its name and dates: kind, size, and which work moves","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","fromDate","toDate"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"fromDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/tag-shifts":{"get":{"summary":"Which shifts work each tag, and suggestions","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/tag-shifts/{tag}":{"put":{"summary":"Confirm which shifts work a tag (an empty list unmaps it)","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["templateIds"],"properties":{"templateIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":128}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"tag","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/proposals":{"get":{"summary":"Raises the forecast proposes, or (status=accepted) the ones still to come that can be taken back","tags":["capacity"],"parameters":[{"schema":{"type":"string","enum":["open","accepted"]},"in":"query","name":"status","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/proposals/{id}/accept":{"post":{"summary":"Accept a proposal: one labelled override on its shift","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/proposals/{id}/withdraw":{"post":{"summary":"Take an accepted raise back: its override comes off the shift and the rotas","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/forecast/proposals/{id}/dismiss":{"post":{"summary":"Not this time","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/import":{"post":{"summary":"Import volumes from a CSV: date, hour?, series, value, unit","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["content"],"properties":{"content":{"type":"string","minLength":1,"maxLength":8388608}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/import/series":{"get":{"summary":"Imported series and their unit","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/import/sources":{"get":{"summary":"Files fetched on a schedule","tags":["capacity"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Fetch a file on a schedule (its link and header are stored sealed)","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","url"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","minLength":8,"maxLength":2000},"headerName":{"type":["string","null"],"minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9-]+$"},"headerValue":{"type":["string","null"],"minLength":1,"maxLength":2000},"intervalHours":{"type":"integer","minimum":1,"maximum":168},"enabled":{"type":"boolean"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/import/sources/{id}":{"patch":{"summary":"Change a scheduled file","tags":["capacity"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","minLength":8,"maxLength":2000},"headerName":{"type":["string","null"],"minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9-]+$"},"headerValue":{"type":["string","null"],"minLength":1,"maxLength":2000},"intervalHours":{"type":"integer","minimum":1,"maximum":168},"enabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Stop fetching a file","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/capacity/import/sources/{id}/run":{"post":{"summary":"Fetch a scheduled file now","tags":["capacity"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/login":{"post":{"summary":"Worker login with PIN","tags":["worker-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workspaceId","workerId","pin"],"properties":{"workspaceId":{"type":"string","maxLength":64},"workerId":{"type":"string","minLength":1,"maxLength":128},"pin":{"type":"string","minLength":1,"maxLength":256},"remember":{"type":"boolean"},"deviceId":{"type":"string","minLength":1,"maxLength":64},"deviceLabel":{"type":"string","maxLength":80}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/refresh":{"post":{"summary":"Rotate the current worker session token","tags":["worker-auth"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/invite":{"get":{"summary":"Worker invite link target (from the email): set-PIN page","tags":["worker-auth"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/accept-invite":{"post":{"summary":"Consume a worker invite token and set the PIN","tags":["worker-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token","pin"],"properties":{"token":{"type":"string","minLength":1,"maxLength":256},"pin":{"type":"string","minLength":4,"maxLength":256}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/join":{"get":{"summary":"Worker join link target (from a QR code): self-registration page","tags":["worker-auth"],"security":[],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Self-register as a worker via a QR join link","tags":["worker-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token","name","pin"],"properties":{"token":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":128},"pin":{"type":"string","minLength":4,"maxLength":256},"email":{"type":"string","format":"email","maxLength":256}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/logout":{"post":{"summary":"Revoke the current worker session and clear push registrations","tags":["worker-auth"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/devices":{"get":{"summary":"List devices holding a session for this worker","tags":["worker-auth"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/worker-auth/devices/{deviceId}":{"delete":{"summary":"Sign a device out for good","tags":["worker-auth"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"deviceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/calendar":{"get":{"summary":"My Google Calendar connection","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Choose how my busy time binds the roster","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["busyTimeMode"],"properties":{"busyTimeMode":{"type":"string","enum":["avoid","unavailable"]}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Disconnect my Google Calendar","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/calendar/start":{"post":{"summary":"Connect my Google Calendar","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["returnOrigin","returnPath"],"properties":{"returnOrigin":{"type":"string","minLength":1,"maxLength":512},"returnPath":{"type":"string","minLength":1,"maxLength":1024}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/calendar/complete":{"post":{"summary":"Finish connecting my Google Calendar","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["completionKey"],"properties":{"completionKey":{"type":"string","minLength":40,"maxLength":128}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/calendar/sync":{"post":{"summary":"Sync my Google Calendar now","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/workers/{id}/queue":{"get":{"summary":"A worker's current task queue","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/tasks":{"post":{"summary":"Create a minimal task owned by the authenticated worker; accepted at once only when it ends a running timer","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1,"maxLength":300},"description":{"type":"string","maxLength":10000},"timerEntryId":{"type":"string","maxLength":200}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}":{"get":{"summary":"Task detail, scoped to the authenticated worker","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/accept":{"post":{"summary":"Worker accepts a pending task","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/reject":{"post":{"summary":"Worker rejects a task (requeued for others); their own accepted to-do returns to their queue","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/complete":{"post":{"summary":"Worker completes a task","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"result":{"type":"object"}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/comments":{"get":{"summary":"A task's comment thread, oldest first","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Comment on a task as the authenticated worker","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["body"],"properties":{"body":{"type":"string","minLength":1}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/attachments":{"post":{"summary":"Start an attachment upload on an own task (presigned PUT)","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["filename","contentType","sizeBytes"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","minLength":3,"maxLength":128,"pattern":"^[\\w.+-]+/[\\w.+-]+$"},"sizeBytes":{"type":"number","minimum":1}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"An own task's attachments","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/attachments/{attachmentId}/confirm":{"post":{"summary":"Confirm an upload on an own task","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/attachments/{attachmentId}/download":{"get":{"summary":"Short-lived presigned download URL for an own task attachment","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/tasks/{id}/run":{"post":{"summary":"Join the run a held task belongs to, or open one named after the task","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me":{"get":{"summary":"The signed-in worker: identity, shift state, current break","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Set the signed-in worker’s language and mail preference","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"locale":{"type":["string","null"]},"emailNotices":{"type":"boolean"},"pushCategories":{"type":"object","additionalProperties":{"type":"boolean"}},"executorKind":{"type":"string","enum":["human","agent"]}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/photo":{"put":{"summary":"Set my profile photo","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contentType","data"],"additionalProperties":false,"properties":{"contentType":{"type":"string","maxLength":64},"data":{"type":"string","maxLength":6990511}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove my profile photo","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/voice/ice":{"get":{"summary":"ICE servers for a voice call","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/skills":{"get":{"summary":"The workspace skill catalog, for a worker choosing their own","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/skills":{"put":{"summary":"Set your own skills — replaces the whole set","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["skills"],"properties":{"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5}}}}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/availability":{"post":{"summary":"Go on or off shift — the worker’s own availability switch","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["available"],"properties":{"available":{"type":"boolean"},"staleAfterMs":{"type":"number","minimum":60000,"maximum":86400000},"positionId":{"type":["string","null"],"maxLength":64}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/connections":{"get":{"summary":"AI apps connected to my account (Claude, ChatGPT…)","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/connections/{id}":{"delete":{"summary":"Disconnect one of my AI apps: its access ends at once","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/assistants":{"get":{"summary":"My AI assistants and whether they are connected","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/assistant-link":{"post":{"summary":"Make a one-time link that connects my own AI assistant","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"skills":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["skill"],"properties":{"skill":{"type":"string","minLength":1,"maxLength":128},"level":{"type":"number","minimum":1,"maximum":5}}}}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/timer":{"get":{"summary":"The timer this worker has running, if any","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/timer/start":{"post":{"summary":"Start the worker’s own timer — optionally against a task they hold","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"taskId":{"type":"string","maxLength":200},"label":{"type":"string","maxLength":200}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/timer/stop":{"post":{"summary":"Stop the running timer — the entry is saved whether or not it has a name","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/timer/entries/{entryId}":{"patch":{"summary":"Name a saved entry, or attach it to a task, after the fact","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"label":{"type":["string","null"],"maxLength":200},"taskId":{"type":["string","null"],"maxLength":200}},"anyOf":[{"required":["label"]},{"required":["taskId"]}]}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"entryId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/time/log":{"get":{"summary":"What the worker spent a window on, per task and otherwise","tags":["worker-portal"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/time/day":{"get":{"summary":"Your day as a timeline: shifts, work, breaks, gaps, changes","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"date","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/breaks/coverage":{"get":{"summary":"Advisory staffing warnings for taking a break now","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/breaks/start":{"post":{"summary":"Start a break — pauses routing to this worker","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string","maxLength":100}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/breaks/end":{"post":{"summary":"End the current break — resumes routing to this worker","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/breaks/today":{"get":{"summary":"The worker's own breaks for today","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/team/presence":{"get":{"summary":"Team presence: who is working vs on break (defaults to the caller’s own crews)","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","enum":["team","workspace"]},"in":"query","name":"scope","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/metrics/today":{"get":{"summary":"The worker's own metrics for today, or since a given instant","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","format":"date-time"},"in":"query","name":"since","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/roles":{"get":{"summary":"The roles this worker can clock in as, and the one they are in now","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/role":{"post":{"summary":"Change the role you are working, without leaving your shift","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["positionId"],"properties":{"positionId":{"type":["string","null"],"maxLength":64}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/time-entries":{"get":{"summary":"The worker's own shift and break log (last 7 days)","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Record a shift the worker worked but never clocked","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt","note"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"breaks":{"type":"array","maxItems":24,"items":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"}}}},"description":{"type":["string","null"],"maxLength":1000},"taskId":{"type":["string","null"],"maxLength":200},"note":{"type":"string","minLength":3,"maxLength":500}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/time-entries/{entryId}":{"patch":{"summary":"Correct the worker's own shift, or add a description or task link to it","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","enum":["shift","break"]},"description":{"type":["string","null"],"maxLength":1000},"taskId":{"type":["string","null"],"maxLength":200},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"breaks":{"type":"array","maxItems":24,"items":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt"],"properties":{"id":{"type":"string","maxLength":64},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}}},"note":{"type":"string","minLength":3,"maxLength":500}},"anyOf":[{"required":["description"]},{"required":["taskId"]},{"required":["startedAt"]},{"required":["endedAt"]},{"required":["breaks"]}]}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"entryId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/metrics":{"get":{"summary":"The worker's own metrics over a rolling window","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","default":"7d"},"in":"query","name":"window","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/workers/me/location":{"post":{"summary":"Update this worker location for geo routing","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["latitude","longitude"],"properties":{"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/devices":{"post":{"summary":"Register an Expo push token for this worker","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token"],"properties":{"token":{"type":"string","minLength":1,"maxLength":128},"platform":{"type":"string","enum":["ios","android","unknown"]}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Unregister an Expo push token for this worker","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token"],"properties":{"token":{"type":"string","minLength":1,"maxLength":128},"platform":{"type":"string","enum":["ios","android","unknown"]}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/push/config":{"get":{"summary":"VAPID public key for subscribing the portal to Web Push","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/push/subscriptions":{"post":{"summary":"Register a Web Push subscription for this worker","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["endpoint","keys"],"properties":{"endpoint":{"type":"string","format":"uri","minLength":1,"maxLength":2048},"keys":{"type":"object","additionalProperties":false,"required":["p256dh","auth"],"properties":{"p256dh":{"type":"string","minLength":1,"maxLength":256},"auth":{"type":"string","minLength":1,"maxLength":256}}}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Unregister a Web Push subscription for this worker","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["endpoint"],"properties":{"endpoint":{"type":"string","minLength":1,"maxLength":2048}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/pin":{"post":{"summary":"Change the authenticated worker's own PIN","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["currentPin","newPin"],"properties":{"currentPin":{"type":"string","minLength":1,"maxLength":256},"newPin":{"type":"string","minLength":4,"maxLength":256}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/timeoff":{"get":{"summary":"List the authenticated worker's time-off requests","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","enum":["upcoming","past"]},"in":"query","name":"direction","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Ask for time off","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["startDate","endDate"],"properties":{"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string","enum":["vacation","sick","personal","other"]},"leaveTypeId":{"type":["string","null"],"maxLength":64},"dayPortion":{"type":"number","exclusiveMinimum":0,"maximum":1},"note":{"type":["string","null"],"maxLength":1000}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/time-entries/attest":{"post":{"summary":"Confirm or dispute your recorded hours for a period","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["fromDate","toDate","state"],"properties":{"fromDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"toDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"state":{"type":"string","enum":["confirmed","disputed"]},"note":{"type":["string","null"],"maxLength":1000},"attestedMinutes":{"type":["integer","null"],"minimum":0,"maximum":1000000}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"What you have said about a period’s hours","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"fromDate","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"toDate","required":true}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/leave":{"get":{"summary":"Leave types and this worker’s balances","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/leave/notices/{id}/opened":{"post":{"summary":"I opened my year-end leave notice","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/leave/carry-requests":{"post":{"summary":"Ask to carry leave over into next year","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["noticeId"],"properties":{"noticeId":{"type":"string","minLength":1,"maxLength":64},"minutes":{"type":"integer","minimum":1}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/leave/quote":{"get":{"summary":"What a range of leave would cost this worker","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"startDate","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"endDate","required":true},{"schema":{"type":"string","maxLength":64},"in":"query","name":"leaveTypeId","required":false},{"schema":{"type":"number","exclusiveMinimum":0,"maximum":1},"in":"query","name":"dayPortion","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/timeoff/{id}":{"delete":{"summary":"Withdraw a pending time-off request","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/timeoff/{id}/cancel-request":{"post":{"summary":"Ask for approved time off to be cancelled","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/preferences":{"get":{"summary":"My schedule wishes","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Replace my schedule wishes","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/preferences/confirm":{"post":{"summary":"Confirm my standing wishes for the periods being planned","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"runId":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/preferences/outcome":{"get":{"summary":"How my schedule wishes went","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/planning":{"get":{"summary":"Roster periods currently open for planning","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/bookings":{"get":{"summary":"The authenticated worker's booked appointments","tags":["worker-portal"],"parameters":[{"schema":{"type":"number","minimum":0},"in":"query","name":"from","required":false},{"schema":{"type":"number","minimum":0},"in":"query","name":"to","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/me/bookings/{taskId}/hand-back":{"post":{"summary":"Hand back an appointment booked onto me, with a reason","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string","maxLength":500}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"taskId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster":{"get":{"summary":"The authenticated worker's published shifts","tags":["worker-portal"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false}],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover":{"post":{"summary":"Report that you cannot work a shift you are on","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["shiftInstanceId"],"properties":{"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256},"reason":{"type":"string","enum":["sick","other"]},"throughDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover/returns":{"get":{"summary":"Your sick calls, and when you are back","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover/{id}/return":{"post":{"summary":"Say which day you are back","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["returnDate"],"properties":{"returnDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover/{id}/back":{"post":{"summary":"Say you are back early","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"backOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover/offers":{"get":{"summary":"Cover offers waiting on you","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/reserves":{"get":{"summary":"Standby asks waiting on your answer","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/reserves/{id}":{"patch":{"summary":"Answer a standby ask","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["answer"],"properties":{"answer":{"type":"string","enum":["yes","no"]}}}}}},"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover/offers/{id}/accept":{"post":{"summary":"Take a cover shift","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/cover/offers/{id}/decline":{"post":{"summary":"Turn down a cover shift","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/open-shifts":{"get":{"summary":"Shifts posted to the team that you could take","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/open-shifts/{openingId}/claim":{"post":{"summary":"Take a shift posted to the team","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"openingId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/swaps":{"get":{"summary":"Shift swaps you proposed or were asked about","tags":["worker-portal"],"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Offer one of your shifts to a colleague","tags":["worker-portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["shiftInstanceId","withWorkerId"],"properties":{"shiftInstanceId":{"type":"string","minLength":1,"maxLength":256},"withWorkerId":{"type":"string","minLength":1,"maxLength":128},"forShiftInstanceId":{"type":["string","null"],"maxLength":256},"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"workerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/swaps/{id}/accept":{"post":{"summary":"Accept a shift swap","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/swaps/{id}/decline":{"post":{"summary":"Decline a shift swap","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/swaps/{id}/withdraw":{"post":{"summary":"Take back a swap you proposed","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/portal/roster/shifts/{shiftInstanceId}/takers":{"get":{"summary":"Colleagues who could take one of your shifts","tags":["worker-portal"],"security":[{"workerToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"shiftInstanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor-auth/entry":{"get":{"summary":"Where a supervisor can sign in from","tags":["supervisor"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor-auth/accept":{"post":{"summary":"Redeem a supervisor link for a session","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token"],"properties":{"token":{"type":"string","minLength":8,"maxLength":200}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor-auth/logout":{"post":{"summary":"End this supervisor session","tags":["supervisor"],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/me":{"get":{"summary":"The signed-in supervisor and their scope","tags":["supervisor"],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/voice/ice":{"get":{"summary":"ICE servers for a voice call","tags":["supervisor"],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/overview":{"get":{"summary":"Queue, crew and parked work in this supervisor’s scope","tags":["supervisor"],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/tasks/{id}/unpark":{"post":{"summary":"Return a parked task to the queue","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"resetEscalation":{"type":"boolean"},"resetSla":{"type":"boolean"},"resetSchedule":{"type":"boolean"}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/tasks/{id}/priority":{"post":{"summary":"Bump a task’s priority","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["priority"],"properties":{"priority":{"type":"number"}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/tasks/{id}/assign":{"post":{"summary":"Hand a task to a specific worker","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerId"],"properties":{"workerId":{"type":"string","maxLength":128},"force":{"type":"boolean"}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/workers/{workerId}/availability":{"post":{"summary":"Pause or resume a worker in this supervisor’s crew","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["available"],"properties":{"available":{"type":"boolean"},"releaseBacklog":{"type":"boolean"}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/push/config":{"get":{"summary":"VAPID public key for subscribing to supervisor push","tags":["supervisor"],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/push/subscriptions":{"post":{"summary":"Register this device for supervisor push","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["endpoint","keys"],"properties":{"endpoint":{"type":"string","minLength":8,"maxLength":2048},"keys":{"type":"object","additionalProperties":false,"required":["p256dh","auth"],"properties":{"p256dh":{"type":"string","minLength":1,"maxLength":256},"auth":{"type":"string","minLength":1,"maxLength":256}}}}}}}},"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Stop supervisor push to this device","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["endpoint","keys"],"properties":{"endpoint":{"type":"string","minLength":8,"maxLength":2048},"keys":{"type":"object","additionalProperties":false,"required":["p256dh","auth"],"properties":{"p256dh":{"type":"string","minLength":1,"maxLength":256},"auth":{"type":"string","minLength":1,"maxLength":256}}}}}}}},"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/timeoff":{"get":{"summary":"List the crew’s time-off requests","tags":["supervisor"],"parameters":[{"schema":{"type":"string","enum":["pending","approved","denied","cancelled"]},"in":"query","name":"status","required":false},{"schema":{"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false}],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/timeoff/{id}/approve":{"post":{"summary":"Approve a time-off request","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/timeoff/{id}/deny":{"post":{"summary":"Deny a time-off request","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":512}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/roster":{"get":{"summary":"The crew’s published roster","tags":["supervisor"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false}],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/cover":{"get":{"summary":"Absences on the crew that need cover","tags":["supervisor"],"security":[{"supervisorToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/cover/{coverId}/openings/{openingId}/candidates":{"get":{"summary":"Who can cover, nearest first","tags":["supervisor"],"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"coverId","required":true},{"schema":{"type":"string"},"in":"path","name":"openingId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/supervisor/cover/{coverId}/openings/{openingId}/offer":{"post":{"summary":"Offer a shift to several of the crew","tags":["supervisor"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["workerIds"],"properties":{"workerIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":128}},"expiresInMinutes":{"type":"integer","minimum":1,"maximum":1440}}}}}},"security":[{"supervisorToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"coverId","required":true},{"schema":{"type":"string"},"in":"path","name":"openingId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/studio-agent/v1/chat/completions":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/studio-agent/chat/completions":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/admin/audit-events":{"get":{"summary":"Access log across workspaces","tags":["admin"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"action","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"actorId","required":false},{"schema":{"type":"string","enum":["success","failure","denied"]},"in":"query","name":"outcome","required":false},{"schema":{"type":"string","enum":["0","1"]},"in":"query","name":"contentAccess","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"from","required":false,"description":"ISO 8601 timestamp"},{"schema":{"type":"string","maxLength":64},"in":"query","name":"to","required":false,"description":"ISO 8601 timestamp"},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"workspaceId","required":false}],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/statutory-figures":{"get":{"summary":"List statutory figures, proposals and alerts","tags":["admin"],"description":"Proposals waiting for an operator, the figures in force per pack, the published history, and the alerts: a figure ending within 60 days with nothing published after it, and a source the watcher could not read. `asOf` reads the alerts as on another day.","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Propose a statutory figure by hand","tags":["admin"],"description":"For a figure the watcher cannot read. It waits for Publish like a watcher proposal. Only a pack, field and currency the packs already state are taken.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["packId","field","amount","fromDate","sourceUrl","sourceSection","actorLabel"],"properties":{"packId":{"type":"string","minLength":1,"maxLength":64},"field":{"type":"string","minLength":1,"maxLength":128},"amount":{"type":"integer","minimum":0},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"fromDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"untilDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"sourceUrl":{"type":"string","minLength":8,"maxLength":2048,"pattern":"^https://"},"sourceSection":{"type":"string","minLength":1,"maxLength":1000},"note":{"type":["string","null"],"maxLength":1000},"actorLabel":{"type":"string","minLength":1,"maxLength":254}}}}}},"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/statutory-figures/{id}/publish":{"post":{"summary":"Publish a statutory figure","tags":["admin"],"description":"Makes a proposal live for every workspace on its pack, retiring any figure published for the same day, and bumps the feed version so every replica reads it at once. Owed held sick pay is paid with it by the next close. Days already paid are never re-priced: when this figure changes any, a `paid_with_superseded_figure` alert lists them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["actorLabel"],"properties":{"actorLabel":{"type":"string","minLength":1,"maxLength":254}}}}}},"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/statutory-figures/{id}/reject":{"post":{"summary":"Reject a proposed statutory figure","tags":["admin"],"description":"The watcher never proposes that amount for that day again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["actorLabel"],"properties":{"actorLabel":{"type":"string","minLength":1,"maxLength":254},"note":{"type":["string","null"],"maxLength":1000}}}}}},"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/statutory-figures/alerts/dismiss":{"post":{"summary":"Dismiss a paid-with-superseded-figure alert","tags":["admin"],"description":"Once ops has settled by hand the days a publish changed after they were paid. Only `paid_with_superseded_figure` alerts are dismissed; every other alert clears itself.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["sourceId","actorLabel"],"properties":{"sourceId":{"type":"string","minLength":1,"maxLength":300},"actorLabel":{"type":"string","minLength":1,"maxLength":254}}}}}},"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/organizations":{"post":{"summary":"Create an organization","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","email"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"}}}}}},"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/organizations/{id}/workspaces":{"get":{"summary":"List org workspaces","tags":["admin"],"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces":{"post":{"summary":"Provision a workspace + first key","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["organizationId","name","plan"],"properties":{"organizationId":{"type":"string","maxLength":64},"name":{"type":"string","minLength":1,"maxLength":128},"plan":{"type":"string","enum":["free","payg","pro","scale","enterprise"]},"region":{"type":"string","minLength":1,"maxLength":64},"env":{"type":"string","enum":["test","live"]},"webhook":{"type":"object","additionalProperties":false,"required":["url","secret"],"properties":{"url":{"type":"string","maxLength":2048},"secret":{"type":"string","minLength":16,"maxLength":256}}},"limitOverrides":{"type":"object","additionalProperties":false,"properties":{"maxWorkers":{"type":"number","minimum":1},"includedWorkers":{"type":"number","minimum":0},"maxQueuedTasks":{"type":"number","minimum":1},"taskRatePerMin":{"type":"number","minimum":1},"includedTasksPerMonth":{"type":"number","minimum":0},"maxTaskDataBytes":{"type":"number","minimum":0},"maxTaskReferences":{"type":"number","minimum":0},"maxTaskAttachments":{"type":"number","minimum":0},"maxAttachmentBytes":{"type":"number","minimum":0},"maxTaskComments":{"type":"number","minimum":0},"maxStudioSessions":{"type":"number","minimum":1}}},"featureOverrides":{"type":"object","additionalProperties":false,"properties":{"ai":{"type":"boolean"},"traceRetentionDays":{"type":"number","minimum":1},"pauseMatchingOverQuota":{"type":"boolean"},"workerPortal":{"type":"boolean"},"aiUiBuilder":{"type":"boolean"}}}}}}}},"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List every workspace (+ optional current-month usage and sign-up activation)","tags":["admin"],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/{id}":{"get":{"summary":"Workspace + current-month usage","tags":["admin"],"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update plan/webhook/overrides/BYO data plane","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"plan":{"type":"string","enum":["free","payg","pro","scale","enterprise"]},"region":{"type":"string","minLength":1,"maxLength":64},"webhook":{"oneOf":[{"type":"object","additionalProperties":false,"required":["url","secret"],"properties":{"url":{"type":"string","maxLength":2048},"secret":{"type":"string","minLength":16,"maxLength":256}}},{"type":"null"}]},"learning":{"oneOf":[{"type":"object","additionalProperties":false,"required":["enabled","shadowMode","autoWeights"],"properties":{"enabled":{"type":"boolean"},"shadowMode":{"type":"boolean"},"autoWeights":{"type":"boolean"},"signalWeights":{"type":"object","additionalProperties":{"type":"number"}},"rewards":{"type":"object","additionalProperties":false,"properties":{"accept":{"type":"number"},"complete":{"type":"number"},"reject":{"type":"number"},"expire":{"type":"number"},"fail":{"type":"number"}}}}},{"type":"null"}]},"limitOverrides":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"maxWorkers":{"type":"number","minimum":1},"includedWorkers":{"type":"number","minimum":0},"maxQueuedTasks":{"type":"number","minimum":1},"taskRatePerMin":{"type":"number","minimum":1},"includedTasksPerMonth":{"type":"number","minimum":0},"maxTaskDataBytes":{"type":"number","minimum":0},"maxTaskReferences":{"type":"number","minimum":0},"maxTaskAttachments":{"type":"number","minimum":0},"maxAttachmentBytes":{"type":"number","minimum":0},"maxTaskComments":{"type":"number","minimum":0},"maxStudioSessions":{"type":"number","minimum":1}}},{"type":"null"}]},"featureOverrides":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"ai":{"type":"boolean"},"traceRetentionDays":{"type":"number","minimum":1},"pauseMatchingOverQuota":{"type":"boolean"},"workerPortal":{"type":"boolean"},"aiUiBuilder":{"type":"boolean"}}},{"type":"null"}]},"dataPlaneRedisUrl":{"oneOf":[{"type":"string","minLength":8,"maxLength":2048},{"type":"null"}]}}}}}},"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/{id}/suspend":{"post":{"summary":"Withdraw a workspace from the data plane","tags":["admin"],"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/{id}/resume":{"post":{"summary":"Restore a suspended workspace","tags":["admin"],"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/{id}/api-keys":{"post":{"summary":"Issue an API key (shown once)","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"env":{"type":"string","enum":["test","live"]},"name":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Key metadata (never secrets)","tags":["admin"],"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/api-keys/{id}":{"delete":{"summary":"Revoke an API key","tags":["admin"],"security":[{"adminToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/admin/usage/sync":{"post":{"summary":"Snapshot Redis meters into usage_periods (optionally for an explicit period)","tags":["admin"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]{6}$"},"in":"query","name":"period","required":false}],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/{id}/usage/reset":{"post":{"summary":"Reset the running month's usage meter for a workspace (operator goodwill)","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"reason":{"type":"string","minLength":10,"maxLength":500},"actorLabel":{"type":"string","maxLength":200},"force":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^[0-9]{6}$"},"in":"query","name":"period","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/{id}/usage":{"get":{"summary":"Monthly usage for a workspace, newest first (current month is live)","tags":["admin"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":36},"in":"query","name":"months","required":false},{"schema":{"type":"integer","minimum":1,"maximum":92},"in":"query","name":"days","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/admin/workspaces/reproject":{"post":{"summary":"Re-project every active workspace descriptor (descriptor-shape migrations)","tags":["admin"],"security":[{"adminToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/auth/google/start":{"post":{"summary":"Start Google sign-in for an existing account","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["returnOrigin"],"properties":{"returnOrigin":{"type":"string","minLength":1,"maxLength":512},"intent":{"type":"string","enum":["login","signup"]},"name":{"type":"string","minLength":1,"maxLength":128},"path":{"type":"string","enum":["routing","roster","everything"]},"source":{"type":"object","additionalProperties":false,"properties":{"from":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"gclid":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"fbclid":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmSource":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmMedium":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmCampaign":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmTerm":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmContent":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"}}}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/google/complete":{"post":{"summary":"Exchange a completed Google sign-in for a Fivexer session","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["completionKey"],"properties":{"completionKey":{"type":"string","minLength":40,"maxLength":128}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/signup":{"post":{"summary":"Sign up: org + sandbox + test key, immediately","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","password"],"properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"},"password":{"type":"string","minLength":10,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":128},"path":{"type":"string","enum":["routing","roster","everything"]},"source":{"type":"object","additionalProperties":false,"properties":{"from":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"gclid":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"fbclid":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmSource":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmMedium":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmCampaign":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmTerm":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmContent":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"}}}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/login":{"post":{"summary":"Log in for a session token","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","password"],"properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"},"password":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/code":{"post":{"summary":"Email a one-time code to sign in or sign up","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/code/verify":{"post":{"summary":"Exchange a code for a session, creating the account if new","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","code"],"properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"},"code":{"type":"string","pattern":"^[0-9]{4,10}$"},"name":{"type":"string","minLength":1,"maxLength":128},"path":{"type":"string","enum":["routing","roster","everything"]},"source":{"type":"object","additionalProperties":false,"properties":{"from":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"gclid":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"fbclid":{"type":"string","maxLength":400,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmSource":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmMedium":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmCampaign":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmTerm":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"},"utmContent":{"type":"string","maxLength":160,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"}}}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/password/forgot":{"post":{"summary":"Email a one-time password-reset code","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/password/reset":{"post":{"summary":"Set a new password with an emailed code","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","code","password"],"properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^\\S+@\\S+\\.\\S+$"},"code":{"type":"string","pattern":"^[0-9]{4,10}$"},"password":{"type":"string","minLength":10,"maxLength":128}}}}}},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/verify-email":{"post":{"summary":"Consume a verification token","tags":["auth"],"security":[],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Verification link target (from the email)","tags":["auth"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/auth/logout":{"post":{"summary":"Revoke the current session","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/auth/google/link":{"get":{"summary":"Whether Google is linked to the signed-in account","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Start linking Google to the signed-in account","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["returnOrigin"],"properties":{"returnOrigin":{"type":"string","minLength":1,"maxLength":512}}}}}},"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Unlink Google from the signed-in account (requires a recent session)","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/auth/google/link/complete":{"post":{"summary":"Finish linking Google to the signed-in account","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["completionKey"],"properties":{"completionKey":{"type":"string","minLength":40,"maxLength":128}}}}}},"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/audit-events":{"get":{"summary":"Access log for this workspace","tags":["console"],"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"action","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"actorId","required":false},{"schema":{"type":"string","enum":["success","failure","denied"]},"in":"query","name":"outcome","required":false},{"schema":{"type":"string","enum":["0","1"]},"in":"query","name":"contentAccess","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"from","required":false,"description":"ISO 8601 timestamp"},{"schema":{"type":"string","maxLength":64},"in":"query","name":"to","required":false,"description":"ISO 8601 timestamp"},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":256},"in":"query","name":"cursor","required":false},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/console/me":{"get":{"summary":"Current user + memberships","tags":["console"],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update the signed-in user’s preferences","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"locale":{"type":["string","null"]}}}}}},"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/console/verification/resend":{"post":{"summary":"Re-send the verification email","tags":["console"],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces":{"get":{"summary":"Workspaces across all memberships","tags":["console"],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a production workspace (verified email required)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"organizationId":{"type":"string","maxLength":64},"path":{"type":"string","enum":["routing","roster","everything"]}}}}}},"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/sandbox/reset":{"post":{"summary":"Load, reload or wipe the sandbox demo data","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"routing":{"type":"string","enum":["support","engineering","field-jobs","leads","other"]},"mode":{"type":"string","enum":["reseed","empty"]}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/sandbox/synthetic":{"get":{"summary":"Read the sandbox synthetic-data settings","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Configure sandbox synthetic-data generation","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"scenario":{"type":["string","null"],"enum":["support","engineering","field-jobs","leads","other",null]},"workers":{"type":"integer","minimum":1,"maximum":50},"openTasks":{"type":"integer","minimum":0,"maximum":200},"tasksPerHour":{"type":"integer","minimum":0,"maximum":240},"maxOpenTasks":{"type":"integer","minimum":1,"maximum":500},"seed":{"type":"integer","minimum":0,"maximum":2147483647}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/onboarding":{"get":{"summary":"Console first-run state + activation stamp","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Resolve console first-run state","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["state"],"properties":{"state":{"type":"string","enum":["done","skipped"]}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/onboarding/steps":{"post":{"summary":"Record a first-run screen as reached","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["path","step"],"properties":{"path":{"type":"string","enum":["welcome","route","rota","demo"]},"step":{"type":"string","minLength":1,"maxLength":32}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/migration-preview":{"get":{"summary":"Preview what would be copied to a new production workspace","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/migrate":{"post":{"summary":"Migrate a sandbox to a new production workspace","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/api-keys":{"post":{"summary":"Issue an API key (live env requires verified email)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"env":{"type":"string","enum":["test","live"]},"name":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Key metadata (never secrets)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/usage":{"get":{"summary":"Monthly matched-task usage, newest first (current month is live)","tags":["console"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":36},"in":"query","name":"months","required":false},{"schema":{"type":"integer","minimum":1,"maximum":92},"in":"query","name":"days","required":false},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"security":[{"session":[]}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/connections":{"get":{"summary":"MCP apps connected to this workspace over OAuth","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/connections/{grantId}":{"delete":{"summary":"Disconnect an MCP app — every token it holds stops working","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"grantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}":{"delete":{"summary":"Delete a workspace and all its data (owner role) — irreversible","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Rename a workspace (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/api-keys/{id}":{"delete":{"summary":"Revoke an API key (owner role)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/webhook":{"put":{"summary":"Set (or replace) the workspace webhook endpoint","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"secret":{"type":"string","minLength":16,"maxLength":256}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove the workspace webhook endpoint","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/navigation":{"get":{"summary":"Which sidebar rows this workspace shows","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set the sidebar preset and per-item overrides","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["preset"],"properties":{"preset":{"type":"string","enum":["routing","roster","everything"]},"overrides":{"type":"object","additionalProperties":false,"properties":{"overview":{"type":"boolean"},"my-day":{"type":"boolean"},"live":{"type":"boolean"},"tasks":{"type":"boolean"},"agent-runs":{"type":"boolean"},"agents":{"type":"boolean"},"knowledge":{"type":"boolean"},"workers":{"type":"boolean"},"roster":{"type":"boolean"},"capacity":{"type":"boolean"},"time":{"type":"boolean"},"decisions":{"type":"boolean"},"performance":{"type":"boolean"},"setup":{"type":"boolean"},"skills":{"type":"boolean"},"teams":{"type":"boolean"},"workflows":{"type":"boolean"},"learning":{"type":"boolean"},"portal":{"type":"boolean"},"keys":{"type":"boolean"},"audit":{"type":"boolean"},"settings":{"type":"boolean"}}}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/matching":{"get":{"summary":"Current balancer policy (fairness mode + optional window cap)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set the balancer policy — takes effect on the next match pass","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["fairness"],"properties":{"fairness":{"type":"string","enum":["first-come","best-match","balanced","spread-work"]},"maxTasksPerWindow":{"type":"number","minimum":1,"maximum":1000000},"windowMs":{"type":"number","minimum":60000,"maximum":86400000}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/decisions-config":{"get":{"summary":"Confidence thresholds for machine suggestions","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set the confidence thresholds","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["applyAt","reviewAt"],"properties":{"applyAt":{"type":"number","exclusiveMinimum":0,"maximum":1},"reviewAt":{"type":"number","exclusiveMinimum":0,"maximum":1}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/learning":{"get":{"summary":"Current learning configuration","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set the reinforcement-learning configuration","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled","shadowMode","autoWeights"],"properties":{"enabled":{"type":"boolean"},"shadowMode":{"type":"boolean"},"autoWeights":{"type":"boolean"},"signalWeights":{"type":"object","additionalProperties":{"type":"number"}},"rewards":{"type":"object","additionalProperties":false,"properties":{"accept":{"type":"number"},"complete":{"type":"number"},"reject":{"type":"number"},"expire":{"type":"number"},"fail":{"type":"number"}}},"autoWeightsOptions":{"type":"object","additionalProperties":false,"properties":{"policy":{"type":"string","enum":["ucb1","confidence","thompson"]},"confidenceZ":{"type":"number","minimum":0,"maximum":5},"minSamples":{"type":"number","minimum":1,"maximum":10000},"minTotalSamples":{"type":"number","minimum":0,"maximum":100000},"minSamplesForVeto":{"type":"number","minimum":1,"maximum":10000},"maxDeltaPerSync":{"type":"number","minimum":1,"maximum":100},"decayHalfLifeMs":{"type":"number","minimum":60000,"maximum":31536000000},"vetoThreshold":{"type":"number","minimum":-1,"maximum":1},"maxWeight":{"type":"number","minimum":1,"maximum":100},"explorationBonus":{"type":"number","minimum":0,"maximum":10},"priorWeight":{"type":"number","minimum":0,"maximum":100},"terminalOnlyTagStats":{"type":"boolean"}}},"syncIntervalMs":{"type":"number","minimum":60000,"maximum":86400000}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/voice":{"get":{"summary":"Voice calling configuration (TURN credentials redacted)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Enable or disable supervisor↔worker voice calls","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean"},"iceServers":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["urls"],"properties":{"urls":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":512}}]},"username":{"type":"string","maxLength":512},"credential":{"type":"string","maxLength":512}}}}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/policy-defaults":{"get":{"summary":"Workspace-level escalation and SLA defaults","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set default escalation/SLA policies for tasks that declare none","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"escalation":{"type":["object","null"],"additionalProperties":false,"required":["respondWithinMs"],"properties":{"respondWithinMs":{"type":"number","minimum":1000,"maximum":86400000},"onNoResponse":{"type":"string","enum":["block","allow"]},"offerCooldownMs":{"type":"number","minimum":1000,"maximum":86400000},"priorityBoost":{"type":"number"},"tiers":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":32}},"maxEscalations":{"type":"number","minimum":0,"maximum":8},"onExhausted":{"type":"string","enum":["queue","park"]}}},"sla":{"type":["object","null"],"additionalProperties":false,"properties":{"completeWithinMs":{"type":"number","minimum":1000,"maximum":7776000000},"expireAfterMs":{"type":"number","minimum":1000,"maximum":7776000000},"maxRejections":{"type":"number","minimum":1,"maximum":100},"onCompletionBreach":{"type":"string","enum":["notify","requeue","fail","park"]},"onMaxRejections":{"type":"string","enum":["park","fail","keep"]},"onExpire":{"type":"string","enum":["drop","park"]}}},"tags":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":64},"maxItems":32},"priority":{"type":["integer","null"],"minimum":0,"maximum":1000000}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/data-plane/test":{"post":{"summary":"Test a BYO Redis connection without saving (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":8,"maxLength":2048}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/data-plane":{"put":{"summary":"Point the workspace at a BYO Redis (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","minLength":8,"maxLength":2048}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Return the workspace to the managed cell (owner role)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/agent-results":{"get":{"summary":"Whether AI agents’ results are kept: the workspace default and each agent that differs","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set whether AI agents’ results are kept, unless an agent says otherwise (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["default"],"properties":{"default":{"type":"string","enum":["off","short","kept"]},"shortLivedHours":{"type":"integer","minimum":1,"maximum":720}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/agent-results/{workerId}":{"put":{"summary":"Set one agent’s result write-back; null follows the workspace default (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"anyOf":[{"type":"string","enum":["off","short","kept"]},{"type":"null"}]}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/workers/{workerId}/identity":{"post":{"summary":"Create a worker identity and PIN for the portal","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["label","pin"],"properties":{"label":{"type":"string","minLength":1,"maxLength":128},"pin":{"type":"string","minLength":4,"maxLength":256},"email":{"type":"string","format":"email","maxLength":256}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a worker identity (PIN, label, status)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":128},"pin":{"type":"string","minLength":4,"maxLength":256},"email":{"type":["string","null"],"format":"email","maxLength":256},"status":{"type":"string","enum":["active","revoked"]},"executorKind":{"type":"string","enum":["human","agent"]}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a worker identity and all its sessions","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/worker-identities":{"get":{"summary":"List worker identities for the portal","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/roster/site-owner-candidates":{"get":{"summary":"List the workspace members who can own a site","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/supervisors":{"get":{"summary":"List supervisors and crew leads","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Grant supervisor access, optionally scoped to one crew","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","label"],"properties":{"email":{"type":"string","minLength":3,"maxLength":320},"label":{"type":"string","minLength":1,"maxLength":200},"teamId":{"type":"string","maxLength":64}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/supervisors/self-link":{"post":{"summary":"Mint a supervisor sign-in link for the signed-in console user","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/supervisors/{supervisorId}/link":{"post":{"summary":"Mint a single-use sign-in link (invalidates any previous one)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"supervisorId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/supervisors/{supervisorId}":{"delete":{"summary":"Revoke supervisor access (kills live sessions and push)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"supervisorId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/worker-identities/invite":{"post":{"summary":"Invite a worker by email with a set-your-own-PIN magic link","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","format":"email","maxLength":256},"workerId":{"type":"string","minLength":1,"maxLength":128},"label":{"type":"string","minLength":1,"maxLength":128},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5},"weightOverride":{"type":"number","minimum":0,"maximum":100},"validFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}},"teamIds":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/worker-identities/{workerId}/invite/resend":{"post":{"summary":"Mint a fresh invite link for a pending identity (invalidates old links)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"workerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/join-links":{"post":{"summary":"Create a QR join link for worker self-registration","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1,"maxLength":128},"teamId":{"type":"string","maxLength":64},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64},"skills":{"type":"array","maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["skillId","level"],"properties":{"skillId":{"type":"string","maxLength":64},"level":{"type":"number","minimum":1,"maximum":5},"weightOverride":{"type":"number","minimum":0,"maximum":100},"validFrom":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}},"requiresApproval":{"type":"boolean"},"maxUses":{"type":"number","minimum":1,"maximum":10000},"expiresInMs":{"type":"number","minimum":60000,"maximum":7776000000}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List QR join links (tokens are never returned after creation)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/join-links/{id}":{"delete":{"summary":"Revoke a QR join link immediately","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/publish":{"post":{"summary":"Publish a new immutable portal version (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["template"],"properties":{"template":{"type":"string","minLength":1,"maxLength":64},"apiBaseUrl":{"type":"string","minLength":1,"maxLength":512},"brandName":{"type":"string","maxLength":128},"logoUrl":{"type":"string","maxLength":2048},"primaryColor":{"type":"string","maxLength":9},"trackerBaseUrl":{"type":"string","maxLength":2048},"iconAssetId":{"type":"string","maxLength":128},"iconBackground":{"type":"string","maxLength":9},"appShortName":{"type":"string","maxLength":32},"defaultLocale":{"type":"string","maxLength":32}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/versions/{version}/publish":{"post":{"summary":"Roll back: make a retained portal version current (owner role)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"version","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal":{"get":{"summary":"Current portal status: URL, version, config","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove the worker portal bundle and all versions (owner role)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/enabled":{"put":{"summary":"Enable or disable the worker portal (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/versions":{"get":{"summary":"Portal version history (newest first)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/brand-assets":{"post":{"summary":"Upload the portal app icon source (owner role)","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["contentType","data"],"properties":{"contentType":{"type":"string","minLength":1,"maxLength":64},"data":{"type":"string","minLength":1}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/brand-assets/{assetId}":{"get":{"summary":"Preview URL for an uploaded portal app icon","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"assetId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete an uploaded portal app icon source (owner role)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"assetId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions":{"post":{"summary":"Start an AI portal studio session","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["template"],"properties":{"template":{"type":"string","minLength":1,"maxLength":64},"apiBaseUrl":{"type":"string","minLength":1,"maxLength":512}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List live AI portal studio sessions","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/usage":{"get":{"summary":"Metered AI studio agent usage (tokens, turns, durations)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}":{"get":{"summary":"AI portal studio session status","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"End an AI portal studio session and tear down its sandbox","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}/messages":{"post":{"summary":"Send a chat instruction to the studio agent","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["message"],"properties":{"message":{"type":"string","minLength":1,"maxLength":4000}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}/turn-progress":{"get":{"summary":"Live progress of the in-flight studio agent turn","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}/cancel":{"post":{"summary":"Stop a specific studio agent turn","tags":["console"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["turnId"],"properties":{"turnId":{"type":"string","pattern":"^[a-f0-9-]{16,64}$"}}}}}},"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}/preview-status":{"get":{"summary":"Whether the session's live preview is serving yet","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}/restart":{"post":{"summary":"Rebuild a studio session's sandbox (transcript kept, unpublished edits lost)","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/console/workspaces/{workspaceId}/portal/studio/sessions/{sessionId}/publish":{"post":{"summary":"Publish the studio session through the versioned portal pipeline","tags":["console"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/integrations/google-calendar/callback":{"get":{"summary":"Google Calendar OAuth callback","tags":["calendar"],"security":[],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://5xer.com","description":"This deployment"}]}