Batch Create Vision Events

Create multiple vision events in a single request. The server allows up to 100 events per batch.

import roboflow

roboflow.login()

rf = roboflow.Roboflow()
ws = rf.workspace()

result = ws.write_vision_events_batch([
    {
        "eventId": "e5f6a7b8-c3d4-4e5f-a0b1-c2d3e4f5a6b7",
        "eventType": "quality_check",
        "useCaseId": "a1b3c8e1",
        "timestamp": "2024-01-15T10:00:00Z",
        "eventData": {"result": "pass"},
    },
    {
        "eventId": "f6a7b8c9-d4e5-4f6a-b1c2-d3e4f5a6b7c8",
        "eventType": "quality_check",
        "useCaseId": "a1b3c8e1",
        "timestamp": "2024-01-15T10:01:00Z",
        "eventData": {"result": "fail"},
        "customMetadata": {"line": "A1"},
    },
])

print(result["created"])    # Number of events created
print(result["eventIds"])   # List of created event IDs

Each event in the list follows the same schema as a single event. For full details on event schemas and validation behavior, see the REST API reference.

Last updated

Was this helpful?