CloudEvents is a protocol-agnostic standard for describing and exchanging events across technologies. It improves interoperability and avoids inventing a provider-specific event format for webhooks and callbacks. section 14.6.4 section 16.2.1
A transaction notification
A banking notification sends a real-time HTTP request with Content-Type application/cloudevents+json. Its event object includes specversion 1.0, type com.banking.transaction.new, source /transactions, id 123456, and transaction-specific data. The concatenation of source and id uniquely identifies the event. section 14.6.4
Choose the event shape according to delivery and payload needs:
- Send one event at a time for real-time notifications, or use application/cloudevents-batch+json for a JSON array of events. section 14.6.4
- Use lightweight events that point to a resource when data is large or volatile; reserve heavyweight events for small, static data. section 14.7.2 section 14.9
- Apply the same format to webhooks and callbacks, while offering retrieval alternatives when consumers cannot receive webhooks. section 14.7.2 section 14.9
Figure 14.8 The banking notification system notifies a consumer about a new transaction with a POST request whose body uses the CloudEvents format.
Inspect the webhook POST example to connect CloudEvents fields with a consumer notification flow. section 14.6.4


