How This Helps
Saved views capture filter states as named, reusable queries attached to a dataset. Every view automatically tracks how result counts change over time as new media arrives, and alerting notifies all dataset collaborators when new matches are detected.
Prerequisites
- A Visual Layer Cloud account with API access.
- A valid JWT token. See Authentication.
- A dataset ID. Find it in the browser URL when viewing a dataset (
https://app.visual-layer.com/dataset/<dataset_id>/data) or via the Datasets API.
Create a View
Save the current filter state of a dataset as a named view. Monitoring is enabled automatically on all new views, and alerting defaults to enabled.Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
dataset_id | path | UUID | Yes | The dataset to attach the view to. |
name | form field | string | Yes | Display name for the view. Must be unique within the dataset. |
entity_type | query | string | No | Entity filter: IMAGES, OBJECTS, or VIDEOS. |
threshold | query | number | No | Similarity threshold (0–1). |
caption | query | string | No | Semantic search query to save with the view. |
vql | query | string | No | URL-encoded VQL filter array. |
Example
Response (200)
id from the response for use with trend, alerting, and delete operations.
The
stats fields show -1 at creation time because the view has not yet been evaluated against any data batch. Values populate after the first monitoring evaluation.List Views
Retrieve all saved views for a dataset, including their current monitoring state and result counts.Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
dataset_id | path | UUID | Yes | The dataset to list views for. |
Example
Response (200)
Delete a View
Remove a saved view and its associated trend data from a dataset.Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
dataset_id | path | UUID | Yes | The dataset the view belongs to. |
view_id | path | UUID | Yes | The view to delete. |
Example
null body. Deleting a view also removes its trend history and stops all associated alerting.
Get View Trend Data
Retrieve the monitoring trend history for a view. Each data point represents one batch evaluation, showing how many new items matched the view filters when that batch was processed.Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
dataset_id | path | UUID | Yes | The dataset the view belongs to. |
view_id | path | UUID | Yes | The view to retrieve trend data for. Monitoring must be enabled. |
Example
Response (200)
Trend Point Fields
| Field | Type | Description |
|---|---|---|
timestamp | datetime | When the batch was processed. |
batch_id | UUID | The media batch that was evaluated. |
count | integer | Number of new items matching the view filters in this batch. |
cumulative | integer | Running total of all matching items across all evaluated batches. |
Returns HTTP 400 if monitoring is not enabled for the view. Returns HTTP 404 if the view does not exist or does not belong to the specified dataset.
Enable or Disable Alerting
Control whether a monitored view sends alert notifications when new matches are detected. Monitoring (trend data collection) continues regardless of this setting.Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
dataset_id | path | UUID | Yes | The dataset the view belongs to. |
view_id | path | UUID | Yes | The view to configure alerting for. |
enabled | body (JSON) | boolean | Yes | true to enable alerts, false to disable. |
Request Body
The
enabled field is nested inside a request object in the JSON body.Example
Response (200)
Python Example
Response Codes
See Error Handling for the error response format and Python handling patterns.Views Endpoints
| HTTP Code | Meaning | Common Cause |
|---|---|---|
| 200 | Request successful. | |
| 400 | Bad request. | Monitoring not enabled for the view (trend/alerting endpoints). |
| 401 | Unauthorized. | Invalid or expired JWT token. |
| 404 | Not found. | Dataset or view does not exist, or the view does not belong to the specified dataset. |
| 422 | Validation error. | Missing required fields or malformed request body. |
| 500 | Internal server error. | Contact support if this persists. |
Best Practices
- Create views before adding media. Monitoring evaluates only batches that arrive after the view was created. Views created after a media addition do not retroactively evaluate older batches.
- Use descriptive view names. View names appear in alert notifications and trend charts. Clear names like “Damaged windshields” or “Mislabeled training data” make alerts immediately actionable.
- Disable alerting for informational views. If a view tracks long-term trends but does not require immediate attention, disable alerting to reduce notification noise while keeping trend data collection active.
- Poll trend data for dashboards. The trend endpoint returns cumulative counts suitable for building monitoring dashboards. Poll periodically after batch additions to track data quality over time.
- Delete unused views. Each view is evaluated on every batch addition. Removing views that are no longer needed reduces processing overhead.
Related Resources
Notifications API
List, read, and manage alert notifications delivered by monitored views.
Saved Views
Create and manage saved views through the Visual Layer UI.
Monitoring and Alerts
Understand how monitoring and alerting works across your datasets.
Add Media
Add media to datasets, triggering monitoring evaluation on all views.