> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lacy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update document

> Update a document's name or description

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

**data properties**

**id** `integer`

The unique identifier of the document

**name** `string`

The name of the document

**description** `string`

Description of the document

**type** `string`

Document type

**type\_label** `string`

Human-readable type label

**status** `string`

Processing status

**status\_label** `string`

Human-readable status label

**updated\_at** `string`

ISO 8601 timestamp of last update

```json 200 Response theme={null}
{
  "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"
  }
}
```

```json 404 Knowledgebase Not Found theme={null}
{
  "error": "Knowledgebase not found."
}
```

```json 404 Document Not Found theme={null}
{
  "error": "Document not found."
}
```

```json 422 Validation Error theme={null}
{
  "message": "The name may not be greater than 255 characters.",
  "errors": {
    "name": [
      "The name may not be greater than 255 characters."
    ]
  }
}
```

> [!NOTE]
>
> To update the content of a document, you need to delete the existing document and create a new one with the updated content.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.