> 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-fields.md).

# AttributeFields

## Introduction

`AttributeFields` define the input structure of an [AttributeSet](/api-reference/additional-attributes/attribute-sets.md).

They use `form_type` + `form_id` to reference their container set and support field-specific configuration through `config`.

## Model Definition

**Alias**

`formField`

**Relations**

| Relation                                                                                         | Key                | Type       | Relation Field(s)                      |
| ------------------------------------------------------------------------------------------------ | ------------------ | ---------- | -------------------------------------- |
| [AttributeSets](/api-reference/additional-attributes/attribute-sets.md)                          | `form`             | Belongs to | `form_id`, `form_type`                 |
| [AttributeFieldTypes](/api-reference/additional-attributes/attribute-field-types.md)             | `fieldType`        | Belongs to | `form_field_type_id`                   |
| [AttributeFieldValidations](/api-reference/additional-attributes/attribute-field-validations.md) | `fieldValidations` | Has many   | `form_field_validations.form_field_id` |

## User routes (`/api/additional-attributes/...`)

## List all fields

**Definition**

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

**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/fields', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

**Example Response**

```json
[
  {
    "id": 27,
    "form_type": "attributeSet",
    "form_id": 11,
    "form_field_type_id": "text",
    "name": "Employee Number",
    "config": {}
  }
]
```

## List fields by set

**Definition**

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

`{formEntity}` is an `AttributeSet` ID.

**Request Keys**

| Key          | Type    | Default | Description      |
| ------------ | ------- | ------- | ---------------- |
| `formEntity` | integer | -       | AttributeSet ID. |

**Example Request**

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

**Example Response**

```json
[
  {
    "id": 27,
    "form_type": "attributeSet",
    "form_id": 11,
    "form_field_type_id": "text",
    "name": "Employee Number",
    "config": {}
  }
]
```

## Show field

**Definition**

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

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |

**Example Request**

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

**Example Response**

```json
{
  "id": 27,
  "form_type": "attributeSet",
  "form_id": 11,
  "form_field_type_id": "text",
  "name": "Employee Number",
  "config": {}
}
```

## Entity-select helpers

## List preselected entities

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/additional-attributes/fields/{formField}/preselected-entities`

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |

No additional JSON body keys are required.

**Example Request**

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

**Example Response**

```json
[]
```

## List selectable entities

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/additional-attributes/fields/{formField}/selectable-entities`

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |

No additional JSON body keys are required.

**Example Request**

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

**Example Response**

```json
[
  {
    "id": 5,
    "title": "Sales"
  }
]
```

## List selectable-entity filters

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/additional-attributes/fields/{formField}/selectable-entities/filters`

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |

No additional JSON body keys are required.

**Example Request**

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

**Example Response**

```json
[
  {
    "key": "department",
    "title": "Department"
  }
]
```

## List selectable-entity filter options

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/additional-attributes/fields/{formField}/selectable-entities/{filterKey}/options`

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |
| `filterKey` | string  | -       | Filter key. |

No additional JSON body keys are required.

