> 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/layouts/layout-columns.md).

# LayoutColumns

## Introduction

`LayoutColumns` divide a [LayoutRow](/api-reference/layouts/layout-rows.md) horizontally and receive layout elements.

## Model Definition

**Alias**

`layoutColumn`

**Capabilities**

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

**Relations**

| Key                  | Relation                                                                              | Type          | Relation Field(s)                                |
| -------------------- | ------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------ |
| `layoutRow`          | [LayoutRow](/api-reference/layouts/layout-rows.md)                                    | Belongs to    | `layout_row_id`                                  |
| `layoutableElements` | [LayoutColumnLayoutElements](/api-reference/layouts/layout-column-layout-elements.md) | Has many      | `layout_column_layout_elements.layout_column_id` |
| `formFields`         | [FormFields](/api-reference/forms/form-fields.md)                                     | Morph to many | `layout_column_layout_element`                   |

## List

List `LayoutColumns`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/layouts/columns`

**Request Keys**

| Key         | Type      | Default           | Description                          |
| ----------- | --------- | ----------------- | ------------------------------------ |
| `selects`   | `string`  | All fields        | Comma-separated fields to return.    |
| `relations` | `string`  | Default relations | Pipe-separated relations to include. |
| `limit`     | `integer` | No limit          | Maximum number of records.           |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 71,
    "title": "Contact details",
    "width": 8,
    "layout_row_id": 61,
    "lang_id": "en-US",
    "top_separator": false,
    "right_separator": true,
    "bottom_separator": false,
    "left_separator": false,
    "sort_number": 1
  },
  {
    "id": 72,
    "title": "Owner",
    "width": 4,
    "layout_row_id": 61,
    "lang_id": "en-US",
    "top_separator": false,
    "right_separator": false,
    "bottom_separator": false,
    "left_separator": true,
    "sort_number": 2
  }
]
```

## Show

Show one `LayoutColumn`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/layouts/columns/{layoutColumn}`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `layoutColumn` | `integer` | LayoutColumn ID. |

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 71,
  "title": "Contact details",
  "width": 8,
  "layout_row_id": 61,
  "lang_id": "en-US",
  "top_separator": false,
  "right_separator": true,
  "bottom_separator": false,
  "left_separator": false,
  "sort_number": 1
}
```

## Create

Create a new `LayoutColumn`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/layouts/columns`

**Request Keys**

| Key               | Type               | Default         | Description                                                  |
| ----------------- | ------------------ | --------------- | ------------------------------------------------------------ |
| `title`           | `string` \| `null` | `null`          | Column label.                                                |
| `layout_row_id`\* | `integer`          | -               | Parent LayoutRow ID.                                         |
| `lang_id`         | `string`           | System language | Language key. Use `en-US` for this example.                  |
| `width`           | `integer`          | Available width | Column width validated against the other columns in the row. |
| `sort_number`     | `integer`          | Auto            | Order within the row.                                        |

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/layouts/columns', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'title' => 'Owner',
        'layout_row_id' => 61,
        'lang_id' => 'en-US',
        'width' => 4,
        'sort_number' => 2
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 72,
    "title": "Owner",
    "width": 4,
    "layout_row_id": 61,
    "lang_id": "en-US",
    "top_separator": false,
    "right_separator": false,
    "bottom_separator": false,
    "left_separator": true,
    "sort_number": 2
  }
}
```

## Update

Update an existing `LayoutColumn`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/layouts/columns/{layoutColumn}`

**Route Parameters**

| Parameter      | Type      | Description |
| -------------- | --------- | ----------- |
| `layoutColumn` | `integer` | Column ID.  |

**Request Keys**

| Key             | Type               | Default       | Description                                          |
| --------------- | ------------------ | ------------- | ---------------------------------------------------- |
| `title`         | `string` \| `null` | Current value | Column label.                                        |
| `layout_row_id` | `integer`          | Current value | Parent LayoutRow ID.                                 |
| `lang_id`       | `string`           | Current value | Language key.                                        |
| `width`         | `integer`          | Current value | Width validated against the row's remaining columns. |
| `sort_number`   | `integer`          | Current value | Order within the row.                                |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/layouts/columns/72', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'title' => 'Responsible person',
        'lang_id' => 'en-US',
        'width' => 4,
        'sort_number' => 2
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 72,
    "title": "Responsible person",
    "width": 4,
    "layout_row_id": 61,
    "lang_id": "en-US",
    "top_separator": false,
    "right_separator": false,
    "bottom_separator": false,
    "left_separator": true,
    "sort_number": 2
  }
}
```

## Delete

Delete an existing `LayoutColumn`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/layouts/columns/{layoutColumn}`

**Route Parameters**

| Parameter      | Type      | Description      |
| -------------- | --------- | ---------------- |
| `layoutColumn` | `integer` | LayoutColumn ID. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

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