API de Conhecimento de Dominio
Conhecimento de Dominio expoe uma superficie REST para conceitos, camada semantica, ontologia e revisao de sugestoes de IA.
Para a visao funcional do modulo, jornadas e posicionamento no produto, veja Conhecimento de Dominio.
Authentication and Scope
- todas as rotas exigem JWT;
- o escopo efetivo e sempre a
companydo token autenticado; teamnao e a particao primaria do conhecimento hoje.
Permissions
| Action | Description |
|---|---|
concepts:list/get/create/update/delete | Concept operations |
semantic:list/create/update/delete | Semantic layer operations |
ontology:list/create/update/delete | Ontology operations |
knowledge_reviews:list | List pending suggestions |
knowledge_reviews:generate | Generate AI suggestions |
knowledge_reviews:review | Accept or reject suggestions |
Important rule
Accepting a suggestion requires knowledge_reviews:review and also the target resource create or update permission.
Resource Shapes
Concept
namedescriptionstatus:draft | active | archivedtype:term | rule | entity_hint | metric_hint | policy_hintaliases[]tags[]sourceconfidencerelated_catalog_assets[]
Semantic Item
kind:entity | metric | dimension | mappingnamedescriptionstatusformulagrainfilters[]aggregationmapped_tables[]mapped_columns[]mapped_relations[]source_concept_ids[]depends_on_concepts[]depends_on_metrics[]depends_on_entities[]validation_errors[]
Ontology Node
namedescriptionnode_type:class | role | event | object | statestatusparent_node_idaliases[]attributes[]constraints[]source_concepts[]mapped_semantic_entities[]mapped_catalog_assets[]
Ontology Relation
subject_node_idpredicateobject_node_iddescriptioncardinalityrelation_typeconfidenceevidence[]status
Suggestion
target_typetarget_idtarget_nameconcept_idconcept_namesuggested_payloadexplanationevidence[]confidencemodelprompt_versionstatusrequest_idjob_idreview_note
Current status values:
pendingacceptedrejectedsuperseded
Job
target_type:concept | semantic | ontology_node | ontology_relationtarget_ids[]status:queued | running | succeeded | failed | cancelledprocessed_counttotal_countlast_errorrequest_id
Endpoints
Concepts
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/concepts | List concepts with pagination and filters |
| GET | /api/v1/domain-knowledge/concepts/:id | Fetch one concept |
| POST | /api/v1/domain-knowledge/concepts | Create concept |
| PATCH | /api/v1/domain-knowledge/concepts/:id | Update concept |
| DELETE | /api/v1/domain-knowledge/concepts/:id | Archive concept |
Query params currently supported:
pageper_pagesearchstatustype
Suggestions
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/suggestions | List pending suggestions |
| POST | /api/v1/domain-knowledge/suggestions/concepts/:id/generate | Generate concept suggestion |
| POST | /api/v1/domain-knowledge/suggestions/concepts/:id/promote-semantic | Suggest promotion to semantic layer |
| POST | /api/v1/domain-knowledge/suggestions/concepts/:id/promote-ontology | Suggest promotion to ontology |
| POST | /api/v1/domain-knowledge/suggestions/semantic/:id/generate | Generate semantic suggestion |
| POST | /api/v1/domain-knowledge/suggestions/ontology/nodes/:id/generate | Generate node suggestion |
| POST | /api/v1/domain-knowledge/suggestions/ontology/relations/:id/generate | Generate relation suggestion |
| POST | /api/v1/domain-knowledge/suggestions/:id/accept | Accept suggestion |
| POST | /api/v1/domain-knowledge/suggestions/:id/reject | Reject suggestion |
Current target_type values:
conceptsemanticsemantic_createontology_nodeontology_node_createontology_relation
Semantic Layer
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/semantic | List semantic items |
| POST | /api/v1/domain-knowledge/semantic | Create semantic item |
| PATCH | /api/v1/domain-knowledge/semantic/:id | Update semantic item |
| DELETE | /api/v1/domain-knowledge/semantic/:id | Archive semantic item |
Ontology
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/ontology/nodes | List nodes |
| POST | /api/v1/domain-knowledge/ontology/nodes | Create node |
| PATCH | /api/v1/domain-knowledge/ontology/nodes/:id | Update node |
| DELETE | /api/v1/domain-knowledge/ontology/nodes/:id | Archive node |
| GET | /api/v1/domain-knowledge/ontology/relations | List relations |
| POST | /api/v1/domain-knowledge/ontology/relations | Create relation |
| PATCH | /api/v1/domain-knowledge/ontology/relations/:id | Update relation |
| DELETE | /api/v1/domain-knowledge/ontology/relations/:id | Archive relation |
Jobs
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/jobs | List enrichment jobs |
| GET | /api/v1/domain-knowledge/jobs/:id | Get job status |
| POST | /api/v1/domain-knowledge/jobs/enrich | Create async enrichment job |
Validation Rules
nameanddescriptionare required when creating the main resourcesdescriptionaccepts up to4096charactersaliases[],tags[],related_catalog_assets[], andsource_concept_ids[]have a maximum of20items- create
statusacceptsdraftoractive predicateis required for ontology relationsentity,metric, anddimensionrequire at least onesource_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"
}'
Status
| Topic | Status |
|---|---|
| Concepts API | Available |
| Semantic API | Available |
| Ontology API | Available |
| Suggestion review API | Available |
| Async enrichment jobs | Planned |
| More advanced semantic fields | Planned |
| Formal ontology relation types | Planned |