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.
Put events in the same Use Case when they share custom metadata fields, even if they come from different locations, cameras, or devices. For example, a "Defect Detection" Use Case might receive events from several factories, all with line_id, shift, and part_number. Create separate Use Cases when the metadata structure is different:
Assembly Line QA:
line_id,shift,part_numberWarehouse Inventory:
aisle,shelf,item_typeConstruction Site Safety:
zone,alert_type,contractor
After events arrive, Roboflow infers a custom metadata schema from the fields and value types it sees. To see it, call Get Custom Metadata Schema.
The Roboflow Agent creates a Use Case when it builds a Workflow with Vision Events. It reuses an existing Use Case if one fits. You can also ask it to set one up.
Archiving a Use Case hides it from the default view. Its events are kept, and you can unarchive it. Events sent to an archived Use Case are still stored, but each returns a warning.
Event Value
Give events a money value to track what a Use Case is worth (ex: the cost of each defect caught). Set a default value and currency on the Use Case. New events that don't send their own value get the default; events you already sent keep their value.
An event can also send its own value in valueBaseUnits (see Create a Vision Event). The value is always in the Use Case currency. Value totals update about every 5 minutes.
Web App
Open "Vision Events" in the left sidebar of your Workspace and click "+ Create Use Case".

The Use Cases table shows each Use Case's event count, last event time, event types, and all-time value. A Use Case's Overview shows its value in the "Value Created" tile.
To set a default event value, open a Use Case's menu, click "Update Settings", and fill in "Default Event Value" and "Currency".
You can archive a Use Case from the dashboard. Click "View archived use cases" at the bottom of the table to see archived ones.

HTTP API
Unrestricted Workspace API keys have the vision-events:manage scope by default.
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 new use case in your workspace. It starts active. Requires the vision-events:manage scope.
Roboflow API key passed as a Bearer token.
A name for the use case. Leading and trailing spaces are trimmed. Must be unique within the workspace.
Value given to new events that don't send valueBaseUnits, in the smallest unit of the currency (ex: cents for USD).
5000Three-letter currency code for event values (ex: USD, EUR, JPY), in any case. Defaults to USD. An unsupported code returns 400.
USDUse case created successfully.
Use this as useCaseId when you create events.
name is missing or too long, a default value field is invalid, or another use case already has this name.
Insufficient permissions for this resource.
POST /vision-events/use-cases HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"name": "Manufacturing Line 1"
}{
"id": "a1b3c8e1",
"name": "Manufacturing Line 1"
}Notes
New use cases are created with an
activestatus by default.After creating a use case, you can reference its
idas theuseCaseIdwhen creating vision events.
Update a Use Case
Update the name, status, or default event value of an existing use case.
Required scope: vision-events:manage
Update the name, status, or default event value of an existing use case. A new default applies only to events created afterward. Requires the vision-events:manage scope.
Roboflow API key passed as a Bearer token.
The ID of the use case to update.
Send at least one field.
A new name for the use case. Must be unique within the workspace.
The new status for the use case.
Value given to new events that don't send valueBaseUnits, in the smallest unit of the currency (ex: cents for USD). null removes the default.
5000Three-letter currency code for event values (ex: USD, EUR, JPY), in any case. Send defaultValueBaseUnits too when changing the currency of a use case that has a default value.
USDUse case updated successfully.
The default event value after the update. null when unset.
The currency after the update. USD when unset.
No field was sent, a field is invalid, another use case already has this name, or the currency changed without defaultValueBaseUnits on a use case that has a default value.
Insufficient permissions for this resource.
Use case not found.
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: 31
{
"name": "Manufacturing Line 2"
}{
"id": "a1b3c8e1",
"name": "Manufacturing Line 2",
"defaultValueBaseUnits": 5000,
"defaultValueCurrency": "USD"
}List Use Cases
List the use cases 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 the use cases in your workspace with the given status, whether or not they have events. Requires the vision-events:read or device:read scope.
Roboflow API key passed as a Bearer token.
Filter by use case status. Use inactive to list archived use cases.
activePossible values: List of use cases.
The workspace's retention window in days (14 by default).
Insufficient permissions for this resource.
GET /vision-events/use-cases HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"useCases": [
{
"id": "a1b3c8e1",
"name": "Manufacturing Line 1",
"status": "active",
"workspaceId": "Xk2mP9qLr4TzW8vN1bYc",
"automationsCount": 1,
"defaultValueBaseUnits": 5000,
"defaultValueCurrency": "USD",
"createdAt": "2024-01-10T08:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": "d4e5f6a7",
"name": "Warehouse Inventory",
"status": "active",
"workspaceId": "Xk2mP9qLr4TzW8vN1bYc",
"automationsCount": 0,
"defaultValueBaseUnits": null,
"defaultValueCurrency": "USD",
"createdAt": "2024-01-12T14:00:00.000Z",
"updatedAt": "2024-01-15T09:00:00.000Z"
}
],
"lookbackDays": 14
}Archive a Use Case
Archive a use case by setting its status to inactive. Archived use cases are hidden from listings by default. Events sent to an archived use case are still stored, with an entity_not_found warning.
Required scope: vision-events:manage
Archive a use case by setting its status to inactive. Its events are kept. Events sent to it afterward are still stored, but each returns an entity_not_found warning. Archiving an archived use case succeeds. Requires the vision-events:manage scope.
Roboflow API key passed as a Bearer token.
The ID of the use case to archive.
Use case archived successfully.
Insufficient permissions for this resource.
Use case not found.
POST /vision-events/use-cases/{useCaseId}/archive HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"success": true
}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
Restore a previously archived use case by setting its status back to active. Requires the vision-events:manage scope.
Roboflow API key passed as a Bearer token.
The ID of the use case to unarchive.
Use case unarchived successfully.
Use case is not archived.
Insufficient permissions for this resource.
Use case not found.
POST /vision-events/use-cases/{useCaseId}/unarchive HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"success": true
}Notes
Only use cases with an
inactivestatus can be unarchived.Once unarchived, the use case appears in active listings again, and new events no longer return the warning.
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.
MCP Server
Connect your AI agent to the MCP Server and it can manage use cases with these tools:
vision_events_use_cases_list
List the vision event use cases in the workspace.
vision_events_use_case_create
Create a new vision event use case.
vision_events_use_case_rename
Rename an existing use case.
vision_events_use_case_archive
Archive a use case.
vision_events_use_case_unarchive
Restore a previously archived use case.
Last updated
Was this helpful?