# Section

## Method & Permission

| API            | GET                                              | POST                            | PUT | PATCH                           | DELETE    |
| -------------- | ------------------------------------------------ | ------------------------------- | --- | ------------------------------- | --------- |
| Section List   | Admin, Project Admin, Project Edit, Project View | Project Admin\*, Project Edit\* | -   | -                               | -         |
| Section Detail | Admin, Project Admin, Project Edit, Project View | -                               | -   | Project Admin\*, Project Edit\* | Admin\*\* |

\*Section can not be posted/modified if `row.is_locked=True`, unless the widget can be added at the read-only

\*Section can not be posted/modified if `row.is_archived=True`

\*\*Only the section table can be deleted

## Section List

<mark style="color:blue;">`GET`</mark> `{{ base_url }} /tables/section/list/{level}/{sid}/{serializer}/`

Need table\_\_sid or row\_\_sid.

#### Path Parameters

| Name       | Type   | Description                  |
| ---------- | ------ | ---------------------------- |
| level      | string | organization                 |
| sid        | string | organization sid             |
| serializer | string | one of \[name, list, detail] |

#### Query Parameters

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| row\_\_sid   | string |             |
| table\_\_sid | string |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

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

```yaml
# serializer = name
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 6,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "name": "Overview",
            "widget___widget__sid": "xxx"
        },
    ]
}
# serializer = list
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 6,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "name": "Overview",
            "widget": {
                "sid": "xxx",
                "name": "Rich Text (CKEditor Classic) - Smart WYSIWYG HTML editor"
            },
            "description": "The short description of the experiment",
            "price": "$0.00",
            "is_archived": false,
            "row": null,
            "table": {
                "sid": "xxx",
                "name": "experiments"
            },
            "order": 1,
            "change_permission": true
        },
    ]
}
# serializer = detail
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 6,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "table": {
                "sid": "xxx",
                "name": "experiments"
            },
            "row": null,
            "name": "Overview",
            "description": "The short description of the experiment",
            "widget": {
                "sid": "xxx",
                "icon": "format_color_text",
                "name": "Rich Text (CKEditor Classic)",
                "category": "Office",
                "sub_category": "Text, Word, Docs",
                "company": "Labii Inc.",
                "notes": "Smart WYSIWYG HTML editor",
                "description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
                "documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
                "usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
                "type": "Section",
                "constructor": "object",
                "related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
                "version": "1.00",
                "release_date": "2020-04-19",
                "order": "2.00",
                "subscription_price": "Free",
                "ppu_price": "0.15",
                "allow_multiple": true,
                "is_readonly": false,
                "metadata_labels": "",
                "data": "{\"html\": \"\"}",
                "default_data": ""
            },
            "data": {
                
            },
            "order": 1,
            "metadata": {
                
            },
            "is_archived": false,
            "date_updated": "2020-02-10T03:02:27.029364Z",
            "date_created": "2020-02-10T03:02:27.026207Z",
            "updated_by": "xxx",
            "change_permission": true
        },
    ]
}
```

{% endtab %}
{% endtabs %}

## Section List

<mark style="color:green;">`POST`</mark> `{{ base_url }} /tables/section/list/{level}/{sid}/{serializer}/`

#### Path Parameters

| Name       | Type   | Description                  |
| ---------- | ------ | ---------------------------- |
| level      | string | organization                 |
| sid        | string | organization sid             |
| serializer | string | one of \[name, list, detail] |

#### Query Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| row\_\_sid | string |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

#### Request Body

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| widget      | object |             |
| name        | string |             |
| description | string |             |

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

