# Vision Events

The Vision Events API lets you record structured events from your computer vision deployments, then query and analyze them. Events can include images, detection annotations, custom metadata, and type-specific data for quality checks, inventory counts, safety alerts, and more.

With the Vision Events API, you can:

* [Upload a Vision Event Image](https://docs.roboflow.com/developer/rest-api/vision-events/upload-a-vision-event-image)
* [Create a Vision Event](https://docs.roboflow.com/developer/rest-api/vision-events/create-a-vision-event)
* [Batch Create Vision Events](https://docs.roboflow.com/developer/rest-api/vision-events/batch-create-vision-events)
* [Query Vision Events](https://docs.roboflow.com/developer/rest-api/vision-events/query-vision-events)
* [List Use Cases](https://docs.roboflow.com/developer/rest-api/vision-events/list-use-cases)
* [Get Custom Metadata Schema](https://docs.roboflow.com/developer/rest-api/vision-events/get-custom-metadata-schema)

## Authentication

All Vision Events endpoints use Bearer token authentication with your Roboflow API key:

```
Authorization: Bearer YOUR_API_KEY
```

Vision Events endpoints require specific [scoped API key](https://docs.roboflow.com/developer/authentication/scoped-api-keys) permissions:

* **Read operations** (query, list, schema): `vision-events:read` or `device:read`
* **Write operations** (create, batch, upload): `vision-events:write` or `device:update`

## Use Cases

Each vision event is associated with a use case. To learn how to create and manage use cases, see the [Use Cases documentation](https://docs.roboflow.com/deploy/vision-events/use-cases).

You can also [list existing use cases](https://docs.roboflow.com/developer/rest-api/vision-events/list-use-cases) that have recorded events via the API.

## Event Types

The API supports five event types, each with its own `eventData` schema:

| Event Type          | Description                         |
| ------------------- | ----------------------------------- |
| `quality_check`     | QA and inspection results           |
| `inventory_count`   | Inventory measurements              |
| `safety_alert`      | Safety incidents and alerts         |
| `custom`            | Freeform event data                 |
| `operator_feedback` | Human feedback on model predictions |

## Data Retention

Events are retained for a configurable lookback window (default: 14 days). The `lookbackDays` value is returned in query responses so you know the effective retention period for your workspace.
