Get public event metadata schema
GET
/public/triggers/{id}/metadata
const url = 'https://localhost:3000/api/v1/public/triggers/example/metadata';const options = {method: 'GET'};
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/public/triggers/example/metadataReturns discovered metadata fields and their inferred types from events of a public trigger. field_stats gives, for each key of fields, present and distinct (capped at 1000 with distinct_capped=true) over the same sampled events; _* server fields are removed from fields and field_stats alike.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Trigger ID (UUID)
Responses
Section titled “Responses”Metadata schema with field types
Media typeapplication/json
object
field_stats
required
FieldStats maps each key of fields to its coverage and cardinality over the 1000 most recent events sampled for the types.
object
key
additional properties
object
distinct
required
Distinct is the number of distinct values of the key, at most 1000.
integer
distinct_capped
required
DistinctCapped is true when the key has more than 1000 distinct values: distinct is then the cap.
boolean
present
required
Present is the number of sampled events holding the key.
integer
fields
required
object
key
additional properties
string
total_events_analyzed
required
integer
trigger_id
required
string format: uuid
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
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Trigger not found or not public
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal error
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}