---
title: "Get knowledge graph"
method: GET
path: "/v1/graph"
tags: ["Graph"]
---

# Get knowledge graph

`GET /v1/graph`

## Request

- Base URL: `https://app.nex.ai/api/developers`
- URL: `https://app.nex.ai/api/developers/v1/graph`
- Auth: API key in header `Authorization`

Returns the full knowledge graph for the workspace, including CRM entity nodes, relationship edges, context edges (from ingested text), insight triplet edges (AI-extracted subject-predicate-object relationships), insight nodes, and insight link edges (semantic relationships between insights). Supports an optional `limit` query parameter to control the maximum number of entity nodes returned (default 1000, max 5000). Set `Accept: text/html` or `?format=html` to receive an interactive visualization.

## Query parameters

- `limit` integer
- `format` 'json' | 'html'

## Response `200`

Knowledge graph data

- GraphGraphResponse: Complete knowledge graph for the workspace
  - `nodes` GraphGraphNode[]: CRM entity nodes (people, companies, custom objects) and ghost nodes (entities mentioned in context but not yet resolved to a CRM record)
    - `id` string: Node ID. CRM entities use numeric IDs (e.g., "12345"). Ghost nodes use the format "ghost:<context_id>".
    - `name` string: Display name (primary attribute value, or a generated name for unnamed entities)
    - `type` string: Entity type name (e.g., "person", "company", "ghost")
    - `definition_slug` string: Slug of the entity definition
    - `primary_attribute` string: Value of the entity's primary attribute
    - `created_at` string, date-time: When the entity was created
  - `edges` GraphGraphEdge[]: CRM relationship edges between entity nodes (e.g., person works_at company)
    - `id` string: Edge ID
    - `source` string: Source node ID
    - `target` string: Target node ID
    - `label` string: Relationship label (e.g., "works_at", "reports_to")
    - `definition_id` string: ID of the relationship definition
  - `relationship_definitions` GraphGraphRelationshipDefinition[]: Definitions of relationship types in the workspace
    - `id` string: Definition ID
    - `name` string: Display name
    - `entity_1_to_2` string: Label from entity 1 to entity 2 (e.g., "works_at")
    - `entity_2_to_1` string: Inverse label from entity 2 to entity 1 (e.g., "employs")
  - `context_edges` GraphContextEdge[]: Edges derived from ingested context, AI-extracted triplets, insight-entity links, and insight-to-insight semantic relationships. Each edge has an `edge_type` indicating its source.
    - `id` string: Edge ID. Prefixed by type: "ctx_" for context, "tri_" for triplet, "ei_edge_" for entity insight edges, and "il_" for insight_link edges.
    - `source` string: Source node ID. Can be an entity ID, ghost ID ("ghost:123"), or insight node ID ("ei:123" or "ki:123").
    - `target` string: Target node ID
    - `label` string: Edge label. For context edges: the relationship type. For triplets: the predicate (e.g., "works_with"). For insight edges: the insight type. For insight_link edges: "related_to" or "contradicts".
    - `edge_type` 'context' | 'triplet' | 'insight' | 'insight_link': Source type of the edge
    - `confidence` number, double, nullable: Confidence score (0-1). Present on triplet edges (extraction confidence) and insight_link edges (similarity score). Null/absent for context and insight edges.
  - `insight_nodes` GraphInsightNode[]: Insight nodes representing AI-extracted knowledge (entity insights and workspace-level knowledge insights)
    - `id` string: Insight node ID. Entity insights use "ei:<id>", knowledge insights use "ki:<id>".
    - `content` string: The insight text content
    - `type` string: Insight type (e.g., "preference", "behavior", "fact")
    - `confidence` number, double: Confidence score (0-1)
    - `source` 'entity_insight' | 'knowledge_insight': Source type: "entity_insight" (scoped to an entity) or "knowledge_insight" (workspace-level)
  - `insights` object: Per-entity insight summaries, keyed by entity ID
  - `total_nodes` integer: Total number of entity nodes in the workspace (may exceed the returned count due to the limit parameter)
  - `total_edges` integer: Total number of CRM relationship edges in the workspace
  - `total_context_edges` integer: Total number of context edges returned (includes all edge types)

## Other responses

- `400`: Bad request - Invalid query parameters
- `401`: Unauthorized - Invalid or missing API key
- `500`: Internal server error

## Changes

- **2026-03-19** `d3d06f62488a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nex/apis/nex-developer-api/changes/v1/graph/get.md)

---

[API](https://skmtc.dev/nex/apis/nex-developer-api.md) - [All operations](https://skmtc.dev/nex/apis/nex-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nex/apis/nex-developer-api/revisions/51003af13108?raw)
