Unified.to
All articles

How to Build Org Charts and Employee Directories Across HRIS Platforms with

·

To build an org chart with Unified.to's HR & Directory API, read each employee's manager_id and build the reporting tree yourself; for a directory, add their groups (teams, departments), locations and company. Manager, group and location fields come back together on supported integrations such as BambooHR, HiBob, Personio, ADP Workforce Now and Deel (as of 19 October 2026). This guide is for teams adding org charts, people directories or team pickers to their product.

Every HRIS models organizational structure differently. Some rely on manager relationships. Others emphasize departments or teams. Locations may be first-class objects, loosely attached metadata, or missing entirely. Even when the data exists, it's often incomplete, inconsistent, or encoded with vendor-specific assumptions.

For a PM or platform engineer, this creates immediate questions:

  • Is reporting hierarchy defined by managers, groups, or both?
  • Are departments hierarchical or flat?
  • Do locations represent offices, regions, or payroll entities?
  • How do we keep directories current without re-syncing everything?

Many products solve this by hardcoding logic per HRIS or forcing a single org model onto all customers. That works early, but breaks as soon as customers expect accuracy across systems.

Unified.to's HR & Directory API doesn't invent structure. It returns the links the HRIS records (employee to manager, employee to groups, locations and company) in one schema, and you assemble the chart under your product's rules.

Directories and identity providers such as Okta, Microsoft Entra ID, Google Workspace Directory and JumpCloud return employees through the same API, so a directory can combine HR and identity sources.

What makes up org structure in HR data?

Three separate things that HR systems often blur together:

  1. Reporting hierarchy
    Who reports to whom.
  2. Organizational grouping
    Teams, departments, divisions, cost centers.
  3. Physical or geographic placement
    Offices, regions, headquarters.

Unified.to keeps these dimensions distinct. Your org chart or directory is built by composing them, not by assuming one implies the others.

Objects you'll use

Employees (HrisEmployee)

Employees are the anchor for all org views.

Relevant fields:

  • id
  • name, first_name, last_name
  • title
  • manager_id
  • employment_status
  • hired_at, terminated_at
  • groups[]
  • locations[]
  • company_id
  • image_url (expires after one hour)

Important constraints:

  • manager_id is returned on supported integrations only, and may be empty for some employees.
  • Some employees belong to multiple groups or locations.
  • Some HRISs do not enforce strict hierarchy.

Groups (HrisGroup)

Groups represent organizational units such as teams or departments.

Relevant fields:

  • id
  • name
  • parent_id
  • type
  • is_active
  • company_id

Groups can form a tree via parent_id on integrations that return it. Their meaning is customer-defined. You should not hardcode 'department' semantics based on type.

Employee → group membership should be treated as authoritative. Group → user backreferences may be incomplete and should not be assumed.

Locations (HrisLocation)

Locations represent physical or geographic placement.

Relevant fields:

  • id
  • name
  • parent_id
  • address (city, region, country)
  • timezone
  • is_active
  • is_hq
  • company_id

Some HRISs model location hierarchies (campus → building). Others do not. Treat parent_id as optional.

Companies (HrisCompany)

Companies provide scoping for multi-entity organizations.

Relevant fields:

  • id
  • name
  • legal_name
  • address

Employees, groups and locations can reference company_id on integrations that return it, so multi-entity customers can get one chart per entity.

Step 1: Fetch employees incrementally

Employee lists are paginated; incremental reads with updated_gte work on supported integrations.

import { UnifiedTo } from '@unified-api/typescript-sdk';

const sdk = new UnifiedTo({
  security: { jwt: process.env.UNIFIED_API_KEY! },
});

async function fetchEmployees(connectionId: string) {
  const out = [];
  let offset = 0;
  const limit = 100;

  while (true) {
    const page = await sdk.hris.listHrisEmployees({
      connectionId,
      limit,
      offset,
      sort: 'updated_at',
      order: 'asc',
      fields: [
        'id',
        'first_name',
        'last_name',
        'title',
        'manager_id',
        'employment_status',
        'terminated_at',
        'groups',
        'locations',
        'company_id',
        'image_url',
      ].join(','),
    });

    if (!page || page.length === 0) break;

    out.push(...page);
    offset += limit;
  }

  return out;
}

