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 |
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[]confidenceprompt_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/bulk-accept | Accept multiple visible suggestions in one request |
| POST | /api/v1/domain-knowledge/suggestions/:id/reject | Reject suggestion |
POST /api/v1/domain-knowledge/suggestions/:id/accept now accepts optional override_payload for concept review flows, allowing the reviewer to adjust fields before approval.
Current target_type values:
conceptconcept_createsemanticsemantic_createontology_nodeontology_node_createontology_relationontology_relation_create
concept_create representa uma sugestao pendente para criar um novo conceito draft apos revisao humana.
ontology_relation_create representa uma sugestao pendente para criar uma nova relacao de ontologia; ela pode depender de nos sugeridos e ainda nao aceitos.
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 |
Concept Generation
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/concepts/generation/prerequisites | Read generation prerequisites, business domains and accepted file types |
| POST | /api/v1/domain-knowledge/concepts/generation/jobs | Create async concept generation job from business domains, optional text and optional file |
| GET | /api/v1/domain-knowledge/concepts/generation/jobs/:id | Poll async concept generation job status |
Concept generation may run in multiple internal batches until the useful context is exhausted or a technical stop condition is reached; it is not limited to a fixed public cap of 10 concepts per execution.
Generation jobs send the current active and draft concepts as existing context to the model. The model must classify each candidate as either enrichment of an existing concept or creation of a new one. When a job succeeds with at least one valid suggestion, its batch replaces the previous pending batch-generated concept and concept_create suggestions for the same company. If the job finishes with zero valid suggestions or fails, the previous pending batch remains unchanged.
Ontology Generation
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/domain-knowledge/ontology/generation/prerequisites | Read ontology generation prerequisites, eligible synced connections and entity_hint concept count |
| POST | /api/v1/domain-knowledge/ontology/generation/jobs | Create async ontology generation job from all entity_hint concepts and one selected connection |
| GET | /api/v1/domain-knowledge/ontology/generation/jobs/:id | Poll async ontology generation job status |
Ontology generation uses all company concepts with type = entity_hint plus the full tabular catalog of one selected synced connection. The job creates only pending suggestions for ontology nodes and relations, including ontology_relation_create when a new edge must be reviewed before publication.
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 - concept generation requires at least one configured
business_domain - concept generation accepts at most one file per job
- accepted file extensions for concept generation:
.docx,.xlsx,.csv,.tsv,.txt,.md - ontology generation requires at least one
entity_hintconcept - ontology generation requires one eligible synced connection with tabular metadata
ontology_relation_createcan only be accepted after its dependentontology_node_createsuggestions have been accepted
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 |
| Concept generation API | Available |
| Ontology generation 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 |