> For the complete documentation index, see [llms.txt](https://40factory.gitbook.io/wilson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://40factory.gitbook.io/wilson/3.12/rest-api/knowledge-base/rename-document.md).

# Rename document

Rename document in Knowledge Base

## Request <a href="#request" id="request"></a>

### Url

```
PATCH 
https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/<object_id>/rename
```

### Headers

<pre><code><strong>AUTH
</strong>Bearer "eyJ0eXAiOiJKV1QiLCJub25jZSI6IndUZXphSTNjdTNVYj..."
</code></pre>

### Parameters

```
No parameters are required for this endpoint.
```

### Body

```json
{
    "filename": "new-filename.pdf"
}
```

The request body is in JSON format contain following properties:

* `filename` (string, required): New filename

***

## Response&#x20;

```json
{}
```

***

## Code example

{% tabs %}
{% tab title="Python" %}

```python
import requests
import json

url = "https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/<object_id>/rename"

payload = json.dumps({
  "filename": "new-filename.pdf"
})
headers = {
  'Authorization': '••••••'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

<pre class="language-powershell"><code class="lang-powershell">curl --location 'https://wilson.40mat.com/apif/v2/company/&#x3C;company_id>/knowledge-base/&#x3C;object_id>/rename' \
<strong>--header 'Authorization: ••••••' \
</strong>--data '{
    "filename": "new-filename.pdf"
}'
</code></pre>

{% endtab %}
{% endtabs %}
