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

# LayoutRows

## Introduction

`LayoutRows` divide a [Layout](/api-reference/layouts/layouts.md) vertically and contain [LayoutColumns](/api-reference/layouts/layout-columns.md).

## Model Definition

**Alias**

`layoutRow`

**Capabilities**

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

**Relations**

| Key             | Relation                                                  | Type       | Relation Field(s) |
| --------------- | --------------------------------------------------------- | ---------- | ----------------- |
| `layout`        | [Layout](/api-reference/layouts/layouts.md)               | Belongs to | `layout_id`       |
| `layoutColumns` | [LayoutColumns](/api-reference/layouts/layout-columns.md) | Has many   | `layout_row_id`   |

## List

List `LayoutRows`.

**Definition**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 61,
    "title": "Primary information",
    "layout_id": 41,
    "lang_id": "en-US",
    "top_separator": false,
    "bottom_separator": true,
    "sort_number": 1
  },
  {
    "id": 62,
    "title": "Additional details",
    "layout_id": 41,
    "lang_id": "en-US",
    "top_separator": true,
    "bottom_separator": false,
    "sort_number": 2
  }
]
```

## Show

Show one `LayoutRow`.

**Definition**

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

**Route Parameters**

| Parameter   | Type      | Description   |
| ----------- | --------- | ------------- |
| `layoutRow` | `integer` | LayoutRow 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/rows/61', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 61,
  "title": "Primary information",
  "layout_id": 41,
  "lang_id": "en-US",
  "top_separator": false,
  "bottom_separator": true,
  "sort_number": 1
}
```

## Create

Create a new `LayoutRow`.

**Definition**

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

**Request Keys**

| Key                | Type               | Default         | Description                                 |
| ------------------ | ------------------ | --------------- | ------------------------------------------- |
| `title`            | `string` \| `null` | `null`          | Row label.                                  |
| `layout_id`\*      | `integer`          | -               | Parent Layout ID.                           |
| `lang_id`          | `string`           | System language | Language key. Use `en-US` for this example. |
| `top_separator`    | `boolean`          | `false`         | Draw a separator above the row.             |
| `bottom_separator` | `boolean`          | `false`         | Draw a separator below the row.             |
| `sort_number`      | `integer`          | Auto            | Order within the layout.                    |

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/rows', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'title' => 'Additional details',
        'layout_id' => 41,
        'lang_id' => 'en-US',
        'top_separator' => true,
        'bottom_separator' => false,
        'sort_number' => 2
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 62,
    "title": "Additional details",
    "layout_id": 41,
    "lang_id": "en-US",
    "top_separator": true,
    "bottom_separator": false,
    "sort_number": 2
  }
}
```

## Update

Update an existing `LayoutRow`.

**Definition**

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

**Route Parameters**

| Parameter   | Type      | Description |
| ----------- | --------- | ----------- |
| `layoutRow` | `integer` | Row ID.     |

**Request Keys**

| Key                | Type               | Default       | Description              |
| ------------------ | ------------------ | ------------- | ------------------------ |
| `title`            | `string` \| `null` | Current value | Row label.               |
| `layout_id`        | `integer`          | Current value | Parent Layout ID.        |
| `lang_id`          | `string`           | Current value | Language key.            |
| `top_separator`    | `boolean`          | Current value | Separator above the row. |
| `bottom_separator` | `boolean`          | Current value | Separator below the row. |
| `sort_number`      | `integer`          | Current value | Order within the layout. |

**Example Request**

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

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/layouts/rows/62', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'title' => 'Supporting details',
        'lang_id' => 'en-US',
        'top_separator' => false,
        'sort_number' => 2
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 62,
    "title": "Supporting details",
    "layout_id": 41,
    "lang_id": "en-US",
    "top_separator": false,
    "bottom_separator": false,
    "sort_number": 2
  }
}
```

## Delete

Delete an existing `LayoutRow`.

**Definition**

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

**Route Parameters**

| Parameter   | Type      | Description   |
| ----------- | --------- | ------------- |
| `layoutRow` | `integer` | LayoutRow ID. |

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

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