Skip to content

Metadata schema of a set of triggers

GET
/events/schema
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.

owner
string

Scope: personal or tenant:{id}

scope
string

Scope: all

group_id
string

Scope: group ID (UUID)

trigger_ids
string

Scope: comma-separated trigger IDs (50 max)

Merged schema

Media typeapplication/json
object
field_stats
required

FieldStats maps each key of fields to its coverage and cardinality over the same sampled events as total_events_analyzed.

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

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
key
additional properties
string
skipped_trigger_ids
required

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.

Array<string>
total_events_analyzed
required

TotalEventsAnalyzed is the number of events sampled (at most 1000 per trigger, last 30 days), not the number of events of the triggers.

integer
truncated
required

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.

boolean

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

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Unauthorized

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Owner or group not found

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Too many concurrent calls

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Erreur interne

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}

Timeout

Media typeapplication/json
object
error
required
string
message
string

Example

{
"error": "invalid_request",
"message": "Invalid request body"
}