> For the complete documentation index, see [llms.txt](https://api-docs.intratool.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.intratool.help/api-reference/layouts/content-elements.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.intratool.help/~gitbook/mcp).

# ContentElements

## Introduction

`ContentElements` add text or field results to [Layouts](https://api-docs.intratool.help/api-reference/layouts/layouts.md). They are attached to [LayoutColumns](https://api-docs.intratool.help/api-reference/layouts/layout-columns.md) similar to form fields.

## Model Definition

**Alias**

`contentElement`

**Types**

The available `type` values, configuration keys, and payload examples are documented in [ContentElementTypes](https://api-docs.intratool.help/api-reference/layouts/content-element-types.md#available-content-element-types).

**Relations**

| Key             | Relation                                                                                 | Type          | Relation Field(s)              |
| --------------- | ---------------------------------------------------------------------------------------- | ------------- | ------------------------------ |
| `layoutColumns` | [LayoutColumns](https://api-docs.intratool.help/api-reference/layouts/layout-columns.md) | Morph to many | `layout_column_layout_element` |

**Capabilities**

* [Translations](https://api-docs.intratool.help/introduction/resource-capabilities/translations.md) - Localizes `title`, `description`, and type-specific `config.text`.

## List

List visible `ContentElements` for one layout.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/layouts/{layout}/content-elements`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `layout`  | `integer` | Layout ID.  |

**Behavior**

* The results can be further restricted using [Result Control filters](https://api-docs.intratool.help/introduction/query-manipulation/result-control.md#filters).
* Requires read access to the relevant layout or origin resource.

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "user_id": 3,
    "lang_id": "en-US",
    "type": "text",
    "title": "Instructions",
    "description": null,
    "config": {
      "text": "<p>Please complete the fields below.</p>"
    }
  },
  {
    "id": 2,
    "user_id": 3,
    "lang_id": "en-US",
    "type": "text",
    "title": "Additional instructions",
    "description": null,
    "config": {
      "text": "<p>Use your work email address.</p>"
    }
  }
]
```

## Show

Show one `ContentElement`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/layouts/content-elements/{contentElement}`

**Route Parameters**

| Parameter        | Type      | Description         |
| ---------------- | --------- | ------------------- |
| `contentElement` | `integer` | Content element ID. |

**Behavior**

* Requires read access to the relevant layout or origin resource.

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 1,
  "user_id": 3,
  "lang_id": "en-US",
  "type": "text",
  "title": "Instructions",
  "description": null,
  "config": {
    "text": "<p>Please complete the fields below.</p>"
  }
}
```

## Admin: List

List visible `ContentElements` for one layout.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/layouts/{layout}/content-elements`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `layout`  | `integer` | Layout ID.  |

**Behavior**

* The results can be further restricted using [Result Control filters](https://api-docs.intratool.help/introduction/query-manipulation/result-control.md#filters).
* Requires administration access to the relevant layout or origin resource.

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "user_id": 3,
    "lang_id": "en-US",
    "type": "text",
    "title": "Instructions",
    "description": null,
    "config": {
      "text": "<p>Please complete the fields below.</p>"
    }
  },
  {
    "id": 2,
    "user_id": 3,
    "lang_id": "en-US",
    "type": "text",
    "title": "Additional instructions",
    "description": null,
    "config": {
      "text": "<p>Use your work email address.</p>"
    }
  }
]
```

## Admin: Show

Show one `ContentElement`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/layouts/content-elements/{contentElement}`

**Route Parameters**

| Parameter        | Type      | Description         |
| ---------------- | --------- | ------------------- |
| `contentElement` | `integer` | Content element ID. |

**Behavior**

* Requires administration access to the relevant layout or origin resource.

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 1,
  "user_id": 3,
  "lang_id": "en-US",
  "type": "text",
  "title": "Instructions",
  "description": null,
  "config": {
    "text": "<p>Please complete the fields below.</p>"
  }
}
```

## Admin: Create

Create one `ContentElement`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/administration/layouts/content-elements`

**Request Keys**

| Key                              | Type               | Default         | Description                                                                                                                                                             |
| -------------------------------- | ------------------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`\*                         | `string`           | -               | Content type from [ContentElementTypes](https://api-docs.intratool.help/api-reference/layouts/content-element-types.md#available-content-element-types).                |
| `lang_id`                        | `string`           | System language | Language key; omitting it uses the system language.                                                                                                                     |
| `title`                          | `string` \| `null` | `null`          | Translatable title.                                                                                                                                                     |
| `description`                    | `string` \| `null` | `null`          | Optional description.                                                                                                                                                   |
| `config`                         | `object`           | Type default    | Type-specific configuration from [ContentElementTypes](https://api-docs.intratool.help/api-reference/layouts/content-element-types.md#available-content-element-types). |
| `layout_column_id`               | `integer`          | No assignment   | Optional destination column ID.                                                                                                                                         |
| `layout_column_data`             | `object`           | `{}`            | Column assignment data.                                                                                                                                                 |
| `layout_column_data.sort_number` | `integer`          | Automatic       | Position in the destination column.                                                                                                                                     |

Keys with `*` are required.

**Behavior**

* `user_id` is set to the authenticated user.
* Omitting `lang_id` uses the system language. Omitting `config` uses the selected type's default; a default containing an empty required value must be completed.
* Providing `layout_column_id` assigns the element to that column and removes its assignments to other columns. Omitting it preserves the current placement on update.
* Writes require administration access to the affected layout. An unassigned content element is available to its creator.

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/layouts/content-elements', [
    'headers' => [
        'Authorization' => "Bearer {accessToken}"
    ],
    'json' => [
        'type' => 'text',
        'lang_id' => 'en-US',
        'title' => 'Instructions',
        'config' => [
            'text' => '<p>Please complete the fields below.</p>'
        ],
        'layout_column_id' => 1
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 1,
    "user_id": 3,
    "lang_id": "en-US",
    "type": "text",
    "title": "Instructions",
    "description": null,
    "config": {
      "text": "<p>Please complete the fields below.</p>"
    }
  }
}
```

## Admin: Update

Update one `ContentElement`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/administration/layouts/content-elements/{contentElement}`

**Route Parameters**

| Parameter        | Type      | Description         |
| ---------------- | --------- | ------------------- |
| `contentElement` | `integer` | Content element ID. |

**Request Keys**

| Key                              | Type               | Default       | Description                                                                                                                                                             |
| -------------------------------- | ------------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`                           | `string`           | Current value | Content type from [ContentElementTypes](https://api-docs.intratool.help/api-reference/layouts/content-element-types.md#available-content-element-types).                |
| `lang_id`                        | `string`           | Current value | Language key; omitting it uses the system language.                                                                                                                     |
| `title`                          | `string` \| `null` | Current value | Translatable title.                                                                                                                                                     |
| `description`                    | `string` \| `null` | Current value | Optional description.                                                                                                                                                   |
| `config`                         | `object`           | Current value | Type-specific configuration from [ContentElementTypes](https://api-docs.intratool.help/api-reference/layouts/content-element-types.md#available-content-element-types). |
| `layout_column_id`               | `integer`          | Current value | Optional destination column ID.                                                                                                                                         |
| `layout_column_data`             | `object`           | Current value | Column assignment data.                                                                                                                                                 |
| `layout_column_data.sort_number` | `integer`          | Current value | Position in the destination column.                                                                                                                                     |

**Behavior**

* Omitting `lang_id` uses the system language. Omitting `config` uses the selected type's default; a default containing an empty required value must be completed.
* Providing `layout_column_id` assigns the element to that column and removes its assignments to other columns. Omitting it preserves the current placement on update.
* Writes require administration access to the affected layout. An unassigned content element is available to its creator.

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/layouts/content-elements/1', [
    'headers' => [
        'Authorization' => "Bearer {accessToken}"
    ],
    'json' => [
        'title' => 'Instructions (updated)'
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 1,
    "user_id": 3,
    "lang_id": "en-US",
    "type": "text",
    "title": "Instructions (updated)",
    "description": null,
    "config": {
      "text": "<p>Please complete the fields below.</p>"
    }
  }
}
```

## Admin: Delete

Delete one `ContentElement`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/administration/layouts/content-elements/{contentElement}`

**Route Parameters**

| Parameter        | Type      | Description         |
| ---------------- | --------- | ------------------- |
| `contentElement` | `integer` | Content element ID. |

**Behavior**

* Requires administration access to the affected layout or origin resource.

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

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