> 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/additional-attributes/attribute-sets.md).

# AttributeSets

## Introduction

`AttributeSets` group additional attributes and provide them as a carrier for `AttributeFields`.

An `AttributeSet` is assigned to target entities (currently departments and roles). The set controls which fields are shown and how default values are resolved.

## Model Definition

**Alias**

`attributeSet`

**Target Entity Types**

* `department` - Makes the Attribute Set available to [Departments](/api-reference/departments.md).
* `role` - Makes the Attribute Set available to [Roles](/api-reference/roles.md).

**Capabilities**

* [Translations](/introduction/resource-capabilities/translations.md) - Localizes `title`; examples use `en-US`.

**Relations**

| Relation                                                                    | Key          | Type       | Relation Field(s)                                  |
| --------------------------------------------------------------------------- | ------------ | ---------- | -------------------------------------------------- |
| [User](/api-reference/users.md)                                             | `user`       | Belongs to | `user_id`                                          |
| [AttributeFields](/api-reference/additional-attributes/attribute-fields.md) | `formFields` | Has many   | `form_fields.form_id`, `form_fields.form_type`     |
| [Layouts](/api-reference/layouts/layouts.md)                                | `layouts`    | Has many   | `layouts.layoutable_type`, `layouts.layoutable_id` |

## List

List visible `AttributeSets`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/additional-attributes/sets`

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 11,
    "user_id": 7,
    "lang_id": "en-US",
    "key": "employee-data",
    "title": "Employee Data",
    "created_at": "2026-05-10 09:00:00",
    "updated_at": "2026-05-10 09:00:00"
  },
  {
    "id": 12,
    "user_id": 19,
    "lang_id": "en-US",
    "key": "workplace-details",
    "title": "Workplace Details",
    "created_at": "2026-05-11 10:30:00",
    "updated_at": "2026-05-12 08:15:00"
  }
]
```

## Show

Show one `AttributeSet`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/additional-attributes/sets/{attributeSet}`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `attributeSet` | `integer` | AttributeSet ID. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 11,
  "user_id": 7,
  "lang_id": "en-US",
  "key": "employee-data",
  "title": "Employee Data",
  "created_at": "2026-05-10 09:00:00",
  "updated_at": "2026-05-10 09:00:00"
}
```

## Default values

Resolve effective default values for all fields of an `AttributeSet`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/additional-attributes/sets/{attributeSet}/default-values`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `attributeSet` | `integer` | AttributeSet ID. |

**Behavior**

* Values are resolved from configured [AttributeFieldDefaultValueSources](/api-reference/additional-attributes/attribute-field-default-value-sources.md).
* Sources are evaluated by `sort_number` per field.
* The first resolvable source wins.
* Response keys are `form_field_id` values.

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "27": {
    "value": "42"
  },
  "28": {
    "value": "max.mustermann@example.com",
    "request_value": "max.mustermann@example.com",
    "additional_information": null
  }
}
```

## Admin: List

List all `AttributeSets` in administration scope.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/additional-attributes/sets`

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data"
  },
  {
    "id": 12,
    "key": "workplace-details",
    "title": "Workplace Details"
  }
]
```

## Admin: List available sets for entity type

List assignable `AttributeSets` for a target entity type.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/additional-attributes/{entityType}/available-sets`

**Route Parameters**

| Parameter    | Type     | Description                                                               |
| ------------ | -------- | ------------------------------------------------------------------------- |
| `entityType` | `string` | Selects one of the supported [Target Entity Types](#target-entity-types). |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data"
  },
  {
    "id": 12,
    "key": "workplace-details",
    "title": "Workplace Details"
  }
]
```

## Admin: Show

Show one `AttributeSet` in administration scope.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/additional-attributes/sets/{attributeSet}`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `attributeSet` | `integer` | AttributeSet ID. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 11,
  "user_id": 7,
  "lang_id": "en-US",
  "key": "employee-data",
  "title": "Employee Data",
  "created_at": "2026-05-10 09:00:00",
  "updated_at": "2026-05-10 09:00:00"
}
```

## Admin: Create

Create a new `AttributeSet`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/administration/additional-attributes/sets`

**Request Keys**

| Key       | Type     | Default         | Description                                |
| --------- | -------- | --------------- | ------------------------------------------ |
| `lang_id` | `string` | system language | Language key for translatable fields.      |
| `key`\*   | `string` | -               | Unique technical key of the attribute set. |
| `title`\* | `string` | -               | Display title of the attribute set.        |

Keys with `*` are required.

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/additional-attributes/sets', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'lang_id' => 'en-US',
        'key' => 'employee-data',
        'title' => 'Employee Data'
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 11,
    "user_id": 7,
    "lang_id": "en-US",
    "key": "employee-data",
    "title": "Employee Data",
    "created_at": "2026-05-10 09:00:00",
    "updated_at": "2026-05-10 09:00:00"
  }
}
```

