> 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`

**Relations**

| Relation                                                                    | Key                  | Type       | Relation Field(s)                                  |
| --------------------------------------------------------------------------- | -------------------- | ---------- | -------------------------------------------------- |
| [User](/api-reference/users.md)                                             | `user`               | Belongs to | `user_id`                                          |
| [Language](/api-reference/languages.md)                                     | `language`           | Belongs to | `lang_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` |
| TargetEntityAttributeSet                                                    | `targetEntityPivots` | Has many   | `target_entity_attribute_set.attribute_set_id`     |

## List

List visible `AttributeSets`.

**Definition**

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

**Request Keys**

No additional request keys.

**Example Request**

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

**Example Response**

```json
[
  {
    "id": 11,
    "user_id": 2,
    "lang_id": "de-DE",
    "key": "employee-data",
    "title": "Employee Data",
    "created_at": "2026-05-10 09:00:00",
    "updated_at": "2026-05-10 09:00:00"
  }
]
```

## Show

Show one `AttributeSet`.

**Definition**

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

**Request Keys**

No additional request keys.

**Example Request**

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

**Example Response**

```json
{
  "id": 11,
  "user_id": 2,
  "lang_id": "de-DE",
  "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`

**Request Keys**

No additional request keys.

**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**

```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}"]
]);
```

**Example Response**

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

## \[Adm.] List

List all `AttributeSets` in administration scope.

**Definition**

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

**Request Keys**

No additional request keys.

**Example Request**

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

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data"
  }
]
```

## \[Adm.] 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`

**Request Keys**

| Key          | Type   | Default | Description                                               |
| ------------ | ------ | ------- | --------------------------------------------------------- |
| `entityType` | string | -       | Target entity type. Allowed values: `department`, `role`. |

**Example Request**

```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}"]
]);
```

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data"
  }
]
```

## \[Adm.] Show

Show one `AttributeSet` in administration scope.

**Definition**

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

**Request Keys**

No additional request keys.

**Example Request**

```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}"]
]);
```

**Example Response**

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

## \[Adm.] 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**

```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' => [
        'key' => 'employee-data',
        'title' => 'Employee Data'
    ]
]);
```

**Example Response**

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

## \[Adm.] Update

Update an existing `AttributeSet`.

**Definition**

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

**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**

```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' => [
        'title' => 'Employee Data (updated)'
    ]
]);
```

**Example Response**

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

## \[Adm.] Delete

Delete an existing `AttributeSet`.

**Definition**

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

**Request Keys**

No additional request keys.

**Example Request**

```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}"]
]);
```

**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`

**Request Keys**

| Key                        | Type    | Default | Description    |
| -------------------------- | ------- | ------- | -------------- |
| `attributeSetTargetEntity` | integer | -       | Department ID. |

**Example Request**

```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}"]
]);
```

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data",
    "pivot": {
      "sort_number": 1
    }
  }
]
```

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

**Request Keys**

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

**Example Request**

```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}"]
]);
```

**Example Response**

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

The `value` for system-variable based defaults depends on request context (e.g. 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`

**Request Keys**

| Key                        | Type    | Default | Description |
| -------------------------- | ------- | ------- | ----------- |
| `attributeSetTargetEntity` | integer | -       | Role ID.    |

**Example Request**

```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}"]
]);
```

**Example Response**

```json
[
  {
    "id": 11,
    "key": "employee-data",
    "title": "Employee Data",
    "pivot": {
      "sort_number": 1
    }
  }
]
```

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

**Request Keys**

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

**Example Request**

```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}"]
]);
```

**Example Response**

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

The `value` for system-variable based defaults depends on request context (e.g. 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
    }
  ]
}
```
