Get event metadata schema
const url = 'https://localhost:3000/api/v1/triggers/example/metadata';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://localhost:3000/api/v1/triggers/example/metadata \ --header 'Authorization: <Authorization>'Returns discovered metadata fields and their inferred types from events of a trigger. field_stats gives, for each key of fields and over the same 1000 most recent events sampled for the types, present (events holding the key) and distinct (distinct values, capped at 1000 with distinct_capped=true), same computation as GET /events/schema. If the trigger is only readable through its public visibility (other owner), all _* server fields are removed from fields and field_stats.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Trigger ID (UUID)
Responses
Section titled “Responses”Metadata schema with field types
object
FieldStats maps each key of fields to its coverage and cardinality over the 1000 most recent events sampled for the types.
object
object
Distinct is the number of distinct values of the key, at most 1000.
DistinctCapped is true when the key has more than 1000 distinct values: distinct is then the cap.
Present is the number of sampled events holding the key.
object
Example
{ "field_stats": { "additionalProperty": { "distinct": 12, "distinct_capped": false, "present": 14000 } }, "fields": { "count": "number", "page": "string", "userId": "string" }, "total_events_analyzed": 15234, "trigger_id": "550e8400-e29b-41d4-a716-446655440000"}Invalid request
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Unauthorized
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Insufficient permissions
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Trigger not found
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal error
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}