Skip to content

Update Knowledge Source ​

PUThttps://api.repliz.com/public/knowledge/{knowledgeId}/source/{sourceId}

Rename a source, or change the text of a text source or the questions and answers of a faq source. A new text or faqs is read again, so the source goes back to process. Fields that are left out keep their value. A source that is still in process can't be changed.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Repliz
  • Scope (Bearer only): knowledge:write
  • Access Tier: Standard+

Parameters ​

ParameterTypeRequiredDescription
knowledgeIdstringYesID of the knowledge, the _id from Get Knowledge.
sourceIdstringYesID of the source, the _id of an item in sources from Get One Knowledge.

Request Body ​

FieldTypeRequiredDescription
namestringNoNew name of the source, cut to 60 characters.
textstringNoNew text of a text source, up to 200,000 characters. Ignored for other types.
faqsarrayNoEvery question and answer of a faq source, 1 to 300 pairs, replacing the current ones. Ignored for other types.

To change the page of a url source, read it again with Refresh Knowledge Source. To change a file, remove the source and add the new file.

Example Request ​

bash
curl -X PUT "https://api.repliz.com/public/knowledge/680affa5ce12f2f72916f67e/source/680affa5ce12f2f72916f67f" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "We ship every weekday. Orders before 3 PM go out the same day."
  }'
javascript
import axios from 'axios';

const knowledgeId = '680affa5ce12f2f72916f67e';
const sourceId = '680affa5ce12f2f72916f67f';

const response = await axios.put(
  `https://api.repliz.com/public/knowledge/${knowledgeId}/source/${sourceId}`,
  {
    text: 'We ship every weekday. Orders before 3 PM go out the same day.',
  },
  {
    auth: {
      username: 'YOUR_ACCESS_KEY',
      password: 'YOUR_SECRET_KEY',
    },
  },
);

console.log(response.data);
javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');

const knowledgeId = '680affa5ce12f2f72916f67e';
const sourceId = '680affa5ce12f2f72916f67f';

const response = await fetch(`https://api.repliz.com/public/knowledge/${knowledgeId}/source/${sourceId}`, {
  method: 'PUT',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    text: 'We ship every weekday. Orders before 3 PM go out the same day.',
  }),
});

const data = await response.json();
console.log(data);

Response ​

json
{
  "_id": "680affa5ce12f2f72916f67f",
  "type": "text",
  "name": "Shipping",
  "status": "process",
  "chars": 62,
  "processedAt": "2026-11-14T03:05:00.000Z",
  "knowledgeId": "680affa5ce12f2f72916f67e",
  "userId": "680affa5ce12f2f72916f600",
  "createdAt": "2026-11-14T03:04:00.000Z",
  "updatedAt": "2026-11-14T03:05:00.000Z",
  "__v": 0
}
json
{
  "code": 400,
  "message": "knowledge source is still being processed"
}
json
{
  "code": 403,
  "message": "all knowledge together can hold up to 5000000 characters"
}
json
{
  "code": 404,
  "message": "knowledge not found"
}

{
  "code": 404,
  "message": "knowledge source not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}