For the complete documentation index, see llms.txt. This page is also available as Markdown.

Use Cases

Group Vision Events by purpose using Use Cases.

About

A Use Case groups Vision Events that share a common purpose and custom metadata structure, and every event belongs to exactly one Use Case. Organizing events this way makes it easy to filter and compare data across cameras, devices, and locations that report the same fields. This page explains when to use one Use Case versus several, and how to create and manage them.

Web App

Use Cases

A Use Case groups Vision Events that share a common purpose and custom metadata structure. Every event belongs to exactly one Use Case. Events in the same Use Case typically share the same metadata fields, making it easy to filter and compare data across different sources.

When to Use One vs. Multiple Use Cases

Put events in the same Use Case when they share similar custom metadata fields even if they come from different locations, cameras, or devices. For example, a "Defect Detection" Use Case might receive events from multiple factories, but all events include line_id, shift, and part_number.

Create separate Use Cases when the metadata structure is fundamentally different. For example:

  • Assembly Line QA - tracks line_id, shift, part_number

  • Warehouse Inventory - tracks aisle, shelf, item_type

  • Construction Site Safety - tracks zone, alert_type, contractor

Create a Use Case

Via the Agent

The Roboflow Agent creates Use Cases automatically when it builds a Workflow with Vision Events. It picks an existing Use Case if one fits, or creates a new one based on your described use case. You can also ask the Agent directly to set up a new Use Case.

In the Dashboard

  1. Navigate to Vision Events in the left sidebar of your workspace

  2. Click + Create Use Case

  3. Enter a name for the Use Case

You can also create Use Cases via the REST API, see Manage Use Cases Programmatically.

View Use Cases

In the Dashboard

The Vision Events page displays a table of all your Use Cases, showing:

  • Use Case name

  • Total event count

  • Last event timestamp

  • Event types in use

Via the API

Retrieve all Use Cases in your workspace:

See the Vision Events API Reference for the full response format.

Manage Use Cases Programmatically

In addition to the dashboard, you can create, rename, archive, and unarchive Use Cases via the REST API. These endpoints require an API key with the vision-events:manage scope (unrestricted workspace API keys have access by default).

Create a Use Case

Rename a Use Case

Archive or Unarchive a Use Case

Archive a Use Case

Use Cases can be archived from the dashboard when they are no longer needed. Archived Use Cases and their events remain accessible but are hidden from the default view. Click View archived use cases at the bottom of the Use Cases table to see them.

Custom Metadata Schema

After events are sent to a Use Case, the system infers a metadata schema based on the fields and value types observed. You can retrieve the inferred schema for a Use Case to understand what keys and value types are in use:

Example response:

See the Vision Events API Reference for full details.

HTTP API

Create a Use Case

Create a new use case in your workspace. Use cases help you organize vision events by deployment context (e.g., "Manufacturing Line 1", "Warehouse Inventory").

Required scope: vision-events:manage

Create a Use Case

post

Create a new use case in your workspace.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Body
namestring · min: 1 · max: 256Required

A name for the use case. Must be unique within the workspace.

Responses
201

Use case created successfully.

application/json
idstringOptional
namestringOptional
post/vision-events/use-cases
POST /vision-events/use-cases HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "name": "text"
}
{
  "id": "text",
  "name": "text"
}

Request Body Parameters

  • name (string, required): A name for the use case. Must be between 1 and 256 characters. The name is trimmed of leading/trailing whitespace and must be unique within the workspace.

Example Request

Example Response

Notes

  • New use cases are created with an active status by default.

  • Use case names must be unique within a workspace. Attempting to create a use case with the same name as an existing one will return a 400 error.

  • After creating a use case, you can reference its id as the useCaseId when creating vision events.

Update a Use Case

Update the name or status of an existing use case.

Required scope: vision-events:manage

Update a Use Case

put

Update the name or status of an existing use case.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Path parameters
useCaseIdstringRequired

The ID of the use case to update.

Body
namestring · min: 1 · max: 256Optional

A new name for the use case. Must be unique within the workspace.

statusstring · enumOptional

The new status for the use case.

Possible values:
Responses
200

Use case updated successfully.

application/json
idstringOptional
namestringOptional
put/vision-events/use-cases/{useCaseId}
PUT /vision-events/use-cases/{useCaseId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 33

{
  "name": "text",
  "status": "active"
}
{
  "id": "text",
  "name": "text"
}

Path Parameters

  • useCaseId (string, required): The ID of the use case to update.

Request Body Parameters

At least one of the following fields must be provided:

  • name (string, optional): A new name for the use case. Must be between 1 and 256 characters. Must be unique within the workspace.

  • status (string, optional): The new status. One of active or inactive.

Example Request

Example Response

List Use Cases

List all use cases that have recorded vision events in your workspace. To learn how to create and manage use cases, see the Use Cases documentation.

Required scope: vision-events:read or device:read

List Use Cases

get

List all use cases that have recorded vision events in your workspace.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Query parameters
statusstring · enumOptional

Filter by use case status. Defaults to active.

Default: activePossible values:
Responses
200

List of use cases.

application/json
lookbackDaysintegerOptional
get/vision-events/use-cases
GET /vision-events/use-cases HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "useCases": [
    {
      "id": "text",
      "name": "text",
      "status": "active",
      "workspaceId": "text",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-01-01T00:00:00.000Z"
    }
  ],
  "lookbackDays": 1
}

Query Parameters

  • status (string, optional): Filter by use case status. One of active or inactive. Defaults to active.

Example Request

Example Response

Archive a Use Case

Archive a use case by setting its status to inactive. Archived use cases are hidden from listings by default and will reject new event ingestion.

Required scope: vision-events:manage

Archive a Use Case

post

Archive a use case by setting its status to inactive.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Path parameters
useCaseIdstringRequired

The ID of the use case to archive.

Responses
200

Use case archived successfully.

application/json
successbooleanOptional
post/vision-events/use-cases/{useCaseId}/archive
POST /vision-events/use-cases/{useCaseId}/archive HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "success": true
}

Path Parameters

  • useCaseId (string, required): The ID of the use case to archive.

Example Request

Example Response

Notes

  • Archiving is a soft delete. The use case and its events are preserved but hidden from active listings.

  • To view archived use cases, use the List Use Cases endpoint with status=inactive.

  • You can restore an archived use case using the Unarchive a Use Case endpoint.

Unarchive a Use Case

Restore a previously archived use case by setting its status back to active.

Required scope: vision-events:manage

Unarchive a Use Case

post

Restore a previously archived use case by setting its status back to active.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Path parameters
useCaseIdstringRequired

The ID of the use case to unarchive.

Responses
200

Use case unarchived successfully.

application/json
successbooleanOptional
post/vision-events/use-cases/{useCaseId}/unarchive
POST /vision-events/use-cases/{useCaseId}/unarchive HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "success": true
}

Path Parameters

  • useCaseId (string, required): The ID of the use case to unarchive.

Example Request

Example Response

Notes

  • Only use cases with an inactive status can be unarchived. Attempting to unarchive an already active use case will return a 400 error.

  • Once unarchived, the use case will appear in active listings and accept new event ingestion again.

Python SDK

Each vision event is associated with a use case. The Python SDK provides methods to create, list, rename, archive, and unarchive use cases.

List Use Cases

You can filter by status:

Create a Use Case

Rename a Use Case

Archive a Use Case

Unarchive a Use Case

For more details on use case management, see the REST API reference.

Last updated

Was this helpful?