Skip to content
中文

Get a department

Code Mode: praxis.workforce.departments.retrieve

HTTP: GET /workforce/v1/departments/{id}

Reads one department with its head position id. A department’s charter is the document of its spec (GET /workforce/v1/specs/department/{id}), not a field of the department. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.

Signature

praxis.workforce.departments.retrieve(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_…), from the departments list or the response of establish.

Responses

StatusContent typesDescription
200application/jsonThe department.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_DENIED; an agent’s session token reads its own organization, but a run or computer token, or a session token that names no agent, is refused; call with an organization API key, a Console session, or the agent’s own session token.
404application/problem+jsonDEPARTMENT_NOT_FOUND; list departments and copy an id of your organization.