Add a department
POST
monthlyHours null means no limit. A name is unique in the workspace; a parent can't be the department itself or inside it.
sessioncookie
better-auth.session_token<token>Set by POST /api/auth/sign-in/email.
ws*stringThe workspace id (from GET /api/me).
application/json- body
name*stringLength
1 <= length <= 80mission?stringLength
length <= 2000Default
""parentId?|Default
nullchannel?|Default
nullmonthlyHours?|Default
nullmaxAgentTurns?|Default
nullThe department.
curl -X POST 'https://app.useroster.work/api/workspaces/string/departments' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'Example Response
Empty
The org chart GET
Every department and position, each with `hoursUsed`: hours on shift this calendar month (UTC), as timecards measure them. A position's `holder` is `{ kind: "hire", hireId, displayName, role }`, `{ kind: "person", userId, name, chat }` or `{ kind: "open" }`.
Change a department PATCH
Only the fields given change; `null` clears `parentId`, `channel`, `monthlyHours` or `maxAgentTurns`.