Skip to main content
SONZAI
Api

Knowledge Org

Promote a project-scoped node to the organization-global scope

POST
/projects/{projectId}/knowledge/nodes/{nodeId}/promote-to-org

Path Parameters

projectId*string

Project UUID that currently owns the node

nodeId*string

Node UUID to promote

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

tenant_id*string

Target tenant; server rejects if it does not match the authenticated tenant.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/knowledge/nodes/string/promote-to-org" \  -H "Content-Type: application/json" \  -d '{    "tenant_id": "string"  }'
{
  "$schema": "/api/v1/schemas/KBNodeWithScope.json",
  "confidence": 0.1,
  "created_at": "2019-08-24T14:15:22Z",
  "is_active": true,
  "label": "string",
  "node_id": "string",
  "node_type": "string",
  "norm_label": "string",
  "project_id": "string",
  "properties": {
    "property1": null,
    "property2": null
  },
  "property_sources": {
    "property1": {
      "doc_id": "string",
      "eff_date": "2019-08-24T14:15:22Z"
    },
    "property2": {
      "doc_id": "string",
      "eff_date": "2019-08-24T14:15:22Z"
    }
  },
  "relevance": 0.1,
  "scope_id": "string",
  "scope_type": "string",
  "source_docs": [
    "string"
  ],
  "source_type": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "version": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List nodes in the organization-global KB scope

GET
/tenants/{tenantId}/knowledge/org-nodes

Path Parameters

tenantId*string

Tenant UUID whose organization-global KB scope is listed.

Query Parameters

limit?integer

Max number of nodes to return; 0 = all rows in the partition.

Default200
Formatint64
Range0 <= value <= 2000

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/tenants/string/knowledge/org-nodes"
{
  "$schema": "/api/v1/schemas/KbListOrgNodesOutputBody.json",
  "nodes": [
    {
      "$schema": "/api/v1/schemas/KBNode.json",
      "confidence": 0.1,
      "created_at": "2019-08-24T14:15:22Z",
      "is_active": true,
      "label": "string",
      "node_id": "string",
      "node_type": "string",
      "norm_label": "string",
      "project_id": "string",
      "properties": {
        "property1": null,
        "property2": null
      },
      "property_sources": {
        "property1": {
          "doc_id": "string",
          "eff_date": "2019-08-24T14:15:22Z"
        },
        "property2": {
          "doc_id": "string",
          "eff_date": "2019-08-24T14:15:22Z"
        }
      },
      "scope_id": "string",
      "source_docs": [
        "string"
      ],
      "source_type": "string",
      "tenant_id": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "version": 0
    }
  ],
  "total": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Create a knowledge-base node in the organization-global scope

POST
/tenants/{tenantId}/knowledge/org-nodes

Path Parameters

tenantId*string

Tenant UUID — scope_id for the write is the empty string so the node lives in the organization-global scope.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/tenants/string/knowledge/org-nodes" \  -H "Content-Type: application/json" \  -d '{    "label": "string",    "node_type": "string"  }'
{
  "$schema": "/api/v1/schemas/KBNode.json",
  "confidence": 0.1,
  "created_at": "2019-08-24T14:15:22Z",
  "is_active": true,
  "label": "string",
  "node_id": "string",
  "node_type": "string",
  "norm_label": "string",
  "project_id": "string",
  "properties": {
    "property1": null,
    "property2": null
  },
  "property_sources": {
    "property1": {
      "doc_id": "string",
      "eff_date": "2019-08-24T14:15:22Z"
    },
    "property2": {
      "doc_id": "string",
      "eff_date": "2019-08-24T14:15:22Z"
    }
  },
  "scope_id": "string",
  "source_docs": [
    "string"
  ],
  "source_type": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "version": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}