**Example Request**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/additional-attributes/fields/27/selectable-entities/department/options', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => []
]);
```

**Example Response**

```json
[
  {
    "key": 5,
    "title": "Sales"
  }
]
```

## \[Adm.] routes (`/api/administration/additional-attributes/...`)

## \[Adm.] List all fields

**Definition**

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

**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/fields', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

**Example Response**

```json
[
  {
    "id": 27,
    "form_type": "attributeSet",
    "form_id": 11,
    "form_field_type_id": "text",
    "name": "Employee Number",
    "config": {}
  }
]
```

## \[Adm.] List fields by set

**Definition**

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

**Request Keys**

| Key          | Type    | Default | Description      |
| ------------ | ------- | ------- | ---------------- |
| `formEntity` | integer | -       | AttributeSet ID. |

**Example Request**

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

**Example Response**

```json
[
  {
    "id": 27,
    "form_type": "attributeSet",
    "form_id": 11,
    "form_field_type_id": "text",
    "name": "Employee Number",
    "config": {}
  }
]
```

## \[Adm.] Show field

**Definition**

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

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |

**Example Request**

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

**Example Response**

```json
{
  "id": 27,
  "form_type": "attributeSet",
  "form_id": 11,
  "form_field_type_id": "text",
  "name": "Employee Number",
  "config": {}
}
```

## \[Adm.] Create field

**Definition**

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

**Request Keys**

| Key                    | Type    | Default             | Description                                                                                               |
| ---------------------- | ------- | ------------------- | --------------------------------------------------------------------------------------------------------- |
| `form_type`\*          | string  | -                   | Morph alias of container entity. For attribute fields use `attributeSet`.                                 |
| `form_id`\*            | integer | -                   | ID of the related [AttributeSet](/api-reference/additional-attributes/attribute-sets.md).                 |
| `form_field_type_id`\* | string  | -                   | Field type key from [AttributeFieldTypes](/api-reference/additional-attributes/attribute-field-types.md). |
| `lang_id`              | string  | system language     | Language key for translated values.                                                                       |
| `name`\*               | string  | -                   | Field label shown to users.                                                                               |
| `slug`                 | string  | derived from `name` | Technical slug. Sanitized automatically.                                                                  |
| `default_value`        | mixed   | `null`              | Static default value.                                                                                     |
| `placeholder`          | string  | `null`              | Placeholder text.                                                                                         |
| `description`          | string  | `null`              | Field description/help text.                                                                              |
| `hidden`               | boolean | `false`             | Hide field in UI.                                                                                         |
| `disabled`             | boolean | `false`             | Disable field input.                                                                                      |
| `config`               | object  | type defaults       | Type-specific configuration object.                                                                       |

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/fields', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'form_type' => 'attributeSet',
        'form_id' => 11,
        'form_field_type_id' => 'text',
        'name' => 'Employee Number'
    ]
]);
```

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 27,
    "form_type": "attributeSet",
    "form_id": 11,
    "form_field_type_id": "text",
    "name": "Employee Number",
    "config": {},
    "hidden": false,
    "disabled": false
  }
}
```

## \[Adm.] Update field

**Definition**

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

**Request Keys**

| Key                  | Type    | Description                                 |
| -------------------- | ------- | ------------------------------------------- |
| `formField`          | integer | Route parameter. ID of the field to update. |
| `form_field_type_id` | string  | New field type key.                         |
| `lang_id`            | string  | New language key.                           |
| `name`               | string  | New field label.                            |
| `slug`               | string  | New technical slug.                         |
| `default_value`      | mixed   | New static default value.                   |
| `placeholder`        | string  | New placeholder text.                       |
| `description`        | string  | New help text.                              |
| `hidden`             | boolean | Update hidden state.                        |
| `disabled`           | boolean | Update disabled state.                      |
| `config`             | object  | Updated type-specific configuration.        |

**Example Request**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/additional-attributes/fields/27', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'name' => 'Employee Number (updated)'
    ]
]);
```

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 27,
    "form_type": "attributeSet",
    "form_id": 11,
    "form_field_type_id": "text",
    "name": "Employee Number (updated)",
    "config": {}
  }
}
```

## \[Adm.] Delete field

**Definition**

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

**Request Keys**

| Key         | Type    | Default | Description |
| ----------- | ------- | ------- | ----------- |
| `formField` | integer | -       | Field ID.   |

**Example Request**

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

**Example Response**

```json
{
  "status": "success",
  "data": {
    "count": 1
  }
}
```

## \[Adm.] field-side resources

* [AttributeFieldDefaultValueSources](/api-reference/additional-attributes/attribute-field-default-value-sources.md)
* [AttributeFieldValidations](/api-reference/additional-attributes/attribute-field-validations.md)
* [AttributeFieldDisplayConditions](/api-reference/additional-attributes/attribute-field-display-conditions.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.intratool.de/api-reference/additional-attributes/attribute-fields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
