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

# Update Document

> Update the name or description of a document in a Famulor knowledge base via API. Keep your AI voice agent's source materials organized and labelled.

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

<ParamField path="knowledgebaseId" type="integer" required>
  The unique identifier of the knowledge base
</ParamField>

<ParamField path="documentId" type="integer" required>
  The unique identifier of the document to update
</ParamField>

### Request Body

<ParamField body="name" type="string">
  The new name for the document (max. 255 characters)
</ParamField>

<ParamField body="description" type="string">
  The new description for the document (max. 255 characters)
</ParamField>

### Response Fields

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<ResponseField name="data" type="object">
  The updated document object

  <Expandable title="Data Properties">
    <ResponseField name="id" type="integer">
      The unique identifier of the document
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the document
    </ResponseField>

    <ResponseField name="description" type="string">
      Description of the document
    </ResponseField>

    <ResponseField name="type" type="string">
      Document type
    </ResponseField>

    <ResponseField name="type_label" type="string">
      Human-readable type label
    </ResponseField>

    <ResponseField name="status" type="string">
      Processing status
    </ResponseField>

    <ResponseField name="status_label" type="string">
      Human-readable status label
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp of last update
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  To update the content of a document, you must delete the existing document and create a new one with the updated content.
</Note>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "message": "Document updated successfully.",
    "data": {
      "id": 1,
      "name": "Updated Product Handbook",
      "description": "Revised user manual 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."
      ]
    }
  }
  ```
</ResponseExample>

<Tip>
  Related pages: [Introduction](/en/api-reference/introduction) and [Authentication Guide](/en/developers/authentication-guide), and [API Integration Examples](/en/developers/api-integration-examples).
</Tip>
