Kubiya LogoKubiya Developer Docs

Knowledge API

API endpoints for managing knowledge entries in the Kubiya platform

Knowledge API

The Knowledge API allows you to create, retrieve, update, and delete knowledge entries in the Kubiya platform. Knowledge entries provide contextual information that can be used by teammates and tools to improve their performance.

This playground makes API calls to Kubiya API through a secure server-side proxy. Your requests never expose your API token directly to the browser.

List all knowledge entries

GET
Authentication
Enter your Kubiya API key only. The "UserKey" prefix will be added automatically.

Create a knowledge entry

POST
Authentication
Enter your Kubiya API key only. The "UserKey" prefix will be added automatically.

List Knowledge Entries

Retrieve a list of all knowledge entries in your organization.

GET /v1/knowledge

Query Parameters

NameTypeRequiredDescription
tagstringNoFilter by tag
limitintegerNoMaximum number of entries to return (default: 50)
pageintegerNoPage number for pagination

Headers

NameRequiredDescription
AuthorizationYesUserKey YOUR_API_KEY
Content-TypeNoapplication/json

Response

{
  "entries": [
    {
      "id": "knowledge-123456",
      "title": "AWS Security Best Practices",
      "content": "This document outlines AWS security best practices...",
      "tags": ["aws", "security", "cloud"],
      "created_at": "2023-01-01T00:00:00Z",
      "updated_at": "2023-01-02T00:00:00Z",
      "created_by": "user@example.com",
      "visibility": "organization"
    }
  ],
  "pagination": {
    "total": 24,
    "page": 1,
    "pages": 1,
    "limit": 50
  }
}

Create Knowledge Entry

Create a new knowledge entry in your organization.

POST /v1/knowledge

Headers

NameRequiredDescription
AuthorizationYesUserKey YOUR_API_KEY
Content-TypeYesapplication/json

Request Body

{
  "title": "AWS Security Best Practices",
  "content": "This document outlines AWS security best practices...",
  "tags": ["aws", "security", "cloud"],
  "visibility": "organization"
}

Required Fields

  • title: Title of the knowledge entry
  • content: Markdown content of the knowledge entry

Response

{
  "id": "knowledge-123456",
  "title": "AWS Security Best Practices",
  "content": "This document outlines AWS security best practices...",
  "tags": ["aws", "security", "cloud"],
  "created_at": "2023-01-01T00:00:00Z",
  "updated_at": "2023-01-01T00:00:00Z",
  "created_by": "user@example.com",
  "visibility": "organization"
}

Get Knowledge Entry

Retrieve a specific knowledge entry by ID.

GET /v1/knowledge/{entry_id}

Path Parameters

NameTypeRequiredDescription
entry_idstringYesID of the knowledge entry to retrieve

Headers

NameRequiredDescription
AuthorizationYesUserKey YOUR_API_KEY
Content-TypeNoapplication/json

Response

{
  "id": "knowledge-123456",
  "title": "AWS Security Best Practices",
  "content": "This document outlines AWS security best practices...",
  "tags": ["aws", "security", "cloud"],
  "created_at": "2023-01-01T00:00:00Z",
  "updated_at": "2023-01-02T00:00:00Z",
  "created_by": "user@example.com",
  "visibility": "organization",
  "version": 2,
  "versions": [
    {
      "version": 1,
      "updated_at": "2023-01-01T00:00:00Z",
      "updated_by": "user@example.com"
    },
    {
      "version": 2,
      "updated_at": "2023-01-02T00:00:00Z",
      "updated_by": "user@example.com"
    }
  ]
}

Update Knowledge Entry

Update an existing knowledge entry.

PUT /v1/knowledge/{entry_id}

Path Parameters

NameTypeRequiredDescription
entry_idstringYesID of the knowledge entry to update

Headers

NameRequiredDescription
AuthorizationYesUserKey YOUR_API_KEY
Content-TypeYesapplication/json

Request Body

{
  "title": "Updated AWS Security Best Practices",
  "content": "This updated document outlines AWS security best practices...",
  "tags": ["aws", "security", "cloud", "best-practices"],
  "visibility": "organization"
}

