# Widgets

> The Widgets operations of the Hub REST API (2 operations).

URL: https://docs.synap.live/docs/reference/hub-api/widgets · Generated from Synap-core/backend@c31e261ab (main)

Paths are relative to `/api/hub` on a pod.

## GET /widget-definitions

List widget definitions

Parameters:

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `workspaceId` | query | string |  |  |

Responses:

- `200`: Widget definitions
- `403`: Forbidden
- `500`: Internal error

## POST /widget-definitions

Register or update a widget definition

Request body (`application/json`): UpsertWidgetDefRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `userId` | string |  |  |
| `workspaceId` | string \| null |  |  |
| `kind` | string | yes |  |
| `name` | string |  |  |
| `category` | string |  |  |
| `config` | object |  |  |
| `schema` | object |  |  |
| `sourceMessageId` | string |  |  |

Responses:

- `200`: Upserted widget definition
- `400`: Bad request
- `403`: Forbidden
- `500`: Internal error