Where the integration supports updated_gte (for example Personio, SAP SuccessFactors, UKG Pro HCM), use it to read only changed records after the first load. Where it doesn't (Workday, BambooHR and HiBob don't list it), subscribe to employee change events instead (Step 7).

Step 2: Filter active employees

Directories and org charts typically exclude terminated staff.

function filterActive(employees: any[]) {
  return employees.filter(
    (e) => e.employment_status === 'ACTIVE' && !e.terminated_at
  );
}

Whether to include recent terminations is a product decision, not a data guarantee.

Step 3: Build the reporting hierarchy

Org charts are built from manager_id references.

function buildManagerTree(employees: any[]) {
  const byId = new Map<string, any>();
  const roots: any[] = [];

  for (const e of employees) {
    if (e.id) byId.set(e.id, { ...e, reports: [] });
  }

  for (const e of byId.values()) {
    if (e.manager_id && byId.has(e.manager_id)) {
      byId.get(e.manager_id).reports.push(e);
    } else {
      roots.push(e);
    }
  }

  return roots;
}

Important guardrails:

  • Employees without a valid manager become roots.
  • Circular references may exist in some HRISs. Your UI should tolerate them.
  • Do not assume a single root node.

Step 4: Fetch and index groups

Groups define organizational units independent of reporting lines.

async function fetchGroups(connectionId: string) {
  return await sdk.hris.listHrisGroups({
    connectionId,
    limit: 100,
    offset: 0,
    fields: 'id,name,parent_id,type,is_active,company_id',
  });
}

Build a group tree using parent_id if present. Do not assume group membership implies hierarchy.

Step 5: Fetch and index locations

Locations enable directory views by geography.

async function fetchLocations(connectionId: string) {
  return await sdk.hris.listHrisLocations({
    connectionId,
    limit: 100,
    offset: 0,
    fields: 'id,name,parent_id,address,is_active,is_hq,company_id,timezone',
  });
}

Use location address fields for filters like city, region, or country. Expect missing or partial data.

Step 6: Assemble directory views

At this point, you can construct directories by composing dimensions:

  • By team or department
    Filter employees by groups[].id
  • By location
    Filter employees by locations[].id or address fields
  • By company
    Filter employees by company_id
  • By manager
    Use the reporting tree

On integrations that support query (for example Workday, BambooHR, Personio), you can search by name or email server-side; elsewhere, search your own index.

Step 7: How do you keep the directory current?

Two options, depending on the integration. Change events: employee events are available on supported integrations (native where the HRIS sends them, otherwise Unified.to's [virtual webhooks](/blog/what_are_virtual_webhooks_how_they_differ_from_sync_based_webhooks) check at an interval you set, as often as every minute on paid plans); delete events arrive on some, such as BambooHR (virtual), HiBob and Personio (native). Or incremental reads with updated_gte where supported:

  1. Initial full load
  2. Store updated_at watermark
  3. Periodically re-fetch with updated_gte
  4. Update local indexes

This avoids full resyncs and works even without webhooks.

If you'd rather query the directory from your own database, Database Sync (Grow, Pro and Scale) writes objects with native or virtual webhooks to MongoDB, MySQL, Postgres, MSSQL, MariaDB, Supabase or Snowflake.

What does Unified.to leave to your product?

Unified.to does not:

  • Enforce a single org hierarchy
  • Infer departments from titles
  • Normalize incomplete HR data
  • Guarantee manager relationships exist

It returns structure as the HRIS records it, in one schema, so your product applies its own rules.

Next steps

Org charts and employee directories aren't a visualization problem. They're a data modeling problem.

Check which of your customers' HRIS integrations return manager_id, groups and locations on the Feature Support tab, build the tree from manager_id, and add change events for upkeep. Related: HR API Integration · Employee data model.

→ Start your 30-day free trial

→ Book a demo

All articles