GET
/api/public/v1/company-chart

Get the company chart

Every active employee with their department, job title and manager, plus the departments themselves. `managerId` is what makes it a tree — and somebody with a null one sits at the top, which also means their time-off requests are auto-approved, because there is nobody to wait on.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

company-structure:read
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/company-chart" \
  -H "Authorization: Bearer your_access_token"
200Example response
json
{
  "message": "Company chart retrieved successfully!",
  "content": {
    "employees": [
      {
        "id": "emp_44f1",
        "managerId": "emp_12ab",
        "departmentId": "dep_01",
        "jobTitleId": "jt_04",
        "user": {
          "fullname": "Dana Reyes",
          "email": "dana@example.com"
        }
      }
    ],
    "departments": [
      {
        "id": "dep_01",
        "name": "Engineering",
        "jobTitles": []
      }
    ]
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Employees → Directory → Company chart
/employee/directory?view=chart