{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://api.quanor.com/api/docs/stream/webhook_message.v1.schema.json","title":"A webhook endpoint's message","$comment":"The body of every POST a webhook endpoint sends (docs/webhooks.md; examples and the headers in webhook_message.v1.json). A message carries events from one track, one webhook_endpoint.reset alone, or one webhook_endpoint.tested alone — a test the customer asked for, sent outside the tracks' order. It is not a CloudEvents batch: each of its events is a structured-mode CloudEvent whose type's JSON Schemas are in docs/wire/events/: route it by type and de-duplicate it by id. An event of a type version 1 does not name is to be ignored, and so is a field a message or an event does not name: both are added within version 1. A body is at most limits.max_body_bytes (webhook_message.v1.json).","type":"object","required":["v","webhook_endpoint_id","events"],"properties":{"v":{"const":1},"webhook_endpoint_id":{"type":"string","format":"uuid","description":"The endpoint the message is for."},"track":{"description":"The track the message belongs to: the ordered series of changes its events come from. feed carries the feed's items (announcements and pre-earnings analyses). Absent on a test, which belongs to no track. Version 1 may add other tracks: company data will arrive on one of its own.","anyOf":[{"enum":["feed"]},{"type":"string"}]},"generation":{"type":"integer","minimum":1,"description":"The track's generation: every reset and every rewind begins the next. Ignore a message of an older generation than the one you hold; an event of a newer one wins over what you hold of its subject, whatever its sequence."},"since":{"$ref":"https://api.quanor.com/api/docs/events/event.v1.schema.json#/$defs/track_cursor","description":"Where the message's events begin on its track: they are every change after it, up to through."},"through":{"$ref":"https://api.quanor.com/api/docs/events/event.v1.schema.json#/$defs/track_cursor","description":"Where the message's events end on its track: keep it with your copy, as the cursor to rewind the track to."},"complete":{"type":"boolean","description":"true when the message brought you up to the newest change there was when it was built. You need not act on it."},"access_version":{"type":"string","minLength":1,"description":"Your key's access when the message was built. Pages of /v1/feed carry it too. If your copy was loaded under another, reload it."},"events":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/event"}}},"allOf":[{"$comment":"A message of a track names its generation and the access it was made under.","if":{"required":["track"]},"then":{"required":["generation","access_version"]}},{"$comment":"A message of events names its cursors.","if":{"required":["since"]},"then":{"required":["track","through","complete"]}}],"$defs":{"event":{"anyOf":[{"$ref":"https://api.quanor.com/api/docs/events/announcement.updated.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/announcement.withdrawn.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/announcement.hidden.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/pre_earnings_analysis.updated.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/pre_earnings_analysis.withdrawn.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/pre_earnings_analysis.hidden.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/webhook_endpoint.reset.v1.schema.json"},{"$ref":"https://api.quanor.com/api/docs/events/webhook_endpoint.tested.v1.schema.json"},{"$ref":"#/$defs/unknown_event"}]},"unknown_event":{"description":"An event of a type version 1 does not name: ignore it.","allOf":[{"$ref":"https://api.quanor.com/api/docs/events/event.v1.schema.json"},{"properties":{"type":{"not":{"enum":["announcement.updated","announcement.withdrawn","announcement.hidden","pre_earnings_analysis.updated","pre_earnings_analysis.withdrawn","pre_earnings_analysis.hidden","webhook_endpoint.reset","webhook_endpoint.tested"]}}}}]}}}