Get Custom Metadata Schema

Retrieve the custom metadata fields and types used across Vision Events in a Use Case.

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

gethttps://api.roboflow.com/vision-events/custom-metadata-schema/{useCaseId}

Retrieve the schema of custom metadata fields for a given use case.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Path parameters
useCaseIdstringRequired

The use case ID.

Responses
200Metadata schema.application/json
solutionstringOptional
fieldsobjectOptional
403Insufficient permissions for this resource.application/json
errorstringOptional
get/vision-events/custom-metadata-schema/{useCaseId}
GET /vision-events/custom-metadata-schema/{useCaseId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
200Metadata schema.
{
  "solution": "text",
  "fields": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

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 of string, number, or boolean. A field may have multiple types if different events used different types for the same key.

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:

ToolDescription
vision_events_custom_metadata_schema_getGet the custom metadata schema discovered for a use case.