> 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/get-document-metadata.md).

# Get document metadata

Get document metadata.

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

### Url

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

### Headers

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

### Parameters

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

### Body

```
No body required for this endpoint.
```

***

## Response&#x20;

```json
{
    "create_at": "2025-05-26T08:44:39.998000",
    "description": "Useful when performing maintenance on ...",
    "description_type": "ai",
    "document_type": "text",
    "id": "683429f74d950...",
    "is_folder": false,
    "loader_type_preference": "advanced",
    "object_name": "/maintenance_guide.pdf",
    "processing": {
        "chunk_count": 2,
        "doc_pages_count": 2,
        "duration": 19087,
        "embedding_state": "PROCESSED",
        "end_timestamp": "2025-05-26T10:44:59.851000",
        "error_details": ""
        "start_timestamp": "2025-05-26T10:44:40.763000"
    },
    "size": 837294,
    "tags": [],
    "update_at": "2025-05-26T10:45:00.278000"
}
```

The response is in JSON format contain array of object with following properties:

* `description` (string): Document description (can be filled by user, or generated by Wilson)
* `description_type` (string): Document description type: `ai` or `manual`
* `document_type` (string): Document type: `text`, `image` , ...
* `id` (string): Document id
* `is_folder` (boolean): True if document is a folder
* `loader_type_preference` (string): Loader type: `standard` or `advanced`
* `object_name` (string): Document full path in knowledge base
* `size` (number): Document size
* `tags` (string array): List of tags id associated to document
* `processing` (object): Track document processing status
  * `chunk_count` (number): Number of document chunks
  * `doc_pages_count` (number): Number of document pages
  * `duration` (number): Duration of document elaboration
  * `embedding_state` (string): State of document embedding: `PENDING`, `PROCESSING`, `PROCESSED`, `ERROR`
  * `error_details` (string): Detailf of error (if in error state)
  * `start_timestamp` (string datetime): Start of document processing
  * `end_timestamp` (string datetime): Start of document processing
* `create_at` (string datetime): Date of creation
* `update_at` (string datetime): Date of last update

***

## 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>"

headers = {
  'Authorization': '••••••'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```powershell
curl --location 'https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/<object_id>' \
--header 'Authorization: ••••••' 
```

{% endtab %}
{% endtabs %}
