Skip to main content

Domain Knowledge API

Domain Knowledge exposes a REST surface for concepts, semantic layer, ontology, and AI suggestion review.

For the functional product view, journeys, and positioning, see Domain Knowledge.

Authentication and Scope

  • all routes require JWT;
  • the effective scope is always the authenticated token company;
  • team is not the primary knowledge partition today.

Permissions

  • concepts:list/get/create/update/delete
  • semantic:list/create/update/delete
  • ontology:list/create/update/delete
  • knowledge_reviews:list
  • knowledge_reviews:generate
  • knowledge_reviews:review

Resource Shapes

Concept

  • name
  • description
  • status: draft | active | archived
  • type: term | rule | entity_hint | metric_hint | policy_hint
  • aliases[]
  • tags[]
  • source
  • confidence
  • related_catalog_assets[]

Semantic Item

  • kind: entity | metric | dimension | mapping
  • name
  • description
  • status
  • formula
  • grain
  • filters[]
  • aggregation
  • mapped_tables[]
  • mapped_columns[]
  • mapped_relations[]
  • source_concept_ids[]
  • depends_on_concepts[]
  • depends_on_metrics[]
  • depends_on_entities[]
  • validation_errors[]

Ontology Node

  • name
  • description
  • node_type: class | role | event | object | state
  • status
  • parent_node_id
  • aliases[]
  • attributes[]
  • constraints[]
  • source_concepts[]
  • mapped_semantic_entities[]
  • mapped_catalog_assets[]

Ontology Relation

  • subject_node_id
  • predicate
  • object_node_id
  • description
  • cardinality
  • relation_type
  • confidence
  • evidence[]
  • status

Suggestion

  • target_type
  • target_id
  • target_name
  • concept_id
  • concept_name
  • suggested_payload
  • explanation
  • evidence[]
  • confidence
  • model
  • prompt_version
  • status
  • request_id
  • job_id
  • review_note

Current status values:

  • pending
  • accepted
  • rejected
  • superseded

Job

  • target_type: concept | semantic | ontology_node | ontology_relation
  • target_ids[]
  • status: queued | running | succeeded | failed | cancelled
  • processed_count
  • total_count
  • last_error
  • request_id

Endpoints

Concepts

MethodEndpointDescription
GET/api/v1/domain-knowledge/conceptsList concepts with pagination and filters
GET/api/v1/domain-knowledge/concepts/:idFetch one concept
POST/api/v1/domain-knowledge/conceptsCreate concept
PATCH/api/v1/domain-knowledge/concepts/:idUpdate concept
DELETE/api/v1/domain-knowledge/concepts/:idArchive concept

Supported query params:

  • page
  • per_page
  • search
  • status
  • type

Suggestions

MethodEndpointDescription
GET/api/v1/domain-knowledge/suggestionsList pending suggestions
POST/api/v1/domain-knowledge/suggestions/concepts/:id/generateGenerate concept suggestion
POST/api/v1/domain-knowledge/suggestions/concepts/:id/promote-semanticSuggest promotion to semantic layer
POST/api/v1/domain-knowledge/suggestions/concepts/:id/promote-ontologySuggest promotion to ontology
POST/api/v1/domain-knowledge/suggestions/semantic/:id/generateGenerate semantic suggestion
POST/api/v1/domain-knowledge/suggestions/ontology/nodes/:id/generateGenerate node suggestion
POST/api/v1/domain-knowledge/suggestions/ontology/relations/:id/generateGenerate relation suggestion
POST/api/v1/domain-knowledge/suggestions/:id/acceptAccept suggestion
POST/api/v1/domain-knowledge/suggestions/:id/rejectReject suggestion

Current target_type values:

  • concept
  • semantic
  • semantic_create
  • ontology_node
  • ontology_node_create
  • ontology_relation

Semantic Layer

MethodEndpointDescription
GET/api/v1/domain-knowledge/semanticList semantic items
POST/api/v1/domain-knowledge/semanticCreate semantic item
PATCH/api/v1/domain-knowledge/semantic/:idUpdate semantic item
DELETE/api/v1/domain-knowledge/semantic/:idArchive semantic item

Ontology

MethodEndpointDescription
GET/api/v1/domain-knowledge/ontology/nodesList nodes
POST/api/v1/domain-knowledge/ontology/nodesCreate node
PATCH/api/v1/domain-knowledge/ontology/nodes/:idUpdate node
DELETE/api/v1/domain-knowledge/ontology/nodes/:idArchive node
GET/api/v1/domain-knowledge/ontology/relationsList relations
POST/api/v1/domain-knowledge/ontology/relationsCreate relation
PATCH/api/v1/domain-knowledge/ontology/relations/:idUpdate relation
DELETE/api/v1/domain-knowledge/ontology/relations/:idArchive relation

Jobs

MethodEndpointDescription
GET/api/v1/domain-knowledge/jobsList enrichment jobs
GET/api/v1/domain-knowledge/jobs/:idGet job status
POST/api/v1/domain-knowledge/jobs/enrichCreate async enrichment job

Validation Rules

  • name and description are required when creating the main resources
  • description accepts up to 4096 characters
  • aliases[], tags[], related_catalog_assets[], and source_concept_ids[] have a maximum of 20 items
  • create status accepts draft or active
  • predicate is required for ontology relations
  • entity, metric, and dimension require at least one source_concept_id
  • jobs require at least one target_id
AI configuration

Suggestion generation routes return 503 when OPENROUTER_API_KEY is not configured.

Examples

Create a concept:

curl -X POST https://api.console.solucao42.com.br/api/v1/domain-knowledge/concepts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Net revenue",
"description": "Revenue after discounts and refunds",
"status": "active",
"type": "metric_hint",
"aliases": ["net sales"],
"tags": ["finance"]
}'

Reject a suggestion:

curl -X POST https://api.console.solucao42.com.br/api/v1/domain-knowledge/suggestions/SUGGESTION_ID/reject \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"review_note": "This does not reflect the company official rule"
}'