Skip to main content

Departments

Departments are an organizational grouping on the agent record and the work-item API. They are managed through the REST API — there is no department management screen in the dashboard.

Important
This article previously described a department grid, a Create Department modal, and a department detail view with Members, Agents and Budget tabs. That UI is not part of the current dashboard. Departments still exist as data — on the agent record, in the work-item API and in cost roll-ups — and this page now describes only that.
Key Concepts

What is a department?

A department is a grouping of agents within your organization — for example "Customer Support," "Engineering," or "Finance." Each agent carries an optional department_id, every work item is created against a department, and department-level cost roll-ups are available through the API.

Where departments appear

  • Agent record — an agent's department is the one its work items are filed under when you use Dispatch Work on the agent detail page.
  • Work itemsdepartment_id is required when creating a work item through the REST API or the company__create_work_item gateway tool.
  • CostsGET /hub/ai-company/departments/{dept_id}/costs returns spend for the department's agents.
  • Agent gateway — agents can read their department's goals with company__read_department_goals.

REST API

All endpoints are under the hub API and require your Supabase session JWT plus an org_id query parameter.

EndpointWhat it does
GET /hub/ai-company/departmentsList departments in the org.
POST /hub/ai-company/departmentsCreate a department (name required; optional description, mission and autonomy_level).
GET /hub/ai-company/departments/{dept_id}Read one department.
PATCH /hub/ai-company/departments/{dept_id}Update a department.
GET /hub/ai-company/departments/membershipsList which members belong to which department.
GET /hub/ai-company/departments/{dept_id}/costsCost roll-up for the department's agents.

Budget and risk threshold

The department record carries a budget (budget_credits against budget_spent) and a risk_threshold (0–100). Both are checked when a work item is created: a department whose budget is exhausted refuses new work items (HTTP 402), and a work item whose risk_score exceeds the department's threshold is created in pending_approval instead of the backlog. Per-agent spend caps are separate — see Monitoring & Costs.