> 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/create-tag.md).

# Create tag

Create a tag in Knowledge Base

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

### Url

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

### Headers

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

### Parameters

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

### Body

```json
{
    "name": "new-tag"
}
```

The request body is in JSON format contain following properties:

* name (string, required): Tag name

***

## Response&#x20;

```json
{
    "create_at": "2025-03-04T08:26:33.988294",
    "id": "67c6b939da077...",
    "name": "new-tag",
    "update_at": "2025-03-04T08:26:33.985154"
}
```

The response is in JSON format contain following properties:

* `id` (string): Tag id
* `name` (string): Tag name/label
* `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/tags"

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

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

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```powershell
curl --location 'https://wilson.40mat.com/apif/v2/company/<company_id>/knowledge-base/tags' \
--header 'Authorization: ••••••' \
--data '{
    "name": "new-tag"
}'
```

{% endtab %}
{% endtabs %}
