Accepts multipart/form-data with a file field named 'file', an Excel workbook (.xlsx) or a CSV in UTF-8, read the same way as the department import. Header: code,name[,parent_code]. Each row is one department: code is the department's code in your own system, name its name, and parent_code the code of its parent, empty for a top-level department. Each row finds the department that has its code (its externalRef) and renames it or moves it under parent_code when they differ; the department keeps its id, admins and people, and its past spend moves with it to the new parent. When no department has the code, the row adopts a department without a code: the one with the row's name under the row's parent, else the only one with that name anywhere, and gives it the code. When none matches, the department is created with the code. parent_code may name another row or a department that already has that code. A file with any row error is rejected whole and nothing is saved: an empty code or name, a code listed twice, a parent_code that matches no row and no department, a parent_code loop or one that puts a department under its own sub-department, two departments of one name under one parent, or a name shared by several departments without a code when the row adopts by name. Nothing is deleted: with removeMissing=true, the active departments the file does not list are reported in absent and left as they are. dryRun=true reports what the file does and saves nothing. A file that renames or moves a department is applied only with the previewVersion of a dry run made against the current departments: without it the run is refused with 400, with a stale one with 409. A file that only creates departments or gives them codes applies without it. An applied file is listed in the import history as kind TREE and cannot be undone; import the earlier file again to put names and parents back.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||