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

# Widgets API

* [Properties](#widgets-properties)
  * [`style` properties](#widget-style-properties)
  * [`config` properties](#widget-config-properties)
* [GET /api/widgets](#GET-/api/widgets)
* [POST /api/widgets](#POST-/api/widgets)
* [GET /api/widgets/:widgetId](#GET-/api/widgets/widgetId)
* [PUT /api/widgets/:widgetId](#PUT-/api/widgets/widgetId)
* [DELETE /api/widgets/:widgetId](#DELETE-/api/widgets/widgetId)

## Widgets

Widgets refer to any touchpoint that can be embedded onto a digital property that is made up of either an "In-Line" or possibly also an "Expanded Tile" view. This endpoint allows you to create widgets and returns an embed code.

### Properties

| Field                 | Type                                | POST  | PUT   | Definition                                  |
| --------------------- | ----------------------------------- | ----- | ----- | ------------------------------------------- |
| id                    | integer                             | **X** | **X** | Widget ID                                   |
| widget\_type\_id      | integer                             | **X** | **X** | Widget type id                              |
| stack\_id             | integer                             | **X** | **X** | Widget stack Id                             |
| guid                  | string                              | **X** | **X** | Widget GUID                                 |
| style                 | [object](#widget-style-properties)  | ✔     | ✔     | Widget style config                         |
| config                | [object](#widget-config-properties) | ✔     | ✔     | Widget config                               |
| filter\_id            | integer                             | ✔     | ✔     | Content filter for widget                   |
| enabled               | boolean                             | ✔     | ✔     | Enabled widget                              |
| custom\_css           | string                              | ✔     | ✔     | Custom css for inline tile                  |
| lightbox\_custom\_css | string                              | ✔     | ✔     | Custom css for lightbox                     |
| custom\_js            | string                              | ✔     | ✔     | Custom javascript for inline tile           |
| lightbox\_custom\_js  | string                              | ✔     | ✔     | Custom javascript for lightbox              |
| external\_js          | string                              | ✔     | ✔     | URL of external js to inject to parent page |
| embed\_code           | string                              | **X** | **X** | The widget embed code                       |
| gen                   | integer                             | **X** | **X** | Version of widget                           |
| style\_name           | string                              | **X** | **X** |                                             |
| created               | string                              | **X** | **X** | ISO Date Time string                        |
| modified              | string                              | **X** | **X** | ISO Date Time string                        |
| created\_at           | timestamp                           | **X** | **X** | Moderationview's creation time              |
| updated\_at           | timestamp                           | **X** | **X** | Moderationview's modification time          |

#### `style` properties

Widget style:

* [Gallery (base\_gallery)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_gallery)
* [Waterfall (base\_waterfall)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_waterfall)
* [Carousel (base\_carousel)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_carousel)
* [Slideshow (base\_slideshow)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_slideshow)
* [Billboard (base\_billboard)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_billboard)
* [Feed (base\_feed)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_feed)
* [Blank Canvas (base\_blankcanvas)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_blankcanvas)
* [Map Leaflet (base\_map\_leaflet)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-style-base_map_leaflet)

#### `config` properties

* [Gallery (base\_gallery)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-config-base_gallery)
* [Waterfall (base\_waterfall)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-config-base_waterfall)
* [Carousel (base\_carousel)](/ugc/api-docs/rest/reference/style-and-config-properties.md#widgets-config-base_carousel)

[Back to Top](#top)

### GET widgets

Retrieves all widget available in the Stack.

#### Resource URL

`https://api.stackla.com/api/widgets`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

No additional request parameters are available.

[Back to Top](#top)

### POST widgets

Creates a new widget in the Stack.

#### Resource URL

`https://api.stackla.com/api/widgets`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

No additional request parameters are available.

[Back to Top](#top)

### GET widgets/:widgetId

Retrieves a specific widget available in the Stack by its ID.

#### Resource URL

`https://api.stackla.com/api/widgets/:widgetId`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name     | Mandatory | Request type | Description      |
| -------- | --------- | ------------ | ---------------- |
| widgetId | Yes       | endpoint     | ID of the widget |

[Back to Top](#top)

### PUT widgets/:widgetId

Updates a specific widget available in the Stack by its ID.

#### Resource URL

`https://api.stackla.com/api/widgets/:widgetId`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name     | Mandatory | Request type | Description      |
| -------- | --------- | ------------ | ---------------- |
| widgetId | Yes       | endpoint     | ID of the widget |

[Back to Top](#top)

### DELETE widgets/:widgetId

Deletes a specific widget available in the Stack by its ID.

#### Resource URL

`https://api.stackla.com/api/widgets/:widgetId`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name     | Mandatory | Request type | Description      |
| -------- | --------- | ------------ | ---------------- |
| widgetId | Yes       | endpoint     | ID of the widget |

[Back to Top](#top)
