API Reference

This page documents the Lynx API endpoints.

Info

Method

Endpoint

Description

GET

/api/v2/info

Program version and build info

Models

Create domains and models, upload schemas, and retrieve schema, OpenAPI spec, and context for each model.

Method

Endpoint

Description

GET

/api/v2/model

List domains

POST

/api/v2/model/{did}

Create domain

DELETE

/api/v2/model/{did}

Delete domain

GET

/api/v2/model/{did}

List models in domain

GET

/api/v2/model/{did}/{mid}

List model files

POST

/api/v2/model/{did}/{mid}

Create model from schema

PUT

/api/v2/model/{did}/{mid}

Update model schema

DELETE

/api/v2/model/{did}/{mid}

Delete model

GET

/api/v2/model/{did}/{mid}/schema.json

Get JSON Schema

GET

/api/v2/model/{did}/{mid}/model.yaml

Get OpenAPI spec

GET

/api/v2/model/{did}/{mid}/context.jsonld

Get JSON-LD context

Contexts

List, create, update, and delete JSON-LD contexts. Store custom contexts alongside generated ones.

Method

Endpoint

Description

GET

/api/v2/context

List contexts

GET

/api/v2/context/{context}

Get context

POST

/api/v2/context/{context}

Create context

PUT

/api/v2/context/{context}

Update context

DELETE

/api/v2/context/{context}

Delete context

Workbench

Infer schemas from JSON, compact or expand JSON-LD documents, and validate entities against a model.

Method

Endpoint

Description

POST

/api/v2/workbench/schema/infer

Infer schema from JSON payload

POST

/api/v2/jsonld/compact

Compact JSON-LD document

POST

/api/v2/jsonld/expand

Expand JSON-LD document

POST

/api/v2/validate/{did}/{mid}

Validate entity against model schema

Example (schema inference):

curl -X POST "http://localhost:8080/api/v2/workbench/schema/infer" \
  -H "Content-Type: application/json" \
  -d '{"temperature": 22.5, "humidity": 65}'

Example (validate entity):

curl -X POST "http://localhost:8080/api/v2/validate/myDomain/WeatherObserved" \
  -H "Content-Type: application/json" \
  -d '{"id": "urn:ngsi-ld:WeatherObserved:1", "type": "WeatherObserved", "temperature": {"value": 22.5}}'

Static Serving

Models and contexts are served at predictable URLs so other systems can reference them.

Path

Description

/dataModels

Serves data models directory

/jsonldContexts

Serves JSON-LD contexts directory