Users & structure
Departments
Departments are the original name of Teams: the same named groups of users, with the same ids. This group holds the four v2 endpoints: one flat list that embeds the members of every department, and three admin-only writes that answer a boolean. Prefer the v3 Teams endpoints for new work; use this list when you want every department with its members in one request.
Workflow (what the portal does)
- List:
GET /v2/departmentstakes no parameters and answers a plain array, not a page, with every department of the account:id,nameandusers, the members asuser_id,user_nameanduser_email. - Create (account admin):
POST /v2/departments/storewithname(required, at most 20 characters) answers201withid,nameand an emptyusers. Members are added afterwards through Teams, or withuser.departmentsonPUT /v3/users/{user}(see Users). - Rename (account admin):
PUT /v2/departments/{department}/updatewithnameanswers the JSON booleantrue. The name is the only thing this endpoint changes. - Delete (account admin):
DELETE /v2/departments/{department}/deleteanswerstrue.
An unknown {department}, or one of another account, answers 404 from rename and delete. Each create, rename and delete is recorded in the account's change log as User group <name> has been added, renamed to <new name> or deleted.
Departments, users and extensions
- A department is a set of users: a user may belong to several departments, and a department may be empty. Membership is the only relation a department has.
- Extensions follow their users. A user has at most one extension per account (see Extensions), so "the extensions of a department" means the extensions of its members. That is how the availability report
GET /v2/extension-activityapplies itsdepartmentIdfilter, and how an AI call recap addressed to a department reaches the members whose extension was on the call. - Departments carry no numbers, queues or permissions. What they gate — call tag visibility, conversation assignment, report filters and recap recipients — is listed under What a team does in Teams.
Roles and access
- The list is open to any authenticated user. Create, rename and delete require an account admin; anyone else gets
403"Forbidden".
Pitfalls
- The paths carry the verb:
POST …/store,PUT …/{department}/update,DELETE …/{department}/delete. There is noGET /v2/departments/{department}; read one department from the list, or fromGET /v3/teams/{teamId}. - Create answers
201with the department; rename and delete answer a baretrue, not the department. - The list is unpaginated and always embeds the members.
userscarries no status, so a suspended member looks like an active one; checkuser_activein Users. nameis limited to 20 characters and is not unique: two departments can share a name.nameis the only field the writes accept; anything else in the body is ignored, so members cannot be set here.- Validation errors answer
422as{"errors": {...}}; a missing department answers404with{"message": "Resource not found!"}.