Knowledge Graph API

Integrate In Minutes, Not Meetings

This page is the practical starter for Mountain Path KG integrations. Get auth, run a real request, and validate response shape before moving to Swagger.

Fastest Path

Step 1

Choose auth: X-API-Key or Bearer JWT.

Step 2

Call /v1/graph/public/status to verify access.

Step 3

Run your target read endpoint using public mode.

public draft

Base URL

http://mpkgapi.mountainlabs.online
Auth Methods API key or JWT
Production Mode public
Internal Mode draft
Docs Entry /docs and /redoc
  • All versioned API paths begin with /v1/graph/{mode}/....
  • Use public for partner-facing reads.
  • Use draft only for internal author/admin workflows.
Quick Start

Run Your First Successful Call

Use this before diving into full schema docs.

1. Add Credentials

  • X-API-Key: <key>
  • Authorization: ApiKey <key>
  • Authorization: Bearer <jwt>

2. Hit Status Endpoint

Confirms auth + graph connectivity in one request.

curl -H "X-API-Key: <KEY>" "http://mpkgapi.mountainlabs.online/v1/graph/public/status"

3. Validate Success Shape

{
  "mode": "public",
  "ok": true
}
Auth & Access

Access Rules By Mode

Human sessions use roles. Managed API keys require a matching environment, product, and endpoint scope.

Public Mode

For integration reads and production consumption.

/v1/graph/public/...

Managed-key product: kg.public. Human roles: consumer, clinician, service, partner, admin.

Draft Mode

For internal authoring and pre-publication workflows only.

/v1/graph/draft/...

Managed-key product: kg.draft. Human roles: reviewer, author, admin. Requires an isolated draft projection.

Auth Headers

Either key-based or JWT auth is accepted.

X-API-Key: <key>

Authorization: ApiKey <key>

Authorization: Bearer <jwt>

Endpoints

Choose Endpoint By Job

Use this grouping to avoid guessing where each call belongs.

Service Health & Discovery

Use these before business calls.

GET/healthz

Liveness check for monitoring.

No mode required Monitoring
GET/v1/graph/{mode}/status

Confirms auth + graph responsiveness.

Connectivity check First call
GET/v1/graph/{mode}/schema

Lists labels, relationships, properties.

Discovery Schema introspection

Read Protocols & Drugs

Primary clinical retrieval endpoints.

GET/v1/graph/{mode}/protocols/{protocol_id}

Optional depth 1-4. Returns protocol-centered subgraph.

Clinical retrieval Depth 1-4
GET/v1/graph/{mode}/drugs/{drug_id}

Supports limit, offset for pagination.

Drug context Pagination
GET/v1/graph/{mode}/search

Query params: entity, query, limit.

Lookup Entity search

Traverse & Templates

Advanced integration and lineage scenarios.

GET/v1/graph/{mode}/paths

Use start_label, start_id, max_depth, optional relationship_types.

Graph traversal Bounded depth
POST/v1/graph/{mode}/query/{template_id}

Body shape: {"params":{...}}. Executes saved template query.

Template execution Parameterized body
Examples

Copyable Request Snippets

Replace only IDs and credentials. Keep URLs and structure unchanged.

Protocol Subgraph

Fetch protocol with linked regimens, drugs, and citations.

curl -H "X-API-Key: <KEY>"   "http://mpkgapi.mountainlabs.online/v1/graph/public/protocols/TYPHOID_V1.0?depth=3"

Drug View

Fetch protocol/regimen context for one drug.

curl -H "X-API-Key: <KEY>"   "http://mpkgapi.mountainlabs.online/v1/graph/public/drugs/CEFTRIAXONE?limit=50&offset=0"

Search

Find protocols or drugs by query string.

curl -H "X-API-Key: <KEY>"   "http://mpkgapi.mountainlabs.online/v1/graph/public/search?entity=protocol&query=typhoid&limit=10"

Traverse Paths

Explore bounded graph relationships from a start node.

curl -H "X-API-Key: <KEY>"   "http://mpkgapi.mountainlabs.online/v1/graph/public/paths?start_label=IllnessProtocol&start_id=TYPHOID_V1.0&max_depth=3"

Template Query

Run a whitelisted template with request params.

curl -X POST -H "X-API-Key: <KEY>" -H "Content-Type: application/json"   -d '{"params": {"protocol_id": "TYPHOID_V1.0"}}'   "http://mpkgapi.mountainlabs.online/v1/graph/public/query/citation_lineage"
Response

Response Envelope

Every endpoint returns a stable wrapper around data payloads.

{
  "mode": "public",
  "nodes": [...],
  "relationships": [...],
  "metadata": { "protocolId": "TYPHOID_V1.0", "mode": "public" }
}

Integration note

If you need full parameter schemas and response details, use Swagger.

Errors

Error Codes

Most integration failures map to these status codes.

401

Missing or invalid credentials.

403

Insufficient role for requested graph mode.

404

Entity not found in the graph.

502

Upstream Neo4j connectivity error.