> ## Documentation Index
> Fetch the complete documentation index at: https://docs.internal.nscale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get topology group graph

> One site+facet topology slice as a single nested node.

The flat list endpoint publishes the same slice side by side and leaves the
consumer to rebuild the hierarchy from ``parent``; this returns it already
assembled, with five fields per node instead of eighteen.

Every node carries ``children`` and ``device_ids`` — a leaf has
``children: []`` rather than no key, and ``device_ids`` holds that node's
*direct* memberships at any depth, because a device attached mid-tree is
legal and a leaf-only field would drop it.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml get /api/v1/topology-groups/graph/
openapi: 3.0.3
info:
  title: Fleet Manager API
  version: 1.0.0
  description: API for the Nscale Fleet Manager
servers: []
security: []
paths:
  /api/v1/topology-groups/graph/:
    get:
      tags:
        - Topology Groups
      summary: Get topology group graph
      description: >-
        One site+facet topology slice as a single nested node.


        The flat list endpoint publishes the same slice side by side and leaves
        the

        consumer to rebuild the hierarchy from ``parent``; this returns it
        already

        assembled, with five fields per node instead of eighteen.


        Every node carries ``children`` and ``device_ids`` — a leaf has

        ``children: []`` rather than no key, and ``device_ids`` holds that
        node's

        *direct* memberships at any depth, because a device attached mid-tree is

        legal and a leaf-only field would drop it.
      operationId: api_v1_topology_groups_graph_retrieve
      parameters:
        - in: query
          name: facet
          schema:
            $ref: '#/components/schemas/FacetEnum'
          description: Topology facet whose slice to return.
          required: true
        - in: query
          name: site_id
          schema:
            type: string
            format: uuid
          description: Site whose topology slice to return.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopologyGraphNode'
          description: ''
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication credentials were not provided or are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to perform this action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No topology groups for this site and facet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - oauth2:
            - topology-group:read
        - cookieAuth: []
components:
  schemas:
    FacetEnum:
      enum:
        - networking
        - power
      type: string
      description: |-
        * `networking` - networking
        * `power` - power
    TopologyGraphNode:
      type: object
      description: >-
        OpenAPI shape of one topology graph node.


        Schema only: the response is assembled and rendered as pydantic

        (``topology_graph.TopologyGraphNode``), and this exists so the spec
        publishes a

        named component whose non-recursive fields stay generated from one
        declaration.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        label:
          type: string
          readOnly: true
          pattern: ^[-a-zA-Z0-9_]+$
        type:
          allOf:
            - $ref: '#/components/schemas/TopologyGroupTypeEnum'
          readOnly: true
        device_ids:
          type: array
          items:
            type: string
            format: uuid
          readOnly: true
        children:
          type: array
          items:
            $ref: '#/components/schemas/TopologyGraphNode'
          readOnly: true
      required:
        - children
        - device_ids
        - id
        - label
        - type
    ErrorResponse:
      type: object
      description: >-
        Uniform error body for every 4xx/5xx response. `detail` is a
        human-readable message, always present, safe to display to end users.
        `code` is the machine-readable identifier. `field_errors` lists
        per-input-field validation messages and is empty for non-field errors
        (auth, permission, not-found, conflict, server).
      required:
        - detail
        - code
        - field_errors
      properties:
        detail:
          type: string
        code:
          $ref: '#/components/schemas/ErrorCodeEnum'
        field_errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
    TopologyGroupTypeEnum:
      enum:
        - root
        - super-spine
        - spine
        - pod
        - nvlink-domain
        - unknown
      type: string
      description: >-
        * `root` - root

        * `super-spine` - super-spine groups multiple spines together

        * `spine` - spine groups multiple pods together

        * `pod` - pod groups either multiple devices or multiple nvlink-domains
        together

        * `nvlink-domain` - nvlink-domain groups multiple devices together (min:
        1)

        * `unknown` - unknown
    ErrorCodeEnum:
      type: string
      description: >-
        Stable machine-readable error identifier. New members may be added
        within this API version; clients must tolerate unknown values.
      enum:
        - error
        - invalid
        - parse_error
        - authentication_failed
        - not_authenticated
        - permission_denied
        - not_found
        - method_not_allowed
        - not_acceptable
        - unsupported_media_type
        - conflict
        - enrollment_infrastructure_reference_pending
        - enrollment_infrastructure_reference_changed
        - unprocessable_entity
        - throttled
        - service_unavailable
    FieldError:
      type: object
      description: One input field's validation messages.
      required:
        - field
        - messages
      properties:
        field:
          type: string
          description: >-
            Dotted path to the offending input field, or to the collection row
            when the whole row is invalid (e.g. `filters.end_date`,
            `memberships.0.role`, `memberships.0`).
        messages:
          type: array
          minItems: 1
          items:
            type: string
  securitySchemes:
    oauth2:
      type: oauth2
      flows: {}
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.