Workspace API

Baza wiedzy

Endpointy „Baza wiedzy” Zanfia Workspace API — ze schematami i przykładami kodu.

4 min czytaniaOstatnia aktualizacja: 26 lip 2026

Zawartość produktów typu Baza wiedzy, adresowana przez id produktu: artykuły i drzewo kategorii. Zapisy utrwalają opublikowane pola i czyszczą ewentualny szkic z panelu; artykuł i drzewo kategorii aktualizowane są w jednym atomowym zapisie. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.

Przegląd bazy wiedzy

GET/products/{productId}/kb

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Response Body

application/json

application/json

curl -X GET "https://example.com/products/string/kb"
{  "knowledgeBaseId": "string",  "name": "string",  "categoriesTree": [    {      "title": "string",      "key": "string",      "type": "string",      "children": [        {}      ],      "isLeaf": true,      "status": "string",      "oldCategoryName": "string"    }  ],  "articles": [    {      "id": "string",      "title": "string",      "status": "draft",      "parentId": "string",      "updatedAt": "string",      "hasUnpublishedDraft": true    }  ]}
{  "error": "string"}

Pobierz artykuł

GET/products/{productId}/kb/articles/{articleId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

articleId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/products/string/kb/articles/string"
{  "id": "string",  "title": "string",  "status": "draft",  "editorContent": "string",  "parentId": "string",  "category": "string",  "attachments": [    {      "url": "string",      "name": "string",      "uid": "string"    }  ],  "images": [    "string"  ],  "createdAt": "string",  "updatedAt": "string",  "hasUnpublishedDraft": true}
{  "error": "string"}

Aktualizuj artykuł

PATCH/products/{productId}/kb/articles/{articleId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

articleId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Patch of the article's CANONICAL fields — at least one field required. A server write is a committed edit: it also clears the dashboard editor's unpublished draft* mirror for this article (publish semantics), and it rebuilds the KB's categoriesTree atomically in the same write.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/products/string/kb/articles/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "articleId": "string",  "updated": true}
{  "error": "string"}

Usuń artykuł

DELETE/products/{productId}/kb/articles/{articleId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

articleId*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/products/string/kb/articles/string"
{  "articleId": "string",  "deleted": true}
{  "error": "string"}

Utwórz artykuł

POST/products/{productId}/kb/articles

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/kb/articles" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "parentId": "string"  }'
{  "articleId": "string"}
{  "error": "string"}

Dodaj kategorię

POST/products/{productId}/kb/categories

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/kb/categories" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "categoryId": "string"}
{  "error": "string"}

Zmień nazwę kategorii

PATCH/products/{productId}/kb/categories/{categoryId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

categoryId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/products/string/kb/categories/string" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "categoryId": "string",  "updated": true}
{  "error": "string"}

Usuń kategorię

DELETE/products/{productId}/kb/categories/{categoryId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

categoryId*string

Query Parameters

deleteArticles?boolean

Response Body

application/json

application/json

curl -X DELETE "https://example.com/products/string/kb/categories/string"
{  "categoryId": "string",  "deleted": true,  "deletedArticleIds": [    "string"  ]}
{  "error": "string"}

Czy ten artykuł był pomocny?

Powiązane artykuły

Coś się nie zgadza? Napisz do nas na support@zanfia.com.