Get Custom Metadata Schema

Discover the custom metadata fields that have been used in events for a given use case. This is useful for building queries with customMetadataFilters.

import roboflow

roboflow.login()

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

schema = ws.get_vision_event_metadata_schema("a1b3c8e1")

for field, info in schema["fields"].items():
    print(f"{field}: {info['types']}")

The response contains a fields dict mapping each discovered field name to its observed types (e.g., ["string"], ["number"]). You can use this information to construct typed filters when querying events:

page = ws.query_vision_events(
    "a1b3c8e1",
    customMetadataFilters=[
        {"field": "temperature", "operator": "gt", "value": 70, "type": "number"}
    ],
)

For more details, see the REST API reference.

Last updated

Was this helpful?