# Views

> The Views operations of the Hub REST API (4 operations).

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

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

## GET /views

List views

Returns the user's views in a workspace, optionally filtered by view type or profile.

Parameters:

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `userId` | query | string | yes |  |
| `workspaceId` | query | string |  |  |
| `type` | query | string |  | Filter by view type (table, kanban, ...). |
| `profileId` | query | string |  | Filter to views over a specific profile. |

Responses:

- `200`: Array of views
- `400`: Missing required param
- `403`: Forbidden
- `500`: Internal error

## POST /views

Create a view

Creates a view (table, kanban, bento, etc.) over the entity store.

Request body (`application/json`): CreateViewRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `userId` | string | yes |  |
| `workspaceId` | string \| null |  |  |
| `name` | string | yes |  |
| `type` | string | yes | View type — table, list, grid, gallery, kanban, matrix, masonry, calendar, flow, bento, branch_tree, whiteboard. |
| `profileId` | string |  |  |
| `config` | object |  |  |
| `metadata` | object |  |  |
| `agentUserId` | string |  |  |
| `reasoning` | string |  |  |
| `sourceMessageId` | string |  |  |
| `expectedLabel` | string |  |  |

Responses:

- `200`: Created view
- `400`: Bad request
- `403`: Forbidden
- `500`: Internal error

## PATCH /views/{viewId}

Update a view

Patch view name, config, or metadata.

Parameters:

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `viewId` | path | string | yes |  |

Request body (`application/json`): UpdateViewRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `userId` | string | yes |  |
| `workspaceId` | string |  |  |
| `name` | string |  |  |
| `config` | object |  |  |
| `metadata` | object |  |  |
| `agentUserId` | string |  |  |
| `reasoning` | string |  |  |
| `sourceMessageId` | string |  |  |

Responses:

- `200`: Updated view
- `400`: Bad request
- `403`: Forbidden
- `500`: Internal error

## POST /views/{viewId}/arrange

Reorder/arrange widgets in a bento view

Replaces the widget arrangement for a bento-type view. Widget IDs must reference existing cell instances in the view.

Parameters:

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `viewId` | path | string | yes |  |

Request body (`application/json`): ArrangeViewRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `userId` | string | yes |  |
| `workspaceId` | string |  |  |
| `widgets` | array<BentoWidget> | yes | Replacement widget arrangement for a bento view. |
| `agentUserId` | string |  |  |
| `reasoning` | string |  |  |
| `sourceMessageId` | string |  |  |

Responses:

- `200`: Updated view
- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal error
