Metadata schema of a set of triggers
const url = 'https://localhost:3000/api/v1/events/schema';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/events/schema \ --header 'Authorization: <Authorization>'Returns the merged metadata schema of several triggers in one call. Exactly one scope parameter: owner (personal or tenant:{id}, without triggers shared through access), scope=all (personal, organizations and shared triggers), group_id, or trigger_ids (50 max); none or several: 400. Same scope rules as GET /events: unreadable triggers are ignored (trigger_ids returns skipped_trigger_ids), inaccessible owner or group: 404, API key with trigger:stats per trigger and tenant:read:{id} for an organization, truncated=true beyond 10000 triggers (scope=all) or 500 (others), never 400. For each trigger, the same 1000 recent events as GET /triggers/{id}/metadata, limited to the last 30 days; fields is the union of the fields, and a key seen with several types keeps the smallest in alphabetical order (array, boolean, null, number, object, string), as on a single trigger. total_events_analyzed is the number of sampled events. field_stats gives, for each key of fields and over those same sampled events, present (events holding the key) and distinct (distinct values, capped at 1000 with distinct_capped=true), computed in the same single query. If a trigger of the scope is only readable through its public visibility (other owner), all _* server fields are removed from the schema.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Scope: personal or tenant:{id}
Scope: all
Scope: group ID (UUID)
Scope: comma-separated trigger IDs (50 max)
Responses
Section titled “Responses”Merged schema
object
FieldStats maps each key of fields to its coverage and cardinality over the same sampled events as total_events_analyzed.
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.
Fields maps each key found in the sampled events to its type; a key seen with several types keeps the smallest one in alphabetical order.
object
SkippedTriggerIDs lists the requested trigger_ids that do not exist or that the caller may not read (the two cases are not told apart). Empty for the other scopes.
TotalEventsAnalyzed is the number of events sampled (at most 1000 per trigger, last 30 days), not the number of events of the triggers.
Truncated is true when the scope holds more readable triggers than the cap (10000 for scope=all, 500 otherwise): only the oldest ones are read.
Example
{ "field_stats": { "additionalProperty": { "distinct": 12, "distinct_capped": false, "present": 14000 } }, "fields": { "count": "number", "page": "string" }, "skipped_trigger_ids": [ "550e8400-e29b-41d4-a716-446655440000" ], "total_events_analyzed": 15234, "truncated": false}Invalid request
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Unauthorized
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Owner or group not found
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Too many concurrent calls
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Erreur interne
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}Timeout
object
Example
{ "error": "invalid_request", "message": "Invalid request body"}