> For the complete documentation index, see [llms.txt](https://docs.labii.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.labii.com/api/methods/table.md).

# Table

## Method & Permission

| API          | GET           | POST  | PUT | PATCH | DELETE |
| ------------ | ------------- | ----- | --- | ----- | ------ |
| Table List   | Admin, Member | Admin | -   | -     | -      |
| Table Detail | Admin, Member | -     | -   | Admin | -      |

## Table List

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

#### Path Parameters

| Name       | Type   | Description      |
| ---------- | ------ | ---------------- |
| level      | string | organization     |
| sid        | string | organization sid |
| serializer | string |                  |

#### Headers

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

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

```yaml
# serializer = name
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 9,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "name": "experiment",
            "name_plural": "experiments",
            "name_singular": "experiment"
        },
        ...
    ]
}
# serializer = list
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 9,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "icon": "xxx",
            "name_singular": "experiment",
            "name_plural": "experiments",
            "unique_code": "EP",
            "table_type": "Document",
            "order": 1,
            "is_archived": false,
            "change_permission": true
        },
        ...
    ]
}
# serializer = detail
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 1,
    "count": 9,
    "next": null,
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "icon": "assignment",
            "name": "experiments",
            "name_singular": "experiment",
            "name_plural": "experiments",
            "name_system": null,
            "description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
            "unique_code": "EP",
            "default_view": "detail",
            "order": 3,
            "number_of_records": 4,
            "number_of_columns": 2,
            "number_of_sections": 6,
            "number_of_filters": 2,
            "number_of_workflows": 3,
            "metadata": [
                
            ],
            "default_filter": null,
            "is_archived": false,
            "updated_by": "xxx",
            "date_updated": "2020-05-25T00:35:21.236133Z",
            "date_created": "2020-05-25T00:35:21.234651Z",
            "change_permission": true
        },
        ...
    ]
}
```

{% endtab %}
{% endtabs %}

## Table List

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

#### Path Parameters

| Name       | Type   | Description      |
| ---------- | ------ | ---------------- |
| level      | string | organization     |
| sid        | string | organization sid |
| serializer | string |                  |

#### Headers

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

#### Request Body

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| name\_singular | string  |             |
| name\_plural   | string  |             |
| description    | string  |             |
| unique\_code   | string  |             |
| icon           | string  |             |
| table\_type    | string  |             |
| is\_archived   | boolean |             |

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

```yaml
{
    "sid": "xxx",
    "icon": "assignment",
    "name": "experiments",
    "name_singular": "experiment",
    "name_plural": "experiments",
    "name_system": null,
    "description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
    "unique_code": "EP",
    "default_view": "detail",
    "order": 3,
    "number_of_records": 4,
    "number_of_columns": 2,
    "number_of_sections": 6,
    "number_of_filters": 2,
    "number_of_workflows": 3,
    "metadata": [
        
    ],
    "default_filter": null,
    "is_archived": false,
    "updated_by": "xxx",
    "date_updated": "2020-05-25T00:35:21.236133Z",
    "date_created": "2020-05-25T00:35:21.234651Z",
    "change_permission": true
}
```

{% endtab %}

{% tab title="400 " %}

```
{"non_field_errors":
    [
        "The fields organization, name_plural must make a unique set.",
        "The fields organization, name_singular must make a unique set.",
        "The fields organization, unique_code must make a unique set."
    ]
}
```

{% endtab %}
{% endtabs %}

## Table Detail

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

#### Path Parameters

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

#### Headers

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

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

```yaml
{
    "sid": "xxx",
    "icon": "assignment",
    "name": "experiments",
    "name_singular": "experiment",
    "name_plural": "experiments",
    "name_system": null,
    "description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
    "unique_code": "EP",
    "default_view": "detail",
    "order": 3,
    "number_of_records": 4,
    "number_of_columns": 2,
    "number_of_sections": 6,
    "number_of_filters": 2,
    "number_of_workflows": 3,
    "metadata": [
        
    ],
    "default_filter": null,
    "is_archived": false,
    "updated_by": "xxx",
    "date_updated": "2020-05-25T00:35:21.236133Z",
    "date_created": "2020-05-25T00:35:21.234651Z",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}

## Table Detail

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

#### Path Parameters

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

#### Headers

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

#### Request Body

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| name\_singular | string  |             |
| name\_plural   | string  |             |
| description    | string  |             |
| unique\_code   | string  |             |
| icon           | string  |             |
| order          | number  |             |
| table\_type    | string  |             |
| is\_archived   | boolean |             |

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

```yaml
{
    "sid": "xxx",
    "icon": "assignment",
    "name": "experiments",
    "name_singular": "experiment",
    "name_plural": "experiments",
    "name_system": null,
    "description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
    "unique_code": "EP",
    "default_view": "detail",
    "order": 3,
    "number_of_records": 4,
    "number_of_columns": 2,
    "number_of_sections": 6,
    "number_of_filters": 2,
    "number_of_workflows": 3,
    "metadata": [
        
    ],
    "default_filter": null,
    "is_archived": false,
    "updated_by": "xxx",
    "date_updated": "2020-05-25T00:35:21.236133Z",
    "date_created": "2020-05-25T00:35:21.234651Z",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}
