Skip to content
中文

Dissolve a department

Code Mode: praxis.workforce.departments.dissolve.create

HTTP: POST /workforce/v1/departments/{id}/dissolve

Dissolves an empty department: it leaves the active tree, keeps its record for history, and takes no new sub-departments or positions. This API has no operation to reopen it. Requires an organization owner or admin. The department must have no active sub-department and no position that is not closed; dissolve or close those first. Takes no body. Errors: 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_NOT_EMPTY while an active sub-department or an unclosed position remains; 409 DEPARTMENT_ROOT_IMMUTABLE for the root; 409 DEPARTMENT_DISSOLVED when it is already dissolved.

Signature

praxis.workforce.departments.dissolve.create(args:{path:{id:string}}):Promise<{/** Department id (dept_...); use it as department_id and parent_id. */ id:string;/** Id of the organization that owns the department. */ organization_id:string;/** Id of the parent department; null for the root department, which every organization has exactly once. */ parent_id:string|null;/** Department name, 1 to 100 characters; unique among the active departments under one parent; the root department carries the organization's name. */ name:string;/** Sort position among siblings; lower values come first. */ order:number;/** Id of the position that heads the department; null while no position has been designated head; the root department's head position is created with the organizat */ head_position_id:string|null;/** Whether the department is part of the tree or was dissolved. */ status:"active"|"dissolved";/** UTC instant (RFC 3339) when the department was established. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the department. */ update_time:string}>;

Parameters

NameInTypeRequiredDescription
idpathstringyesDepartment id (dept_…) to dissolve, from the departments list.

Responses

StatusContent typesDescription
200application/jsonThe department with status dissolved.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_DENIED; an organization owner or admin may call this, and machine tokens are always refused (an agent’s session token may read the organization, never change it). Use an API key or Console session of an allowed role.
404application/problem+jsonDEPARTMENT_NOT_FOUND; list departments and copy an id of your organization.
409application/problem+jsonDEPARTMENT_NOT_EMPTY, DEPARTMENT_ROOT_IMMUTABLE or DEPARTMENT_DISSOLVED; close its positions and dissolve its sub-departments first, and never target the root.