Documentation

Lontiq API

Introduction

Lontiq transforms your company data into a structured, traversable knowledge graph. Documents, spreadsheets, and operational data are automatically organized into entities and relationships that your AI systems can query directly.

The Lontiq API gives you programmatic access to your knowledge graph. You can run Cypher queries, perform semantic search over your entities, retrieve the full graph schema, and chat with your data through an agentic AI loop.

All API endpoints return a consistent response envelope with status, data, and message fields.

Quick Start

Get up and running in three steps: create an API key, make your first request, and explore your knowledge graph.

1. Get your API key

API keys are created from the Settings page in the Lontiq dashboard by an admin user. When a key is created, the full key is shown once — copy it and store it securely.

Keys follow the format lntq_<40 characters> and can be scoped to specific spaces and permissions.

2. Make your first request

Retrieve your graph schema to see what data is available:

curl
curl -X GET https://api.lontiq.com/api/v1/graph/schema \
  -H "X-API-Key: lntq_your_api_key_here"
python
import requests

response = requests.get(
    "https://api.lontiq.com/api/v1/graph/schema",
    headers={"X-API-Key": "lntq_your_api_key_here"}
)

schema = response.json()
print(schema["data"])

3. Explore your data

Once you have the schema, you can run Cypher queries to traverse relationships, use semantic search to find entities by meaning, or chat with your graph through the AI-powered chat endpoint.


Authentication

All API requests require authentication via an API key. Pass the key in the X-API-Key header or as a Bearer token in the Authorization header.

Header Options
# Option 1: X-API-Key header (recommended)
X-API-Key: lntq_your_api_key_here

# Option 2: Bearer token
Authorization: Bearer lntq_your_api_key_here
Your API key is shown only once at creation time. Store it in a secure location. If you lose it, you will need to create a new key.

API key properties

Property Description
name A human-readable label to identify the key (e.g., "Production Backend").
space_labels Restrict the key to specific spaces (e.g., ["HR", "FINANCE"]). Leave empty for access to all spaces.
permissions Array of allowed operations: query, search, schema, chat.
expires_in_days Optional expiration. Set to null for a key that never expires.

Base URL

All API v1 endpoints are served under:

https://api.lontiq.com/api/v1

Append the endpoint path to this base URL. For example, the schema endpoint is at /api/v1/graph/schema.


Get Graph Schema

Returns the full schema of your knowledge graph, including all node labels, relationship types, and their properties. Use this to understand your data structure before running queries.

GET /api/v1/graph/schema

Query parameters

Parameter Type Description
format optional string full returns structured JSON with all properties and types. text returns a human-readable summary optimized for LLM system prompts. Default: full.

Required permission

schema

Example request

curl
curl -X GET https://api.lontiq.com/api/v1/graph/schema?format=full \
  -H "X-API-Key: lntq_your_api_key_here"
json
{
  "status": "Success",
  "data": {
    "node_labels": [
      {
        "label": "Employee",
        "count": 142,
        "properties": [
          { "name": "name", "type": "string" },
          { "name": "department", "type": "string" }
        ]
      }
    ],
    "relationship_types": [
      {
        "type": "REPORTS_TO",
        "count": 138,
        "source": "Employee",
        "target": "Employee"
      }
    ]
  },
  "message": null
}

Query Graph

Execute a read-only Cypher query against your knowledge graph. Write operations (CREATE, MERGE, DELETE, SET, REMOVE) are blocked.

POST /api/v1/graph/query

Request body

Field Type Description
cypher required string A read-only Cypher query.
params optional object Query parameters for parameterized Cypher. Default: {}.

Required permission

query

Example request

curl
curl -X POST https://api.lontiq.com/api/v1/graph/query \
  -H "X-API-Key: lntq_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "cypher": "MATCH (e:Employee)-[:REPORTS_TO]->(m:Employee) RETURN e.name, m.name LIMIT 10",
    "params": {}
  }'
python
import requests

response = requests.post(
    "https://api.lontiq.com/api/v1/graph/query",
    headers={
        "X-API-Key": "lntq_your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "cypher": "MATCH (e:Employee) RETURN e.name LIMIT 5",
        "params": {}
    }
)

data = response.json()
for row in data["data"]["results"]:
    print(row)
json
{
  "status": "Success",
  "data": {
    "results": [
      { "e.name": "Alice Chen", "m.name": "Bob Smith" },
      { "e.name": "Carol Davis", "m.name": "Bob Smith" }
    ],
    "row_count": 2,
    "truncated": false
  },
  "message": null
}

Search your knowledge graph using natural language. Lontiq uses vector embeddings to find the most relevant entities and their connections, returning nodes, edges, and source references.

POST /api/v1/graph/search

Request body

Field Type Description
query required string Natural language search query.
limit optional integer Maximum number of results. Range: 1–50. Default: 10.

Required permission

search

Example request

curl
curl -X POST https://api.lontiq.com/api/v1/graph/search \
  -H "X-API-Key: lntq_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"query": "leadership effectiveness", "limit": 5}'
