MessageOS
APIKnowledgeId

Edit a knowledge draft

PATCH
/knowledge/{id}

Only a draft can be edited. Each edit adds one to version. Scope: knowledge:write.

Authorization

bearer
headerAuthorizationBearer <mosc_...>

A client key (mosc_).

Path Parameters

id*integer

The entry id.

Range0 < value

Request Body

application/json
  1. body
question?string
Length1 <= length <= 300
answer?string
Length1 <= length <= 2000
tags?array<>
Itemsitems <= 8

Response Body

The updated entry.

application/json
  1. response
entry*

An approved answer, or a draft of one. The assistant uses approved entries only.

Example request

curl -X PATCH 'https://api.messageos.ai/v1/knowledge/42' \  -H 'Authorization: Bearer mosc_...' \  -H 'Content-Type: application/json' \  -d '{  "answer": "Parking is free in the lot behind the building."}'

Example response

{  "entry": {    "id": 12,    "question": "Where can I park?",    "answer": "Parking is in the lot behind the building.",    "tags": [      "parking"    ],    "verbatim": true,    "status": "draft",    "source": "seed",    "version": 1,    "approvedBy": null  }}