Response

{
  "id": "knowledge-123456",
  "title": "Updated AWS Security Best Practices",
  "content": "This updated document outlines AWS security best practices...",
  "tags": ["aws", "security", "cloud", "best-practices"],
  "created_at": "2023-01-01T00:00:00Z",
  "updated_at": "2023-01-03T00:00:00Z",
  "created_by": "user@example.com",
  "visibility": "organization",
  "version": 3
}

Delete Knowledge Entry

Delete a knowledge entry.

DELETE /v1/knowledge/{entry_id}

Path Parameters

NameTypeRequiredDescription
entry_idstringYesID of the knowledge entry to delete

Headers

NameRequiredDescription
AuthorizationYesUserKey YOUR_API_KEY

Response

A successful delete operation returns an HTTP 200 status with no response body.

Search Knowledge

Search for knowledge entries based on keywords or tags.

GET /v1/knowledge/search?q={query}

Query Parameters

NameTypeRequiredDescription
qstringYesSearch query
tagsarrayNoFilter by tags (comma-separated)
limitintegerNoMaximum number of entries to return (default: 10)

Headers

NameRequiredDescription
AuthorizationYesUserKey YOUR_API_KEY
Content-TypeNoapplication/json

Response

{
  "entries": [
    {
      "id": "knowledge-123456",
      "title": "AWS Security Best Practices",
      "content": "This document outlines AWS security best practices...",
      "tags": ["aws", "security", "cloud"],
      "created_at": "2023-01-01T00:00:00Z",
      "updated_at": "2023-01-02T00:00:00Z",
      "created_by": "user@example.com",
      "visibility": "organization",
      "relevance": 0.92
    }
  ],
  "total": 3
}

Example Usage

List Knowledge Entries

curl -X GET "https://api.kubiya.ai/v1/knowledge" \
  -H "Authorization: UserKey YOUR_API_KEY" \
  -H "Content-Type: application/json"

Create a Knowledge Entry

curl -X POST "https://api.kubiya.ai/v1/knowledge" \
  -H "Authorization: UserKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Kubernetes Deployment Guide",
    "content": "# Kubernetes Deployment Guide\n\nThis guide outlines the process for deploying applications to Kubernetes...",
    "tags": ["kubernetes", "deployment", "k8s"],
    "visibility": "organization"
  }'

Get Knowledge Entry

curl -X GET "https://api.kubiya.ai/v1/knowledge/knowledge-123456" \
  -H "Authorization: UserKey YOUR_API_KEY" \
  -H "Content-Type: application/json"

Update Knowledge Entry

curl -X PUT "https://api.kubiya.ai/v1/knowledge/knowledge-123456" \
  -H "Authorization: UserKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Kubernetes Deployment Guide",
    "content": "# Updated Kubernetes Deployment Guide\n\nThis updated guide outlines the process for deploying applications to Kubernetes...",
    "tags": ["kubernetes", "deployment", "k8s", "guide"],
    "visibility": "organization"
  }'

Delete Knowledge Entry

curl -X DELETE "https://api.kubiya.ai/v1/knowledge/knowledge-123456" \
  -H "Authorization: UserKey YOUR_API_KEY"

Search Knowledge

curl -X GET "https://api.kubiya.ai/v1/knowledge/search?q=kubernetes&tags=deployment" \
  -H "Authorization: UserKey YOUR_API_KEY" \
  -H "Content-Type: application/json"

Knowledge Visibility

Knowledge entries can have different visibility levels:

VisibilityDescription
privateOnly visible to the creator
teamVisible to specific teams
organizationVisible to the entire organization
publicVisible to all users of the platform

Versioning

Knowledge entries are versioned. Each update creates a new version, and you can view the version history of an entry.

Common Errors

HTTP StatusDescription
400Bad Request - Missing required fields in request
401Unauthorized - Missing or invalid authentication credentials
403Forbidden - User doesn't have permission for this operation
404Not Found - Knowledge entry not found
500Internal Server Error - Unexpected server error