Skip to main content
PUT
https://app.autocalls.ai/api/
/
user
/
knowledgebases
/
{knowledgebaseId}
/
documents
/
{documentId}
Update document
curl --request PUT \
  --url https://app.autocalls.ai/api/user/knowledgebases/{knowledgebaseId}/documents/{documentId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>"
}
'
{
  "message": "Document updated successfully.",
  "data": {
    "id": 1,
    "name": "Updated Product Manual",
    "description": "Revised user guide with new features",
    "type": "pdf",
    "type_label": "PDF",
    "status": "active",
    "status_label": "Active",
    "updated_at": "2025-01-08T15:45:00.000000Z"
  }
}
This endpoint updates the metadata of an existing document. You can only update the name and description - the document type and content cannot be changed.

Path Parameters

knowledgebaseId
integer
required
The unique identifier of the knowledgebase
documentId
integer
required
The unique identifier of the document to update

Request Body

name
string
The new name for the document (max 255 characters)
description
string
The new description for the document (max 255 characters)

Response

message
string
Success message
data
object
The updated document object
{
  "message": "Document updated successfully.",
  "data": {
    "id": 1,
    "name": "Updated Product Manual",
    "description": "Revised user guide with new features",
    "type": "pdf",
    "type_label": "PDF",
    "status": "active",
    "status_label": "Active",
    "updated_at": "2025-01-08T15:45:00.000000Z"
  }
}
To update the content of a document, you need to delete the existing document and create a new one with the updated content.