Zum Hauptinhalt springen
GET
/
customers
/
{customerId}
/
hierarchy
cURL
curl -X GET \
 /customers/{customerId}/hierarchy \
 --header "Authorization: Bearer <token>"
{
  "root": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Klinik Musterstadt",
    "customerNumber": "CUST-100",
    "isCurrentCustomer": true,
    "children": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "customerNumber": "<string>",
        "isCurrentCustomer": true,
        "children": [
          "<unknown>"
        ]
      }
    ]
  }
}
Returns the full hierarchy tree for any customer in the organization structure. Regardless of whether a parent or child customer ID is provided, the response always starts from the root of the hierarchy and includes all descendants as a nested tree. The isCurrentCustomer flag on each node indicates which customer in the tree corresponds to the ID specified in the request path.

Example Response

{
    "root": {
        "id": "uuid-100",
        "name": "Klinik Musterstadt",
        "customerNumber": "CUST-100",
        "isCurrentCustomer": false,
        "children": [
            {
                "id": "uuid-101",
                "name": "Radiology",
                "customerNumber": "CUST-101",
                "isCurrentCustomer": true,
                "children": []
            },
            {
                "id": "uuid-102",
                "name": "Orthopedics",
                "customerNumber": "CUST-102",
                "isCurrentCustomer": false,
                "children": []
            }
        ]
    }
}

Feature Flag

This endpoint requires the customer.hierarchy feature to be enabled. If the feature is not active, a 501 Not Implemented response is returned.

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

customerId
string<uuid>
erforderlich

The ID of any customer in the hierarchy (the response always starts from the root)

Antwort

The full hierarchy tree starting from the root

root
object

The root customer of the hierarchy tree