Logo
Search
Docs

Update document

PUT https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}

Update a document

Authentication

Send a bearer token created on your dashboard's Developer page:

Authorization: Bearer <YOUR_API_KEY>

Path parameters

knowledge_base string Required

The library.

Validation: the library's UUID
Stored in knowledge_bases.id
article string Required

The document.

Validation: the document's UUID
Stored in knowledge_articles.id

Request body

title string Optional
Validation: sometimes|string|max:255
Stored in knowledge_articles.title
content string Optional

No length limit — stored in a longtext column.

Validation: sometimes|string
Stored in knowledge_articles.content
status string Optional
Validation: sometimes|in:draft,published,archived
Stored in knowledge_articles.status

Errors

StatusMeaningBody
404 Library not found {"message":"No query results for model [App\\Models\\KnowledgeBase] <id>."}
404 Document not found, or it does not belong to that library {"message":"No query results for model [App\\Models\\KnowledgeArticle] <id>."}
403 Policy denied — outside your organization, or you cannot write to this resource {"message":"This action is unauthorized."}
422 Validation failed {"message":"…","errors":{"field":["…"]}}
401 Missing or invalid bearer token
403 Feature knowledge_docs not enabled for the account

Notes

  • A resync (index if the resulting status is published, remove from the index otherwise) only runs when content actually changed hash, or title changed, or status changed — an update that repeats the same content/title/status is a no-op for sync_status.
  • The resync runs synchronously in the same request, exactly like create.
curl --request PUT \
  --url https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article} \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "<h2>Returns</h2><p>Items can be returned within 60 days of purchase with a receipt.</p>",
  "status": "published"
}'
import requests

url = "https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}"
headers = {"Authorization": "Bearer <YOUR_API_KEY>"}
payload = {
  "content": "<h2>Returns</h2><p>Items can be returned within 60 days of purchase with a receipt.</p>",
  "status": "published"
}

response = requests.put(url, json=payload, headers=headers)
print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	url := "https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}"
	payload := strings.NewReader(`{
  "content": "<h2>Returns</h2><p>Items can be returned within 60 days of purchase with a receipt.</p>",
  "status": "published"
}`)
	req, _ := http.NewRequest("PUT", url, payload)
	req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")
	req.Header.Add("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
Response 200
{
    "data": {
        "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
        "knowledge_base_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "reseller_id": "f1e2d3c4-b5a6-4978-8901-234567890abc",
        "title": "Return Policy",
        "content": "<h2>Returns</h2><p>Items can be returned within 60 days of purchase with a receipt.</p>",
        "plain_text": "Returns Items can be returned within 60 days of purchase with a receipt.",
        "structured_text": "\n\n## Returns\n\nItems can be returned within 60 days of purchase with a receipt.",
        "content_hash": "9a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f",
        "embedded_content_hash": "9a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f",
        "status": "published",
        "char_count": 73,
        "chunk_count": 1,
        "sync_status": "synced",
        "sync_error": null,
        "last_synced_at": "2026-07-30T14:40:52.000000Z",
        "created_at": "2026-07-30T14:22:03.000000Z",
        "updated_at": "2026-07-30T14:40:52.000000Z"
    }
}