PUT
/
v2
/
knowledge-items
/
:id
/
public
const axios = require('axios');

const itemId = 'a7f9c3e2-4d8b-4c6a-9d2b-1b0f2e9d4d67'; // Replace with your item ID
const url = `https://api-prod.usefini.com/v2/knowledge-items/${itemId}/public`;
const token = 'your_api_key_here'; // Replace with your actual API key

const headers = {
  'authorization': `Bearer ${token}`,
  'Content-Type': 'application/json'
};

const data = {
  botIds: ['e93ab1f2-7c4e-4a21-a1d6-2b7c5c9d3e10'],
  status: 'LIVE',
  question: 'Updated question',
  answer: 'Updated answer',
  instruction: 'Review this item weekly',
  similarQs: ['Updated similar question'],
  keywords: ['updated keyword'],
  categories: ['Updated Category'],
  subcategories: ['Updated Subcategory'],
  escalation: true
};

axios.put(url, data, { headers })
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
{
 "id": "a7f9c3e2-4d8b-4c6a-9d2b-1b0f2e9d4d67",
  "companyId": "f3a6d980-123e-49b2-bf2d-9b11a5d3cd24",
  "userId": "5e2c7f1d-0b42-4e3e-82b4-3a76b1cb25f1",
  "createdAt": "2025-04-08T13:48:22.917514+00:00",
  "updatedAt": "2025-04-17T21:12:10.000000+00:00",
  "knowledgeNumber": 240,
  "status": "LIVE",
  "answer": "Updated answer",
  "question": "Updated question",
  "similarQs": ["Updated similar question"],
  "keywords": ["updated keyword"],
  "categories": ["Updated Category"],
  "subcategories": ["Updated Subcategory"],
  "escalation": true,
  "updatedBy": "72fb4eea-207d-43ae-9b4c-274eac4e57d6",
  "instruction": "Review this item weekly"
}

Headers

Authorization
string
required

API key for authentication. Format: Bearer your_api_key_here.

Path Parameters

id
string
required

The unique ID of the knowledge item to be updated.

Body Parameters

botIds
array[string]
required

List of bot IDs that this knowledge item is associated with.

status
string
required

Status of the item. Valid values: LIVE, IN_REVIEW, DRAFT.

question
string
required

Updated question for this knowledge item

answer
string
required

Updated answer for this knowledge item

instruction
string
required

AI agent Instructions associated with the item

similarQs
array[string]
required

List of similar questions to the main question.

keywords
array[string]
required

List of keywords to help with search and categorization.

categories
array[string]
required

Categories under which the item is grouped.

subcategories
array[string]
required

Subcategories under which the item is grouped.

escalation
boolean
required

Whether this item is marked for escalation.

Response

id
string

Unique ID of the updated knowledge item.

companyId
string

ID of the company that owns the knowledge item.

userId
string

ID of the user who updated the knowledge item.

createdAt
string

Timestamp of when the item was originally created.

updatedAt
string

Timestamp of the last update to the item.

knowledgeNumber
integer

Auto-generated knowledge number.

status
string

Status of the item: LIVE, IN_REVIEW, or DRAFT.

answer
string

The updated answer text.

question
string

The updated question text.

similarQs
array[string]

Updated list of similar questions.

keywords
array[string]

Updated keywords associated with the knowledge item.

categories
array[string]

Updated categories under which the item is grouped.

subcategories
array[string]

Updated subcategories under which the item is grouped.

escalation
boolean

Whether the item is marked for escalation.

updatedBy
string

ID of the user who last updated the item.

instruction
string

Updated instruction associated with the item.