```yaml
{
    "sid": "xxx",
    "table": {
        "sid": "xxx",
        "name": "experiments"
    },
    "row": null,
    "name": "Overview",
    "description": "The short description of the experiment",
    "widget": {
        "sid": "xxx",
        "icon": "format_color_text",
        "name": "Rich Text (CKEditor Classic)",
        "category": "Office",
        "sub_category": "Text, Word, Docs",
        "company": "Labii Inc.",
        "notes": "Smart WYSIWYG HTML editor",
        "description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
        "documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
        "usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
        "type": "Section",
        "constructor": "object",
        "related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
        "version": "1.00",
        "release_date": "2020-04-19",
        "order": "2.00",
        "subscription_price": "Free",
        "ppu_price": "0.15",
        "allow_multiple": true,
        "is_readonly": false,
        "metadata_labels": "",
        "data": "{\"html\": \"\"}",
        "default_data": ""
    },
    "data": {
        
    },
    "order": 1,
    "metadata": {
        
    },
    "is_archived": false,
    "date_updated": "2020-02-10T03:02:27.029364Z",
    "date_created": "2020-02-10T03:02:27.026207Z",
    "updated_by": "xxx",
    "change_permission": true
}
```

{% endtab %}

{% tab title="406 " %}

```
Error: missing table__sid
Error: The table (xxx) does not belong to the organization (xxx).
Error: Wrong row sid!
Error: The row (xxx) does not belong to the organization (xxx).
Error: Wrong widget sid!
Your organization does not have enough credits, contact sales@labii.com!
Error: You can not add multiple xxx widget per record.
```

{% endtab %}
{% endtabs %}

## Section Detail

<mark style="color:blue;">`GET`</mark> `{{ base_url }} /tables/section/detail/{sid}/`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| sid  | string |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

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

```yaml
{
    "sid": "xxx",
    "table": {
        "sid": "xxx",
        "name": "experiments"
    },
    "row": null,
    "name": "Overview",
    "description": "The short description of the experiment",
    "widget": {
        "sid": "xxx",
        "icon": "format_color_text",
        "name": "Rich Text (CKEditor Classic)",
        "category": "Office",
        "sub_category": "Text, Word, Docs",
        "company": "Labii Inc.",
        "notes": "Smart WYSIWYG HTML editor",
        "description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
        "documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
        "usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
        "type": "Section",
        "constructor": "object",
        "related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
        "version": "1.00",
        "release_date": "2020-04-19",
        "order": "2.00",
        "subscription_price": "Free",
        "ppu_price": "0.15",
        "allow_multiple": true,
        "is_readonly": false,
        "metadata_labels": "",
        "data": "{\"html\": \"\"}",
        "default_data": ""
    },
    "data": {
        
    },
    "order": 1,
    "metadata": {
        
    },
    "is_archived": false,
    "date_updated": "2020-02-10T03:02:27.029364Z",
    "date_created": "2020-02-10T03:02:27.026207Z",
    "updated_by": "xxx",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}

## Section Patch

<mark style="color:purple;">`PATCH`</mark> `{{ base_url }} /tables/section/detail/{sid}/`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| sid  | string |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

#### Request Body

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| name         | string  |             |
| description  | string  |             |
| order        | number  |             |
| data         | object  |             |
| is\_archived | boolean |             |

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

```yaml
{
    "sid": "xxx",
    "table": {
        "sid": "xxx",
        "name": "experiments"
    },
    "row": null,
    "name": "Overview",
    "description": "The short description of the experiment",
    "widget": {
        "sid": "xxx",
        "icon": "format_color_text",
        "name": "Rich Text (CKEditor Classic)",
        "category": "Office",
        "sub_category": "Text, Word, Docs",
        "company": "Labii Inc.",
        "notes": "Smart WYSIWYG HTML editor",
        "description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
        "documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
        "usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
        "type": "Section",
        "constructor": "object",
        "related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
        "version": "1.00",
        "release_date": "2020-04-19",
        "order": "2.00",
        "subscription_price": "Free",
        "ppu_price": "0.15",
        "allow_multiple": true,
        "is_readonly": false,
        "metadata_labels": "",
        "data": "{\"html\": \"\"}",
        "default_data": ""
    },
    "data": {
        
    },
    "order": 1,
    "metadata": {
        
    },
    "is_archived": false,
    "date_updated": "2020-02-10T03:02:27.029364Z",
    "date_created": "2020-02-10T03:02:27.026207Z",
    "updated_by": "xxx",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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.labii.com/api/methods/section.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.
