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.
A department manager is linked to an employee’s active employment, not to the user. The manager’s employment can belong to any department of the school: for example, the head of a unit can be listed in a higher-level department. A department can have several managers, but only one of them is the primary manager (isPrimary).
The assignment follows the employee: on a transfer or position change it automatically moves to the new employment record, and on termination of that employment it is removed. You do not need to call remove on termination.
The REST API has no list of managers, and managerId is returned only in the set response. So when assigning, pass your own extId: you can use it to remove the manager via ext/{extId}/remove without storing internal IDs. You can also set a department’s primary manager with the primaryManagerEmploymentExtId field when creating or updating a department.
All staff module endpoints are available only to schools in the Corporate segment. For other segments, the request returns 401 with cause: "Forbidden" and the message Allowed only for Corporate school.

Assign a manager

Requires authentication and the “Staff Management” permission (StaffManage). The endpoint works as an upsert: if a manager is already assigned for the department + employment pair, the isPrimary flag and extId are updated; otherwise a new record is created. A department can have only one primary manager: with isPrimary=true, the department’s previous primary manager is automatically demoted (their isPrimary flag is reset to false). The department and the employment must belong to the school, and the employment must be active and already started (a hire with a future startAt cannot be assigned as manager before that date); otherwise the StaffDepartmentNotFound / StaffEmploymentNotFound errors are returned. You can specify the department and the employment either by numeric ID or by external ID: in each of the pairs departmentId/departmentExtId and employmentId/employmentExtId, pass exactly one field.

Request parameters

integer
Department ID. The department must belong to the school. Required if departmentExtId is not passed.
string
External department ID (extId). An alternative to departmentId: pass exactly one field of the pair.
integer
ID of the active employment of the employee being assigned as manager. Required if employmentExtId is not passed.
string
External employment ID (extId). An alternative to employmentId: pass exactly one field of the pair.
string
External ID of the manager record from the client’s system (CRM/1C). 1 to 50 characters; cannot contain / or whitespace, since the value is used in ext/{extId} paths. Must be unique within the school among non-deleted records; otherwise the StaffDepartmentManagerExtIdIsNotUniq error is returned.
boolean
Make the employee the department’s primary manager. Defaults to false. With true, the previous primary manager automatically stops being primary. The default also applies to an existing record: a repeated set without isPrimary turns the primary manager into a regular one. For regular synchronization, pass isPrimary explicitly.

Remove a manager

Requires authentication and the “Staff Management” permission (StaffManage). Deletes the department manager record (soft delete). After the primary manager is removed, the department has no primary manager until a new one is assigned.

Request parameters

integer
required
ID of the department manager record (the id field from the assignment response).

Response

integer
required
Number of deleted records (1 if the manager was removed successfully).

Remove a manager by extId

Requires authentication and the “Staff Management” permission (StaffManage). Same as removal by managerId, but the manager record is looked up by external ID (extId) within the school. Deletes the department manager record (soft delete). If no record with the given extId is found among the school’s non-deleted records, the StaffDepartmentManagerNotFound error is returned.

Request parameters

string
required
External ID of the department manager record (extId). The path value must be URL-encoded.

Response

integer
required
Number of deleted records (1 if the manager was removed successfully).

Permission requirements

The staff module is available only to schools in the Corporate segment. Assigning and removing department managers requires the “Staff Management” permission (StaffManage).
The service user must be authenticated with a token and have the appropriate access rights to the specified school.

Updated: 2026-09-25 14:33 UTC