python
import requests

response = requests.post(
    "https://api.lontiq.com/api/v1/graph/search",
    headers={
        "X-API-Key": "lntq_your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "query": "leadership effectiveness",
        "limit": 5
    }
)

results = response.json()
for node in results["data"]["nodes"]:
    print(node)
json
{
  "status": "Success",
  "data": {
    "nodes": [
      {
        "id": "4521",
        "labels": ["Competency"],
        "properties": {
          "name": "Leadership Effectiveness",
          "description": "Ability to guide and influence teams..."
        }
      }
    ],
    "edges": [
      {
        "source": "4521",
        "target": "4530",
        "type": "MEASURED_BY"
      }
    ],
    "entry_nodes": ["4521"],
    "sources": ["survey_2024.xlsx"]
  },
  "message": null
}

Chat

Ask questions about your data in natural language. Lontiq uses an agentic AI loop that automatically queries the graph, searches for context, and synthesizes an answer with full source attribution and an audit trail of every tool call.

POST /api/v1/chat

Request body

Field Type Description
question required string Your question in natural language.
session_id optional string A session ID for multi-turn conversations. Omit for a new session. The response will include a session_id you can reuse.

Required permission

chat

Example request

curl
curl -X POST https://api.lontiq.com/api/v1/chat \
  -H "X-API-Key: lntq_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"question": "Who are the top performers in the engineering team?"}'
python
import requests

# Start a new conversation
response = requests.post(
    "https://api.lontiq.com/api/v1/chat",
    headers={
        "X-API-Key": "lntq_your_api_key_here",
        "Content-Type": "application/json"
    },
    json={"question": "Who are the top performers in engineering?"}
)

result = response.json()
print(result["data"]["answer"])

# Continue the conversation
session_id = result["data"].get("session_id")

follow_up = requests.post(
    "https://api.lontiq.com/api/v1/chat",
    headers={
        "X-API-Key": "lntq_your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "question": "What projects are they working on?",
        "session_id": session_id
    }
)
json
{
  "status": "Success",
  "data": {
    "answer": "Based on your data, the top performers in engineering are...",
    "sources": [
      "performance_reviews_q4.xlsx",
      "team_structure.csv"
    ],
    "audit": {
      "tool_calls": [
        { "tool": "get_schema", "duration_ms": 45 },
        { "tool": "search_nodes", "query": "top performers engineering" },
        { "tool": "run_cypher", "query": "MATCH (e:Employee)..." }
      ]
    },
    "graph_data": {
      "nodes": [...],
      "edges": [...]
    }
  },
  "message": null
}
The audit object gives full transparency into every tool call the AI agent made to answer your question, including the Cypher queries it wrote and the search terms it used.

MCP — Claude Desktop & Claude Code

Lontiq exposes a Model Context Protocol (MCP) server, allowing Claude to query your knowledge graph directly from Claude Desktop or Claude Code. Claude gets access to four tools:

Tool Description
get_graph_schema Returns the full schema: node labels, properties, relationships.
query_graph Execute a read-only Cypher query (max 200 rows).
search_graph Semantic search over entities using natural language (max 50 results).
get_node_details Get all properties, relationships, and 1-hop connected nodes for a specific node.

Setup

Add the Lontiq MCP server to your Claude Desktop configuration file (claude_desktop_config.json):

json
{
  "mcpServers": {
    "lontiq": {
      "command": "python",
      "args": ["-m", "app.mcp"],
      "env": {
        "LONTIQ_API_KEY": "lntq_your_api_key_here"
      }
    }
  }
}

Once configured, Claude can autonomously query your knowledge graph, search for entities, and traverse relationships to answer questions about your data.


Status Codes

200 Request succeeded. The data field contains the result. 400 Bad request. Invalid parameters or malformed Cypher query. 401 Unauthorized. Missing, invalid, or expired API key. 403 Forbidden. Your API key does not have the required permission for this endpoint. 429 Rate limit exceeded. Wait and retry after the cooldown window. 500 Internal server error. Please retry or contact support.

All error responses include a message field with a human-readable explanation:

json
{
  "status": "Error",
  "data": null,
  "message": "Write operations are not allowed. Use read-only Cypher queries."
}

Rate Limits

API key requests are rate-limited to 100 requests per minute using a sliding window. If you exceed this limit, you will receive a 429 response. Wait for the window to reset before retrying.

Limit Value
Requests per window 100
Window duration 60 seconds
Scope Per API key

Permissions

Each API key is granted specific permissions that control which endpoints it can access. Permissions are assigned at key creation time by an admin.

Permission Grants access to
query POST /api/v1/graph/query — Execute Cypher queries.
search POST /api/v1/graph/search — Semantic search over entities.
schema GET /api/v1/graph/schema — View graph schema.
chat POST /api/v1/chat — Agentic chat with your data.
Follow the principle of least privilege: only grant the permissions your integration actually needs. A dashboard that only displays schema information should only have the schema permission.