> 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/layoutable-layouts.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.intratool.help/~gitbook/mcp).

# LayoutableLayouts

## Introduction

`LayoutableLayouts` associate [Layouts](https://api-docs.intratool.help/api-reference/layouts/layouts.md) with resources and their presentation purpose. The assignment's `type` is independent of the layout's immutable `origin_entity_layout_type`.

Layout structure, resource assignments, and content placement are described under [Layouts](https://api-docs.intratool.help/introduction/layouts.md).

## Model Definition

**Alias**

`layoutableLayout`

**Layoutable Types**

* `form` - [Forms](https://api-docs.intratool.help/api-reference/forms/forms.md).
* `taskTemplate` - [TaskTemplates](https://api-docs.intratool.help/api-reference/tasks-2/task-templates.md).
* `attributeSet` - [AttributeSets](https://api-docs.intratool.help/api-reference/additional-attributes/attribute-sets.md).

**Assignment Requirements**

| Resource     | Supported assignment types           | Required resulting assignments |
| ------------ | ------------------------------------ | ------------------------------ |
| Form         | `default`, `formMessage`, `formMail` | One of each type               |
| TaskTemplate | `default`                            | None                           |
| AttributeSet | `default`                            | One `default`                  |

Each type may occur only once. The same layout ID may be used for different types. A form's `default` and `formMessage` assignments can therefore share an input layout while `formMail` uses separate email content.

## Admin: Sync

Replace the layout assignments of one resource.

**Definition**

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

**Request Keys**

| Key                 | Type      | Default | Description                                                                              |
| ------------------- | --------- | ------- | ---------------------------------------------------------------------------------------- |
| `layoutable_type`\* | `string`  | -       | Resource alias from [Layoutable Types](#layoutable-types).                               |
| `layoutable_id`\*   | `integer` | -       | Resource ID.                                                                             |
| `layouts`\*         | `array`   | -       | Complete replacement set satisfying [Assignment Requirements](#assignment-requirements). |
| `layouts.*.id`      | `integer` | -       | Existing layout ID for each assignment.                                                  |
| `layouts.*.type`    | `string`  | -       | Assignment purpose supported by the resource.                                            |

Keys with `*` are required.

**Behavior**

* Requires administration access to the target resource.
* This is a complete replacement, not an append operation. Omitted assignment types are removed.
* An empty array removes all assignments only for resources without required layouts. It is invalid for Forms and AttributeSets.
* Returns the remaining assignment records as a JSON array.

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/layouts/layoutable-layouts/sync', [
    'headers' => [
        'Authorization' => "Bearer {accessToken}"
    ],
    'json' => [
        'layoutable_type' => 'taskTemplate',
        'layoutable_id' => 1,
        'layouts' => [[
            'id' => 1,
            'type' => 'default'
        ]]
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "layout_id": 1,
    "layoutable_type": "taskTemplate",
    "layoutable_id": 1,
    "type": "default"
  }
]
```
