> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/api-reference/tags/taggable-sections.md).

# TaggableSections

## Introduction

`TaggableSections` define the different areas or modules in the system where tags can be assigned and managed. They are used to restrict, group, or organize tags for specific use cases.

A `TaggableSection` can have restrictions on which [Tags](/api-reference/tags/tags.md) or [TagGroups](/api-reference/tags/tag-groups.md) are allowed, and can define a default [TagGroup](/api-reference/tags/tag-groups.md) to use when creating [Tags](/api-reference/tags/tags.md) for that section.

## Model Definition

**Alias**

`taggableSection`

**Relations**

| Key                   | Relation                                      | Type          | Relation Field(s)                                                                                  |
| --------------------- | --------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------- |
| `defaultTagGroup`     | [TagGroup](/api-reference/tags/tag-groups.md) | Belongs to    | `default_tag_group_id`                                                                             |
| `restrictedTags`      | [Tag](/api-reference/tags/tags.md)            | Morph to many | `taggable_section_restrictbale.restrictable_type`, `taggable_section_restrictbale.restrictable_id` |
| `restrictedTagGroups` | [TagGroup](/api-reference/tags/tag-groups.md) | Morph to many | `taggable_section_restrictbale.restrictable_type`, `taggable_section_restrictbale.restrictable_id` |

**Available Sections**

* `departments` - The allowed [Tags](/api-reference/tags/tags.md) for [Departments](/api-reference/departments.md).
* `infoboard` - The allowed [Tags](/api-reference/tags/tags.md) for [InfoboardPosts](/api-reference/infoboard/infoboard-posts.md).
* `manual` - The allowed [Tags](/api-reference/tags/tags.md) for [ManualChapters](/api-reference/manual/manual-chapters.md) and [ManualEntries](/api-reference/manual/manual-entries.md).
* `roles` - The allowed [Tags](/api-reference/tags/tags.md) for [Roles](/api-reference/roles.md).

## List

List available `TaggableSections`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/tags/sections`

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/tags/sections', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": "departments",
    "allow_all": true,
    "default_tag_group_id": null,
    "created_at": "2019-06-15 12:00:00",
    "updated_at": "2019-06-15 12:00:00"
  },
  {
    "id": "infoboard",
    "allow_all": false,
    "default_tag_group_id": 31,
    "created_at": "2019-06-15 12:00:00",
    "updated_at": "2019-06-15 12:00:00"
  }
]
```

## Show

Show one available `TaggableSection`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/tags/sections/{taggableSection}`

**Route Parameters**

| Parameter         | Type     | Description         |
| ----------------- | -------- | ------------------- |
| `taggableSection` | `string` | TaggableSection ID. |

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/tags/sections/infoboard', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": "infoboard",
  "allow_all": true,
  "default_tag_group_id": null,
  "created_at": "2019-06-15 12:00:00",
  "updated_at": "2019-06-15 12:00:00"
}
```

## Admin: List

List all `TaggableSections` in administration scope.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/tags/sections`

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/tags/sections', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": "departments",
    "allow_all": true,
    "default_tag_group_id": null,
    "created_at": "2019-06-15 12:00:00",
    "updated_at": "2019-06-15 12:00:00"
  },
  {
    "id": "infoboard",
    "allow_all": false,
    "default_tag_group_id": 31,
    "created_at": "2019-06-15 12:00:00",
    "updated_at": "2019-06-15 12:00:00"
  }
]
```

## Admin: Show

Show one `TaggableSection` in administration scope.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/tags/sections/{taggableSection}`

**Route Parameters**

| Parameter         | Type     | Description         |
| ----------------- | -------- | ------------------- |
| `taggableSection` | `string` | TaggableSection ID. |

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/tags/sections/departments', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": "departments",
  "allow_all": true,
  "default_tag_group_id": null,
  "created_at": "2019-06-15 12:00:00",
  "updated_at": "2019-06-15 12:00:00"
}
```

## Admin: Update

Update a `TaggableSection` by `id`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/administration/tags/sections/{taggableSection}`

**Route Parameters**

| Parameter         | Type     | Description         |
| ----------------- | -------- | ------------------- |
| `taggableSection` | `string` | TaggableSection ID. |

**Request Keys**

| Key                        | Type                | Default              | Description                                                               |
| -------------------------- | ------------------- | -------------------- | ------------------------------------------------------------------------- |
| `allow_all`                | `boolean`           | Current value        | Whether all [Tags](/api-reference/tags/tags.md) are allowed.              |
| `default_tag_group_id`     | `integer` \| `null` | Current value        | Default [TagGroup](/api-reference/tags/tag-groups.md) ID.                 |
| `restricted_tag_ids`       | `array`             | Current restrictions | Allowed [Tag](/api-reference/tags/tags.md) IDs when `allow_all` is false. |
| `restricted_tag_group_ids` | `array`             | Current restrictions | Objects with TagGroup `id` and optional `recursive`.                      |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/tags/sections/infoboard', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'allow_all' => false,
        'default_tag_group_id' => 31,
        'restricted_tag_ids' => [21, 22],
        'restricted_tag_group_ids' => [
            ['id' => 31, 'recursive' => true]
        ]
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": "infoboard",
    "allow_all": false,
    "default_tag_group_id": 31,
    "created_at": "2019-06-15 12:00:00",
    "updated_at": "2019-06-15 12:30:00"
  }
}
```