## Admin: Update

Update an existing `AttributeSet`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/administration/additional-attributes/sets/{attributeSet}`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `attributeSet` | `integer` | AttributeSet ID. |

**Request Keys**

| Key       | Type     | Description                                |
| --------- | -------- | ------------------------------------------ |
| `lang_id` | `string` | Language key.                              |
| `key`     | `string` | Unique technical key of the attribute set. |
| `title`   | `string` | Display title of the attribute set.        |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/additional-attributes/sets/11', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'lang_id' => 'en-US',
        'title' => 'Employee Data (updated)'
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 11,
    "user_id": 7,
    "lang_id": "en-US",
    "key": "employee-data",
    "title": "Employee Data (updated)",
    "created_at": "2026-05-10 09:00:00",
    "updated_at": "2026-05-10 09:05:00"
  }
}
```

## Admin: Delete

Delete an existing `AttributeSet`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/administration/additional-attributes/sets/{attributeSet}`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `attributeSet` | `integer` | AttributeSet ID. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": null
}
```

## List by target entity (Department)

List assigned `AttributeSets` for a specific [Department](/api-reference/departments.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/departments/{attributeSetTargetEntity}/additional-attributes/sets`

**Route Parameters**

| Parameter                  | Type      | Description    |
| -------------------------- | --------- | -------------- |
| `attributeSetTargetEntity` | `integer` | Department ID. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data",
    "pivot": {
      "sort_number": 1
    }
  },
  {
    "id": 12,
    "key": "workplace-details",
    "title": "Workplace Details",
    "pivot": {
      "sort_number": 2
    }
  }
]
```

## Default values by target entity (Department)

Resolve default values for one `AttributeSet` in department context.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/departments/{attributeSetTargetEntity}/additional-attributes/sets/{attributeSet}/default-values`

**Route Parameters**

| Parameter                  | Type      | Description      |
| -------------------------- | --------- | ---------------- |
| `attributeSetTargetEntity` | `integer` | Department ID.   |
| `attributeSet`             | `integer` | AttributeSet ID. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/departments/5/additional-attributes/sets/11/default-values', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "27": {
    "value": "2"
  },
  "28": {
    "value": "max.mustermann@example.com",
    "request_value": "max.mustermann@example.com",
    "additional_information": null
  }
}
```

**Behavior**

The `value` for system-variable based defaults depends on request context, such as the authenticated user.

## List by target entity (Role)

List assigned `AttributeSets` for a specific [Role](/api-reference/roles.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/roles/{attributeSetTargetEntity}/additional-attributes/sets`

**Route Parameters**

| Parameter                  | Type      | Description |
| -------------------------- | --------- | ----------- |
| `attributeSetTargetEntity` | `integer` | Role ID.    |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data",
    "pivot": {
      "sort_number": 1
    }
  },
  {
    "id": 13,
    "key": "compliance-details",
    "title": "Compliance Details",
    "pivot": {
      "sort_number": 3
    }
  }
]
```

## Default values by target entity (Role)

Resolve default values for one `AttributeSet` in role context.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/roles/{attributeSetTargetEntity}/additional-attributes/sets/{attributeSet}/default-values`

**Route Parameters**

| Parameter                  | Type      | Description      |
| -------------------------- | --------- | ---------------- |
| `attributeSetTargetEntity` | `integer` | Role ID.         |
| `attributeSet`             | `integer` | AttributeSet ID. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/roles/7/additional-attributes/sets/11/default-values', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "27": {
    "value": "2"
  },
  "28": {
    "value": "max.mustermann@example.com",
    "request_value": "max.mustermann@example.com",
    "additional_information": null
  }
}
```

**Behavior**

The `value` for system-variable based defaults depends on request context, such as the authenticated user.

## Linking AttributeSets to target entities

The linking is done on target-entity update routes (for example [Roles](/api-reference/roles.md) and [Departments](/api-reference/departments.md)) via `attribute_set_ids`.

You can pass plain IDs:

```json
{
  "attribute_set_ids": [1, 2, 3]
}
```

Or objects with `sort_number`:

```json
{
  "attribute_set_ids": [
    {
      "id": 1,
      "sort_number": 1
    },
    {
      "id": 2,
      "sort_number": 2
    }
  ]
}
```
