Logo
Search
Docs

Delete document

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

Delete 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

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."}
500 Removal from search indexes failed — the document is kept, not deleted {"message":"Could not remove article from search indexes. Please try again."}
401 Missing or invalid bearer token
403 Feature knowledge_docs not enabled for the account

Notes

  • The document is only deleted from the database after it is successfully removed from search indexes/mirrors — a failure there leaves the document intact so it can be retried.
curl --request DELETE \
  --url https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article} \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
import requests

url = "https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}"
headers = {"Authorization": "Bearer <YOUR_API_KEY>"}

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

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

func main() {
	url := "https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}"
	req, _ := http.NewRequest("DELETE", url, nil)
	req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
Response 200
{
    "message": "Article deleted"
}