FruxonDocs
ApiKnowledge bases

Corrects a document by saying what is wrong with it.

Runs the knowledge base's editor agent over the article and the supplied instruction, and applies what it returns as a `CORRECTED` revision naming both the caller and the agent. The editor may decline — when the instruction needs a fact it was not given, or is about a claim the article does not make — in which case nothing is written and the reason is returned instead. A correction to a published document returns it to `DRAFT`: the caller wrote the instruction, the agent wrote the prose, and nobody has read the prose yet. `returnedToDraft` says when that happened, and the change reaches the index once the document is published again.

POST
/v1/tenants/{tenant}/knowledgeBases/{knowledgeBase}/documents/{document}:correct
AuthorizationBearer <token>

JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.

In: header

Path Parameters

knowledgeBase*string

The knowledge base id.

Formatuuid
document*string

The document id.

Formatuuid
tenant*string

The tenant identifier

What is wrong with the article, in the reviewer's own words.

instruction*string

What is wrong, in the reviewer's own words. This is the specification — the editor applies it rather than inferring it — so plain prose is the right shape, not a structured reason code.

Length1 <= length <= 4000
[key: string]?never

Response Body

curl -X POST "https://api.fruxon.com/v1/tenants/string/knowledgeBases/497f6eca-6276-4993-bfeb-53cbbbba6f08/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08:correct" \  -H "Content-Type: application/json" \  -d '{    "instruction": "string"  }'
{
  "outcome": "APPLIED",
  "reason": "string",
  "document": {
    "id": "00000000-0000-0000-0000-000000000000",
    "knowledgeBaseId": "00000000-0000-0000-0000-000000000000",
    "title": "string",
    "bodyMarkdown": "string",
    "status": "DRAFT",
    "locale": "string",
    "tags": [
      "string"
    ],
    "metadata": {},
    "sourceConversationIds": [
      "string"
    ],
    "lastReviewedAt": 0,
    "lastReviewedBy": "string",
    "createdAt": 0,
    "modifiedAt": 0
  },
  "executionRecordId": "00000000-0000-0000-0000-000000000000",
  "returnedToDraft": false
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}
Empty
Empty
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}