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

Create a Vision Event

Record a single Vision Event via the HTTP API to log an observation from your deployed model.

About

A Vision Event is a timestamped record of something your deployed computer vision model observed - for example a detected defect or an inventory count - along with optional images, predictions, and custom metadata. This page shows how to record a single event so it becomes part of your searchable, filterable production history. To ingest many events at once, use Batch Create Vision Events. If your deployment has no route to the cloud, see Upload a Vision Event Bundle.

HTTP API

Create a single vision event to record an observation from your computer vision deployment.

Required scope: vision-events:write or device:update

Create a Vision Event

post

Create a single vision event. Only eventId, eventType, useCaseId, and timestamp are strictly checked. Problems in other fields are returned as warnings, and the event is still stored. Sending an eventId that already exists replaces the earlier event. Requires the vision-events:write or device:update scope.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Body
eventIdstring · max: 256Required

Globally unique identifier. Use a UUID (v4). An event sent with an eventId that already exists overwrites the earlier event.

eventTypestring · enumRequiredPossible values:
useCaseIdstring · max: 256Required

The use case this event belongs to. An ID that matches no active use case in the workspace (ex: an archived one) still stores the event, with an entity_not_found warning.

timestampstring · date-timeRequired

ISO 8601 timestamp. A timestamp more than one year old or later than tomorrow is stored, but returns an invalid_value warning.

deviceIdstring · max: 256Optional

Identifier for the device that generated the event.

streamIdstring · max: 256Optional

Identifier for the video stream.

workflowIdstring · max: 256Optional

Identifier for the workflow that generated the event.

workflowVersionstring · max: 64Optional

Version of the workflow.

displayImagePositioninteger · max: 999Optional

Index in images of the image to show as the main display image (ex: 0 for the first image, 1 for the second).

autoFinalizedAtstring · date-timeOptional

Set by Edge Device Backup when the device closed the event before its video finished uploading, so the video is missing.

eventDataone ofRequired

Type-specific event data. Use the schema whose name matches eventType.

or
or
or
or
commentstring · max: 1000Optional

A note about the event. With operator_feedback, this holds the reviewer's note.

valueBaseUnitsinteger · min: -10000000000 · max: 10000000000Optional

The event's money value in the smallest unit of the use case currency (ex: cents for USD). If omitted, the use case default applies. An invalid value is dropped with an ingestion warning. operator_feedback events never carry a value.

Example: 1999
valueCurrencystringRead-onlyOptional

The currency of valueBaseUnits, taken from the use case. Returned on queried events that have a value. Events cannot set it.

Example: USD
Responses
201

Event created successfully.

application/json
eventIdstringOptional
createdbooleanOptional
deprecationsstring[]Optional

Deprecated field names used in the request.

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

{
  "eventId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "eventType": "quality_check",
  "useCaseId": "a1b3c8e1",
  "timestamp": "2024-01-15T10:30:00Z",
  "eventData": {
    "result": "fail",
    "externalId": "batch-001"
  },
  "customMetadata": {
    "line": "A1",
    "operator": "John Doe",
    "temperature": 72.5
  }
}
{
  "eventId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "created": true,
  "warnings": [
    {
      "type": "invalid_value",
      "path": "eventData.result",
      "value": "failed",
      "valueType": "string"
    }
  ]
}

Image Metadata

Use metadata on an image object to record values that belong to that image alone, such as a pass/fail verdict, a serial number, or a camera angle. Values are shown with the image in the event detail view. To attach values that describe the whole event, use customMetadata instead.

Keys that break the metadata limits are dropped and reported in the warnings array. The rest of the image is still stored.

To see which keys your events use, call Get Image Metadata Schema. To filter events by these keys, use imageMetadataFilters in Query Events.

Validation and Warnings

The Vision Events API uses eager ingestion. Only the four required fields (eventId, eventType, useCaseId, timestamp) are strictly validated. If these pass, the event is always accepted and stored, even if other fields contain errors.

Any issues with non-required fields are returned as a warnings array in the response rather than causing a rejection. This includes:

  • Missing required fields within eventData (ex: relatedEventId for operator_feedback)

  • Invalid values for eventData fields (ex: a wrong enum value for severity)

  • Unrecognized fields that are not part of the schema

When warnings are present, the invalid eventData is stored as an empty object {}, but the event itself is still created.

The response may also include a deprecations array if deprecated field names were used.

Python SDK

Create a single vision event to record an observation from your computer vision deployment.

The event payload is passed directly to the server with no client-side validation, so new event types and fields work without an SDK update.

Required fields:

  • eventId (string, max 256 characters): Globally unique identifier. Use a UUID (v4).

  • eventType (string): One of quality_check, inventory_count, safety_alert, custom, or operator_feedback.

  • useCaseId (string): The use case this event belongs to.

  • timestamp (string, ISO 8601): When the event occurred.

Optional fields:

  • eventData (dict): Type-specific event data.

  • deviceId, streamId, workflowId (string): Context identifiers.

  • images (list): Image objects with annotations. See Upload a Vision Event Image.

  • videos (list): Video objects. Get each sourceId from Upload a Vision Event Video.

  • customMetadata (dict): Up to 100 key-value pairs of custom metadata.

  • comment (string): A note about the event, mainly used with operator_feedback.

For the full event schema, event data structures per type, and image annotation formats, see the REST API reference.

Last updated

Was this helpful?