> 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/organization-widget.md).

# Organization Widget

## Method & Permission

| API                        | GET           | POST  | PUT | PATCH    | DELETE |
| -------------------------- | ------------- | ----- | --- | -------- | ------ |
| Organization Widget List   | Admin, Member | Admin | -   | -        | -      |
| Organization Widget Detail | Admin, Member | -     | -   | Admin \* | Admin  |

\*Can only change `is_archived`field.

## Organization Widget List

<mark style="color:blue;">`GET`</mark> `{{ base_url }} /organizations/organizationwidget/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 " %}

```yaml
# serializer = name
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 9,
    "count": 81,
    "next": "xxx",
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "ehkn0a40x1glqvAFKP",
            "name": "Plain Text"
        },
        ...
    ]
}

# serializer = list
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 9,
    "count": 81,
    "next": "xxx",
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xxx",
            "is_archived": false,
            "change_permission": true
        },
        ...
    ]
}

# serializer = detail
{
    "page_size": 10,
    "page_number": 1,
    "page_count": 9,
    "count": 81,
    "next": "xxx",
    "previous": null,
    "add_permission": true,
    "results": [
        {
            "sid": "xx",
            "is_archived": false,
            "updated_by": "xxx",
            "date_updated": "2020-02-10T03:02:28.525127Z",
            "date_created": "2020-02-10T03:02:28.523525Z",
            "change_permission": true
        },
        ...
    ]
}
```

{% endtab %}
{% endtabs %}

## Organization Widget List

<mark style="color:green;">`POST`</mark> `{{ base_url }} /organizations/organizationwidget/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 |
| ------ | ------ | ----------- |
| widget | object |             |

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

```yaml
{
    "sid": "xx",
    "is_archived": false,
    "updated_by": "xxx",
    "date_updated": "2020-02-10T03:02:28.525127Z",
    "date_created": "2020-02-10T03:02:28.523525Z",
    "change_permission": true
}
```

{% endtab %}

{% tab title="406 " %}

```
- Error: Invaid widget sid!
- Error: the widget is not available for your organization!
```

{% endtab %}
{% endtabs %}

## Organization Widget Detail

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

#### Path Parameters

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

#### Headers

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

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

```yaml
{
    "sid": "xx",
    "is_archived": false,
    "updated_by": "xxx",
    "date_updated": "2020-02-10T03:02:28.525127Z",
    "date_created": "2020-02-10T03:02:28.523525Z",
    "change_permission": true
}
```

{% endtab %}
{% endtabs %}

## Organization Widget Detail

<mark style="color:red;">`DELETE`</mark> `{{ base_url }} /organizations/organizationwidget/detail/{sid}/`

#### Path Parameters

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

#### Headers

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

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

```
{}
```

{% endtab %}
{% endtabs %}
