Skip to main content

Request headers

string
required
The service user’s API token in the Bearer YOUR_TOKEN format. The school owner issues the token in the admin panel: Manage → School → For developers → API keys — see the “Authentication” section for details.
integer
required
The numeric ID of the seller — the account the school belongs to. Copy it on the API keys page, in the Integration data → Identifiers card. The token’s permissions are checked against this ID.
integer
required
The numeric ID of the school, found in the same place as Seller-Id. The value must match the seller’s school — otherwise a 400 error with cause: "ForbiddenSchoolMismatch" is returned.
Departments are the hierarchical organizational units of a school. Each department can have a parent department (parentId), which is how the organizational structure tree is built. The staff module uses departments to assign employees to organizational units and to appoint managers.
The extId field is the department’s external identifier from the client’s system (CRM, 1C, etc.). It is unique within the school among non-deleted records, is 1 to 50 characters long, and cannot contain / or whitespace (the value must be URL-safe because it is used in ext/{extId} paths). Separate update and delete endpoints are available by extId.
All staff module endpoints are available only to corporate-segment schools (Corporate). Requests from a school in any other segment are rejected.

Permission requirements

Reading (tree, list) requires the “Staff browsing” permission (StaffView). Creating, updating and deleting require the “Staff Management” permission (StaffManage). In all cases, token authentication is required and the school must belong to the Corporate segment.
The service user must be authenticated by token and have the appropriate access permissions for the specified school.

Department tree

Requires authentication and the “Staff browsing” permission (StaffView).
The endpoint returns a flat array of all departments of the school. The hierarchy is defined by each department’s parentId field (null means a root department). You build the tree itself on the client side by grouping items by parentId.

Response

array
required
Array of the school’s departments. The parentId field points to the parent department (null means root).

Department list

Requires authentication and the “Staff browsing” permission (StaffView).
Unlike tree, this endpoint returns a paginated list of departments. Pagination and filter parameters are passed as query parameters.

Parameters

integer
Number of records to skip (offset pagination). Minimum 0.
integer
Number of records to return per page. From 1 to 1000.
integer
Page number (an alternative to skip). Minimum 1.
array
Array of department IDs to filter by (up to 250 values).
array
Array of parent department IDs to filter by (up to 250 values). Returns only the child departments of the specified parents.
array
Array of external identifiers (extId) to filter by (up to 250 values, each up to 50 characters).
Search by department name. Maximum 50 characters.
enum
Sort direction by creation date. Possible values: ASC, DESC. The id and updatedAt parameters work the same way.

Response

object
required
Paginated object: items (array of departments), page, count, pages, isFirst, isLast, next, prev.

Create a department

Requires authentication and the “Staff Management” permission (StaffManage).

Request parameters

string
required
Department name. From 1 to 100 characters. Leading and trailing whitespace is trimmed automatically.
string
External identifier of the department from the client’s system (CRM/1C). From 1 to 50 characters; cannot contain / or whitespace (URL-safe, because it is used in ext/{extId} paths). Must be unique within the school among non-deleted departments; otherwise the StaffDepartmentExtIdIsNotUniq error is returned.
integer
ID of the parent department. Specify the parent with parentId or parentExtId — pass at most one field of the pair. If specified, the parent must belong to the same school; otherwise the StaffDepartmentNotFound error is returned. If neither field specifies a parent, the department is created as a root department.
string
External identifier (extId) of the parent department — an alternative to parentId (pass at most one field of the pair). From 1 to 50 characters. The parent must be created before the child department and belong to the same school; otherwise the StaffDepartmentNotFound error is returned.
integer
Employment to assign as the primary manager of the department being created. Optional. Specify it with primaryManagerEmploymentId or primaryManagerEmploymentExtId. The employment must be active and already started (startAt is not in the future); otherwise StaffEmploymentNotFound is returned. The employment’s department can be any department. The result is the same as calling department-manager/set with isPrimary: true.
string
External identifier (extId) of the manager’s employment — an alternative to primaryManagerEmploymentId (pass at most one field of the pair). From 1 to 50 characters.

Update a department

Requires authentication and the “Staff Management” permission (StaffManage).
The request body is the same as for creation (all fields are optional): name, extId, the parent (parentId/parentExtId) and the primary manager (primaryManagerEmploymentId/primaryManagerEmploymentExtId). Pass only the fields you want to change.

Parameters

integer
required
ID of the department to update within the school.
string
New department name. From 1 to 100 characters. Leading and trailing whitespace is trimmed automatically.
string
New external identifier of the department (it can be reassigned). From 1 to 50 characters; cannot contain / or whitespace (URL-safe). Must be unique within the school among non-deleted departments; otherwise the StaffDepartmentExtIdIsNotUniq error is returned.
integer
New parent department (re-parenting). Specify it with parentId or parentExtId. Pass null to make the department a root department. The new parent must belong to the same school (StaffDepartmentNotFound) and cannot be the department itself or one of its descendants; otherwise the StaffDepartmentParentCreatesCycle error is returned.
string
External identifier (extId) of the new parent — an alternative to parentId (pass at most one field of the pair). From 1 to 50 characters. null makes the department a root department. If the field is omitted, the parent does not change — so always pass it when syncing, so that re-parenting in your HR system is reflected in Exode.
integer
Employment to assign as the primary manager of the department. Specify it with primaryManagerEmploymentId or primaryManagerEmploymentExtId. Pass null so that the department has no primary manager: the current primary manager becomes a regular manager (the manager record is kept; you can remove it completely with department-manager/remove).
string
External identifier (extId) of the manager’s employment — an alternative to primaryManagerEmploymentId (pass at most one field of the pair). From 1 to 50 characters.

Update a department by extId

Requires authentication and the “Staff Management” permission (StaffManage).
Works like the regular update, but the department is looked up by its external identifier (extId) within the school. The request body is the same as for PUT /saas/v2/staff/department/{departmentId}/update. The extId value in the path must be URL-encoded. If no department with this extId is found within the school, the StaffDepartmentNotFound error is returned.

Parameters

string
required
External identifier of the department within the school. Must be URL-encoded.

Delete a department

Requires authentication and the “Staff Management” permission (StaffManage).
You can delete only a “leaf” department with no active employees:
  • if the department has child units, the StaffDepartmentHasChildren error is returned (deleting a node in the middle of the tree would orphan its descendants). Delete or move the child departments first;
  • if the department has active employees (including a scheduled hire with a future date), the StaffDepartmentHasActiveEmployments error is returned. Transfer or terminate the employees first. Closed (terminated) employments do not block deletion.

Parameters

integer
required
ID of the department to delete within the school.

Response

integer
required
Number of affected (deleted) records. On successful deletion, 1.

Delete a department by extId

Requires authentication and the “Staff Management” permission (StaffManage).
Works like the regular deletion, but the department is looked up by its external identifier (extId) within the school. The same rules apply: you can delete only a “leaf” department with no child units and no active employees (otherwise StaffDepartmentHasChildren / StaffDepartmentHasActiveEmployments is returned). The extId value in the path must be URL-encoded. If no department with this extId is found within the school, the StaffDepartmentNotFound error is returned.

Parameters

string
required
External identifier of the department within the school. Must be URL-encoded.

Response

integer
required
Number of affected (deleted) records. On successful deletion, 1.

Updated: 2026-09-25 14:33 UTC