About
This endpoint returns the custom metadata fields that have been used across the Vision Events in a given Use Case. Because custom metadata is defined per event rather than by a fixed schema, use this to discover which fields exist and their types before building event queries or dashboard filters.
HTTP API
Retrieve the schema of custom metadata fields that have been used in events for a given use case. This is useful for discovering what metadata fields are available for filtering in query requests.
Required scope: vision-events:read or device:read
Get Custom Metadata Schema
Retrieve the schema of custom metadata fields for a given use case.
Roboflow API key passed as a Bearer token.
The use case ID.
200Metadata schema.application/json
403Insufficient permissions for this resource.application/json
GET /vision-events/custom-metadata-schema/{useCaseId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/jsoncurl -L \
--request GET \
--url 'https://api.roboflow.com/vision-events/custom-metadata-schema/{useCaseId}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Accept: application/json'const response = await fetch("https://api.roboflow.com/vision-events/custom-metadata-schema/{useCaseId}", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_SECRET_TOKEN",
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "https://api.roboflow.com/vision-events/custom-metadata-schema/{useCaseId}"
headers = {
"Authorization": "Bearer YOUR_SECRET_TOKEN",
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json()){
"solution": "text",
"fields": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}{
"error": "text"
}Path Parameters
:useCaseId(string, required): The use case ID.
Example Request
curl "https://api.roboflow.com/vision-events/custom-metadata-schema/a1b3c8e1" \
-H "Authorization: Bearer YOUR_API_KEY"Example Response
{
"fields": {
"production_line": {
"types": ["string"]
},
"temperature": {
"types": ["number"]
},
"is_overtime": {
"types": ["boolean"]
}
}
}Each field in the fields object includes:
types(array of strings): The data types observed for this field, each one ofstring,number, orboolean. A field may have multiple types if different events used different types for the same key.
{
"error": "Insufficient permissions for this resource."
}Python SDK
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.
MCP Server
Connect your AI agent to the MCP Server and it can read the custom metadata schema with these tools:
| Tool | Description |
|---|---|
vision_events_custom_metadata_schema_get | Get the custom metadata schema discovered for a use case. |