# Offices & departments

Offices are the top-level organisational units in Dyflexis;
departments are nested inside them. Use these endpoints to
discover the offices you can write data against and to fetch the
full department tree of an office.


## Fetch the department tree

 - [GET /api/department-management/v3/tree](https://beta-developer.dyflexis.com/openapi/offices-and-departments/getdepartmenttree.md): Requires scope: business or payroll.

Retrieves all organizational units (offices, department groups, and departments) in a hierarchical tree structure. For a hospitality group, this typically returns each hotel or restaurant as an office, with departments such as Front of House, Kitchen, Housekeeping, and Bar nested underneath.

## List offices

 - [GET /api2/offices](https://beta-developer.dyflexis.com/openapi/offices-and-departments/listoffices.md): Requires scope: external_employees or clock.

> Legacy, Kept for existing integrations. New integrations should use GET /api/department-management/v3/tree, which returns offices together with their department structure in one call.

Returns a list of all available offices. This will not include department groups or departments.

