API reference
Lexicor HTTP API
A REST API for the Lexicor mediation layer: canonicalize inputs into an IntentGraph, move meaning across hops as versioned transport packets, and render to any target surface. This reference documents the Lexicor API (iPaaS bundle) (0.1.0a1) — the subset intended for direct REST and iPaaS integration.
Base URL
All endpoints are served under a single versioned base:
https://api.lexicor.devEvery path below is relative to this base — for example POST https://api.lexicor.dev/v1/roundtrip.
Authentication
Mutating routes require a tenant API key sent in the X-API-Key header. The two health checks (/v1/health, /v1/ready) are unauthenticated.
curl -X POST https://api.lexicor.dev/v1/roundtrip \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "intent_graph": { /* … */ } }'Treat API keys like passwords. Send requests from your backend or an integration platform, never from an untrusted browser client.
Errors
Successful calls return 200. Request validation failures return 422 with a machine-readable body describing which field failed. Version and policy mismatches are fail-closed: an unknown codec or symbol-table version is rejected with an explicit error rather than silently coerced.
Try it
Each endpoint below includes a Try it console. It runs in simulated mode and returns the documented example response entirely in your browser — no request leaves the page. See Self-hosting for enabling live requests against your own deployment.
Health
Liveness check --- always returns 200 if the process is up.
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| status optional | string default: "ok" | |
| version required | string |
curl -X GET https://api.lexicor.dev/v1/health{
"status": "ok",
"version": "0.1.0a1"
}Ready
Readiness check --- verifies core dependencies are operational.
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| status optional | string default: "ok" | |
| version required | string | |
| checks optional | object |
curl -X GET https://api.lexicor.dev/v1/ready{
"status": "ok",
"version": "0.1.0a1",
"checks": {
"codec": "ok",
"symbol_table": "ok",
"ledger": "ok"
}
}Normalize
Deterministically normalize an IntentGraph.
Request body
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | Raw IntentGraph JSON object |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| normalized required | object |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/normalize \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intent_graph":{"id":"intent_notification_deploy_complete","intent_type":"simple_notification","graph_version":"1.0.0","entities":[{"id":"ent_recipient","entity_type":"party","canonical_name":"ops_team","confidence":0.91},{"id":"ent_subject","entity_type":"artifact","canonical_name":"deployment_is_complete","confidence":0.87}],"predicates":[{"id":"pred_notify","frame_type":"action","actor":"system","predicate":"NOTIFY","object":"ent_recipient","certainty":"requested"}],"constraints":{"temporal":[],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"notification.simple","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"ingress_english","speaker":"user"},"confidence":0.9}}'{
"normalized": {
"id": "intent_notification_deploy_complete",
"intent_type": "simple_notification",
"graph_version": "1.0.0",
"entities": [
{
"id": "ent_recipient",
"entity_type": "party",
"canonical_name": "ops_team",
"confidence": 0.91
},
{
"id": "ent_subject",
"entity_type": "artifact",
"canonical_name": "deployment_is_complete",
"confidence": 0.87
}
],
"predicates": [
{
"id": "pred_notify",
"frame_type": "action",
"actor": "system",
"predicate": "NOTIFY",
"object": "ent_recipient",
"certainty": "requested"
}
],
"constraints": {
"temporal": [],
"logical": [],
"ambiguity": [],
"risk_flags": []
},
"output_preferences": {
"target_schema": "notification.simple",
"fidelity_mode": "semantic_lossless"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
},
"confidence": 0.9
}
}Encode
Encode a normalized IntentGraph into a compact payload.
Request body
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | IntentGraph to encode |
| render_strategy optional | string default: "ascii_compact" | Codec strategy: ascii_compact, han, indexed_tuple |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| payload required | string | Encoded payload string |
| strategy required | string | |
| symbol_table_version required | string |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/encode \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intent_graph":{"id":"intent_notification_deploy_complete","intent_type":"simple_notification","graph_version":"1.0.0","entities":[{"id":"ent_recipient","entity_type":"party","canonical_name":"ops_team","confidence":0.91},{"id":"ent_subject","entity_type":"artifact","canonical_name":"deployment_is_complete","confidence":0.87}],"predicates":[{"id":"pred_notify","frame_type":"action","actor":"system","predicate":"NOTIFY","object":"ent_recipient","certainty":"requested"}],"constraints":{"temporal":[],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"notification.simple","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"ingress_english","speaker":"user"},"confidence":0.9},"render_strategy":"ascii_compact"}'{
"payload": "lx1|<opaque-compact-payload>|core-sym-1",
"strategy": "ascii_compact",
"symbol_table_version": "core-sym-1"
}Decode
Decode a compact payload back to an IntentGraph.
Request body
| Field | Type | Description |
|---|---|---|
| payload required | string | Encoded payload string |
| strategy optional | string default: "ascii_compact" | Strategy used to encode: ascii_compact, han, indexed_tuple |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| intent_graph required | object |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/decode \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"payload":"lx1|<opaque-compact-payload>|core-sym-1","strategy":"ascii_compact"}'{
"intent_graph": {
"id": "intent_notification_deploy_complete",
"intent_type": "simple_notification",
"graph_version": "1.0.0",
"entities": [
{
"id": "ent_recipient",
"entity_type": "party",
"canonical_name": "ops_team",
"confidence": 0.91
},
{
"id": "ent_subject",
"entity_type": "artifact",
"canonical_name": "deployment_is_complete",
"confidence": 0.87
}
],
"predicates": [
{
"id": "pred_notify",
"frame_type": "action",
"actor": "system",
"predicate": "NOTIFY",
"object": "ent_recipient",
"certainty": "requested"
}
],
"constraints": {
"temporal": [],
"logical": [],
"ambiguity": [],
"risk_flags": []
},
"output_preferences": {
"target_schema": "notification.simple",
"fidelity_mode": "semantic_lossless"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
},
"confidence": 0.9
}
}Roundtrip
Run the full normalize-encode-decode-equivalence pipeline.
Request body
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | |
| render_strategy optional | string default: "ascii_compact" |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| normalized required | object | |
| decoded required | object | |
| is_equivalent required | boolean | |
| fidelity_score required | number | |
| trace optional | object | null |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/roundtrip \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intent_graph":{"id":"intent_notification_deploy_complete","intent_type":"simple_notification","graph_version":"1.0.0","entities":[{"id":"ent_recipient","entity_type":"party","canonical_name":"ops_team","confidence":0.91},{"id":"ent_subject","entity_type":"artifact","canonical_name":"deployment_is_complete","confidence":0.87}],"predicates":[{"id":"pred_notify","frame_type":"action","actor":"system","predicate":"NOTIFY","object":"ent_recipient","certainty":"requested"}],"constraints":{"temporal":[],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"notification.simple","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"ingress_english","speaker":"user"},"confidence":0.9}}'{
"normalized": {
"id": "intent_notification_deploy_complete",
"intent_type": "simple_notification",
"graph_version": "1.0.0",
"entities": [
{
"id": "ent_recipient",
"entity_type": "party",
"canonical_name": "ops_team",
"confidence": 0.91
},
{
"id": "ent_subject",
"entity_type": "artifact",
"canonical_name": "deployment_is_complete",
"confidence": 0.87
}
],
"predicates": [
{
"id": "pred_notify",
"frame_type": "action",
"actor": "system",
"predicate": "NOTIFY",
"object": "ent_recipient",
"certainty": "requested"
}
],
"constraints": {
"temporal": [],
"logical": [],
"ambiguity": [],
"risk_flags": []
},
"output_preferences": {
"target_schema": "notification.simple",
"fidelity_mode": "semantic_lossless"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
},
"confidence": 0.9
},
"decoded": {
"id": "intent_notification_deploy_complete",
"intent_type": "simple_notification",
"graph_version": "1.0.0",
"entities": [
{
"id": "ent_recipient",
"entity_type": "party",
"canonical_name": "ops_team",
"confidence": 0.91
},
{
"id": "ent_subject",
"entity_type": "artifact",
"canonical_name": "deployment_is_complete",
"confidence": 0.87
}
],
"predicates": [
{
"id": "pred_notify",
"frame_type": "action",
"actor": "system",
"predicate": "NOTIFY",
"object": "ent_recipient",
"certainty": "requested"
}
],
"constraints": {
"temporal": [],
"logical": [],
"ambiguity": [],
"risk_flags": []
},
"output_preferences": {
"target_schema": "notification.simple",
"fidelity_mode": "semantic_lossless"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
},
"confidence": 0.9
},
"is_equivalent": true,
"fidelity_score": 1,
"trace": null
}Equivalence
Compare two IntentGraphs for semantic equivalence.
Request body
| Field | Type | Description |
|---|---|---|
| reference required | object | |
| candidate required | object | |
| strict optional | boolean default: false | Use deep-equal instead of scored similarity |
| overall_pass optional | number default: 0.95 | Overall pass threshold |
| category_floor optional | number default: 0.85 | Per-category minimum |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| is_equivalent required | boolean | |
| fidelity_score required | number | |
| details optional | object | null |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/equivalence \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reference":{"id":"intent_notification_deploy_complete","intent_type":"simple_notification","graph_version":"1.0.0","entities":[{"id":"ent_recipient","entity_type":"party","canonical_name":"ops_team","confidence":0.91},{"id":"ent_subject","entity_type":"artifact","canonical_name":"deployment_is_complete","confidence":0.87}],"predicates":[{"id":"pred_notify","frame_type":"action","actor":"system","predicate":"NOTIFY","object":"ent_recipient","certainty":"requested"}],"constraints":{"temporal":[],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"notification.simple","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"ingress_english","speaker":"user"},"confidence":0.9},"candidate":{"id":"intent_notification_deploy_complete","intent_type":"simple_notification","graph_version":"1.0.0","entities":[{"id":"ent_recipient","entity_type":"party","canonical_name":"ops_team","confidence":0.91},{"id":"ent_subject","entity_type":"artifact","canonical_name":"deployment_is_complete","confidence":0.87}],"predicates":[{"id":"pred_notify","frame_type":"action","actor":"system","predicate":"NOTIFY","object":"ent_recipient","certainty":"requested"}],"constraints":{"temporal":[],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"notification.simple","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"ingress_english","speaker":"user"},"confidence":0.9}}'{
"is_equivalent": true,
"fidelity_score": 1,
"details": null
}Ingress
Parse a structured directive into an IntentGraph. Optionally wraps the result in a full transport packet when `build_packet` is true. When `lm_fallback` is true and no template matches, a model-backed parser is used.
Request body
| Field | Type | Description |
|---|---|---|
| directive required | string | Structured directive string to parse into an IntentGraph |
| build_packet optional | boolean default: false | If true, return the full transport packet alongside the graph |
| render_strategy optional | string default: "ascii_compact" | Codec strategy when build_packet is true |
| lm_fallback optional | boolean default: false | If true, use model-backed parsing when no template matches (requires the server to be configured for it). |
| open_domain optional | boolean default: false | If true, attempt a best-effort parse for directive-like text that no template matches, returning a low-confidence graph instead of an unparsed result. |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| parsed required | boolean | |
| intent_graph optional | object | null | |
| packet optional | object | null | |
| family optional | string | null | |
| confidence optional | number | null | |
| ingress_source optional | string | null | Which parser produced the result (for example `template` or `lm`). |
| nearest_family optional | string | null | Closest family match when directive is not recognized |
| similarity optional | number | null | Similarity score to the nearest family when a directive is not recognized. |
| is_generic optional | boolean default: false | True when the result is a low-confidence best-effort parse. |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/ingress \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"directive":"Notify the ops team that the deployment is complete.","build_packet":false}'{
"parsed": true,
"intent_graph": {
"id": "intent_notification_deploy_complete",
"intent_type": "simple_notification",
"graph_version": "1.0.0",
"entities": [
{
"id": "ent_recipient",
"entity_type": "party",
"canonical_name": "ops_team",
"confidence": 0.91
},
{
"id": "ent_subject",
"entity_type": "artifact",
"canonical_name": "deployment_is_complete",
"confidence": 0.87
}
],
"predicates": [
{
"id": "pred_notify",
"frame_type": "action",
"actor": "system",
"predicate": "NOTIFY",
"object": "ent_recipient",
"certainty": "requested"
}
],
"constraints": {
"temporal": [],
"logical": [],
"ambiguity": [],
"risk_flags": []
},
"output_preferences": {
"target_schema": "notification.simple",
"fidelity_mode": "semantic_lossless"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
},
"confidence": 0.9
},
"family": "simple_notification",
"confidence": 0.9,
"ingress_source": "template",
"is_generic": false
}Render Calendar
Render an IntentGraph as a tool-facing calendar request JSON.
Request body
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | IntentGraph to render as calendar JSON |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| schema required | string | |
| intent_id required | string | |
| followup_target_entity optional | string | null | |
| scheduled_for optional | string | null | |
| precondition_predicate_ids optional | string[] |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/render/calendar \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intent_graph":{"id":"intent_244","intent_type":"conditional_request","graph_version":"1.0.0","entities":[{"id":"ent_vendor","entity_type":"party","canonical_name":"vendor","aliases":["supplier"],"confidence":0.96},{"id":"ent_legal","entity_type":"org_unit","canonical_name":"legal","attributes":{"role":"approver"},"confidence":0.94},{"id":"ent_procurement","entity_type":"org_unit","canonical_name":"procurement","confidence":0.93},{"id":"ent_draft","entity_type":"document","canonical_name":"draft","confidence":0.91}],"predicates":[{"id":"pred_legal_approve_draft","frame_type":"action","actor":"ent_legal","predicate":"APPROVE","object":"ent_draft","certainty":"asserted"},{"id":"pred_schedule_followup","frame_type":"action","actor":"system","predicate":"SCHEDULE_FOLLOWUP","object":"ent_vendor","certainty":"requested"}],"constraints":{"temporal":[{"kind":"scheduled_for","value":"NEXT_TUESDAY","target":"pred_schedule_followup"}],"logical":[{"kind":"must_all_hold_before","target":"pred_schedule_followup","members":["pred_legal_approve_draft"]}],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"calendar.request","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"msg_12","speaker":"user"},"confidence":0.92}}'{
"schema": "calendar.request",
"intent_id": "intent_244",
"followup_target_entity": "vendor",
"scheduled_for": "NEXT_TUESDAY",
"precondition_predicate_ids": [
"pred_legal_approve_draft"
]
}Render Reminder
Render an IntentGraph as a tool-facing reminder request JSON.
Request body
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | IntentGraph to render as reminder JSON |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| schema required | string | |
| intent_id required | string | |
| reminder_target_entity optional | string | null | |
| reminder_topic optional | string | null | |
| deadline_by optional | string | null |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/render/reminder \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intent_graph":{"id":"intent_example_reminder","intent_type":"reminder_request","graph_version":"1.0.0","entities":[{"id":"ent_task_topic","entity_type":"artifact","canonical_name":"submit_the_quarterly_report","confidence":0.88},{"id":"ent_team","entity_type":"party","canonical_name":"team","confidence":0.9}],"predicates":[{"id":"pred_remind","frame_type":"action","actor":"system","predicate":"REMIND","object":"ent_team","certainty":"requested"}],"constraints":{"temporal":[{"kind":"deadline_by","target":"pred_remind","value":"FRIDAY"}],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"task.reminder","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"example_reminder","speaker":"user"},"confidence":0.91}}'{
"schema": "task.reminder",
"intent_id": "intent_example_reminder",
"reminder_target_entity": "team",
"reminder_topic": "submit_the_quarterly_report",
"deadline_by": "FRIDAY"
}Packet Build
Build a full transport packet from an IntentGraph. Optionally accepts a session block from a negotiated contract to embed session metadata and codec parameters.
Request body
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | IntentGraph to encode |
| render_strategy optional | string default: "ascii_compact" | |
| payload_mode optional | string default: "semantic_transport" | |
| fidelity_class optional | string default: "semantic_lossless" | |
| session optional | object | null | Session block from a negotiated contract. |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| packet required | object |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/packet/build \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intent_graph":{"id":"intent_notification_deploy_complete","intent_type":"simple_notification","graph_version":"1.0.0","entities":[{"id":"ent_recipient","entity_type":"party","canonical_name":"ops_team","confidence":0.91},{"id":"ent_subject","entity_type":"artifact","canonical_name":"deployment_is_complete","confidence":0.87}],"predicates":[{"id":"pred_notify","frame_type":"action","actor":"system","predicate":"NOTIFY","object":"ent_recipient","certainty":"requested"}],"constraints":{"temporal":[],"logical":[],"ambiguity":[],"risk_flags":[]},"output_preferences":{"target_schema":"notification.simple","fidelity_mode":"semantic_lossless"},"provenance":{"source_message_id":"ingress_english","speaker":"user"},"confidence":0.9},"render_strategy":"ascii_compact","payload_mode":"semantic_transport"}'{
"packet": {
"packet_version": "1.0.0",
"ir_version": "1.0.0",
"codec_name": "lexicor-line",
"codec_version": "v1",
"render_strategy": "ascii_compact",
"symbol_table_version": "core-sym-1",
"payload": "lx1|<opaque-compact-payload>|core-sym-1",
"payload_mode": "semantic_transport",
"fidelity_class": "semantic_lossless",
"trust": {
"verified": true
},
"checks": {
"roundtrip": "pass"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
}
}
}Packet Decode
Decode a transport packet back to an IntentGraph. Enforces fail-closed session validation: packets with a ``session`` block are checked against the active sessions for the calling tenant.
Request body
| Field | Type | Description |
|---|---|---|
| packet required | object | Transport packet to decode |
Responses
200 — Successful Response
| Field | Type | Description |
|---|---|---|
| intent_graph required | object | |
| session optional | object | null |
422 — Validation Error
| Field | Type | Description |
|---|---|---|
| detail optional | ValidationError[] |
curl -X POST https://api.lexicor.dev/v1/packet/decode \
-H "X-API-Key: $LEXICOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"packet":{"packet_version":"1.0.0","ir_version":"1.0.0","codec_name":"lexicor-line","codec_version":"v1","render_strategy":"ascii_compact","symbol_table_version":"core-sym-1","payload":"lx1|<opaque-compact-payload>|core-sym-1","payload_mode":"semantic_transport","fidelity_class":"semantic_lossless","trust":{"verified":true},"checks":{"roundtrip":"pass"},"provenance":{"source_message_id":"ingress_english","speaker":"user"}}}'{
"intent_graph": {
"id": "intent_notification_deploy_complete",
"intent_type": "simple_notification",
"graph_version": "1.0.0",
"entities": [
{
"id": "ent_recipient",
"entity_type": "party",
"canonical_name": "ops_team",
"confidence": 0.91
},
{
"id": "ent_subject",
"entity_type": "artifact",
"canonical_name": "deployment_is_complete",
"confidence": 0.87
}
],
"predicates": [
{
"id": "pred_notify",
"frame_type": "action",
"actor": "system",
"predicate": "NOTIFY",
"object": "ent_recipient",
"certainty": "requested"
}
],
"constraints": {
"temporal": [],
"logical": [],
"ambiguity": [],
"risk_flags": []
},
"output_preferences": {
"target_schema": "notification.simple",
"fidelity_mode": "semantic_lossless"
},
"provenance": {
"source_message_id": "ingress_english",
"speaker": "user"
},
"confidence": 0.9
}
}