Skip to main content
GET
/
v1
/
graph
Get knowledge graph
curl --request GET \
  --url https://app.nex.ai/api/developers/v1/graph \
  --header 'Authorization: <api-key>'
{
  "nodes": [
    {
      "id": "12345",
      "name": "John Smith",
      "type": "person",
      "definition_slug": "person",
      "primary_attribute": "<string>",
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "edges": [
    {
      "id": "<string>",
      "source": "<string>",
      "target": "<string>",
      "label": "works_at",
      "definition_id": "<string>"
    }
  ],
  "relationship_definitions": [
    {
      "id": "<string>",
      "name": "<string>",
      "entity_1_to_2": "<string>",
      "entity_2_to_1": "<string>"
    }
  ],
  "context_edges": [
    {
      "id": "tri_42",
      "source": "12345",
      "target": "67890",
      "label": "works_with",
      "edge_type": "context",
      "confidence": 0.5
    }
  ],
  "insight_nodes": [
    {
      "id": "ei:42",
      "content": "John prefers email communication over phone calls",
      "type": "preference",
      "confidence": 0.5,
      "source": "entity_insight"
    }
  ],
  "insights": {},
  "total_nodes": 123,
  "total_edges": 123,
  "total_context_edges": 123
}
This endpoint requires the record.read scope on your API key.

Overview

Returns the full knowledge graph for your workspace. The graph combines CRM relationship data with AI-extracted knowledge from ingested context, providing a unified view of entities and their connections.

Node Types

TypeID FormatResponse FieldDescription
CRM entity"12345"nodesResolved entities (people, companies, custom objects)
Ghost"ghost:123"nodesEntities mentioned in context but not yet matched to a CRM record
Entity insight"ei:123"insight_nodesAI-extracted insight scoped to a specific entity
Knowledge insight"ki:123"insight_nodesWorkspace-level AI-extracted knowledge

Edge Types

The context_edges array contains edges from multiple sources, distinguished by the edge_type field:
Edge TypeDescriptionHas Confidence
contextRelationships from ingested text (e.g., “involved_in”)No
tripletAI-extracted subject-predicate-object relationships (e.g., “works_with”, “reports_to”)Yes
insightLinks connecting insight nodes to entity nodesNo
insight_linkSemantic relationships between insight nodes (related_to or contradicts)Yes
insight_link edges represent semantic relationships discovered between insights. They connect two insight nodes (entity insights ei:* or knowledge insights ki:*) and always include a confidence score (0-1) representing semantic similarity. Labels:
  • related_to — The two insights are semantically related
  • contradicts — The two insights contain contradictory information
{
  "id": "il_42",
  "source": "ei:100",
  "target": "ei:200",
  "label": "related_to",
  "edge_type": "insight_link",
  "confidence": 0.87
}

Edge Priority

When both a context edge and a triplet edge exist between the same pair of nodes, generic context labels (involved_in, context) are suppressed in favor of the richer triplet edge. Non-generic context labels are kept alongside triplet edges.

Interactive Visualization

Request HTML format to receive an interactive graph visualization:
# Via query parameter
curl -s "https://app.nex.ai/api/developers/v1/graph?format=html" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Via Accept header
curl -s "https://app.nex.ai/api/developers/v1/graph" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: text/html"

Example

curl -s "https://app.nex.ai/api/developers/v1/graph?limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "nodes": [
    {
      "id": "12345",
      "name": "John Smith",
      "type": "person",
      "definition_slug": "person",
      "primary_attribute": "John Smith",
      "created_at": "2026-01-15T10:00:00Z"
    },
    {
      "id": "67890",
      "name": "Acme Corp",
      "type": "company",
      "definition_slug": "company",
      "primary_attribute": "Acme Corp",
      "created_at": "2026-01-10T08:00:00Z"
    }
  ],
  "edges": [
    {
      "id": "1001",
      "source": "12345",
      "target": "67890",
      "label": "works_at",
      "definition_id": "5"
    }
  ],
  "relationship_definitions": [
    {
      "id": "5",
      "name": "works_at",
      "entity_1_to_2": "works_at",
      "entity_2_to_1": "employs"
    }
  ],
  "context_edges": [
    {
      "id": "tri_42",
      "source": "12345",
      "target": "67890",
      "label": "leads_project_at",
      "edge_type": "triplet",
      "confidence": 0.92
    },
    {
      "id": "ei_edge_100",
      "source": "ei:100",
      "target": "12345",
      "label": "preference",
      "edge_type": "insight"
    },
    {
      "id": "il_7",
      "source": "ei:100",
      "target": "ei:200",
      "label": "related_to",
      "edge_type": "insight_link",
      "confidence": 0.87
    }
  ],
  "insight_nodes": [
    {
      "id": "ei:100",
      "content": "Prefers async communication over meetings",
      "type": "preference",
      "confidence": 0.85,
      "source": "entity_insight"
    },
    {
      "id": "ki:50",
      "content": "Q1 planning cycle typically starts in December",
      "type": "fact",
      "confidence": 0.90,
      "source": "knowledge_insight"
    }
  ],
  "insights": {
    "12345": [
      {
        "content": "Prefers async communication over meetings",
        "confidence": 0.85,
        "type": "preference"
      }
    ]
  },
  "total_nodes": 250,
  "total_edges": 180,
  "total_context_edges": 3
}

Authorizations

Authorization
string
header
required

API key for authentication (format: "Bearer YOUR_API_KEY")

Query Parameters

limit
integer
default:1000

Maximum number of entity nodes to return

Required range: 1 <= x <= 5000
format
enum<string>

Response format. Use html to receive an interactive graph visualization instead of JSON.

Available options:
json,
html

Response

Knowledge graph data

Complete knowledge graph for the workspace

nodes
object[]

CRM entity nodes (people, companies, custom objects) and ghost nodes (entities mentioned in context but not yet resolved to a CRM record)

edges
object[]

CRM relationship edges between entity nodes (e.g., person works_at company)

relationship_definitions
object[]

Definitions of relationship types in the workspace

context_edges
object[]

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.

insight_nodes
object[]

Insight nodes representing AI-extracted knowledge (entity insights and workspace-level knowledge insights)

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)

Last modified on March 19, 2026