---
title: "Dump the entire KG for visualization"
method: GET
path: "/api/v0/knowledge-graphs/{kg_id}/graph"
tags: ["Knowledge Graphs"]
---

# Dump the entire KG for visualization

`GET /api/v0/knowledge-graphs/{kg_id}/graph`

Returns all nodes + edges + associated documents in one round-trip. Each edge references its endpoints by node public_id, resolved against ``nodes`` in the same payload. Intended for the map-view; the agent should use the more targeted neighbors and list endpoints.

## Path parameters

- `kg_id` string, uuid, required

## Response `200`

Successful Response

- KnowledgeGraphGraphResponse — Single-round-trip dump of the KG suitable for d3 / cytoscape / reactflow. Each edge references its endpoints by node public_id, so the FE resolves them against ``nodes`` in the same payload — no follow-up calls. The frontend defaults to the Tier-3 domain view (filter ``nodes`` to ``tier == 'domain'`` and the edges between them); representation nodes and their ``represents`` / ``cross_references`` edges are the drill-down evidence layer (see kg-redesign-DESIGN.md §UI mapping).
  - `nodes` NodeResponse[], required
    - `id` string, uuid, required
    - `knowledge_graph_id` string, uuid, required
    - `tier` 'representation' | 'domain', required
    - `type_id` string, required
    - `name` string, required
    - `attributes` object, required
    - `derived` object
    - `selector` object, nullable
    - `confidence` number, nullable
    - `source` string, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `edges` EdgeResponse[], required
    - `id` string, uuid, required
    - `knowledge_graph_id` string, uuid, required
    - `edge_type_id` string, required
    - `source_public_id` string, uuid, required
    - `target_public_id` string, uuid, required
    - `attributes` object, required
    - `confidence` number, nullable
    - `source` string, required
    - `evidence` object, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `documents` KnowledgeGraphDocumentSummary[], required
    - `public_id` string, uuid, required
    - `name` string, required
    - `num_pages` integer, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) · [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/outerport/outerport-api/revisions/f565b46daaea/schema)
