Messages and Payloads
Document async API messages with payload schemas, headers, correlation IDs, protocol bindings, and realistic examples. Apply message traits for cross-cutting concerns.
Messages define the structure and semantics of data exchanged through async API channels. Each message documents its payload schema, headers, correlation mechanism, protocol-specific bindings, and concrete examples.
Message Structure
Payload Schemas
Message payloads reference schemas defined in the Schema Editor. This keeps message structures consistent with your data model and enables end-to-end data lineage from event payloads to database entities.
Example: Order Event Payload Schema
Payload for order lifecycle events. Contains the order details at the time the event was emitted, including customer reference, line items summary, and current status.
Example: Shared Event Headers Schema
Standard headers for event-driven messages. Provides correlation, tracing, and metadata fields that apply across all async API messages.
Correlation IDs
Correlation IDs enable distributed tracing across services. Each message can define a correlation ID with a location expression that tells consumers where to find the identifier.
{
"correlationId": {
"description": "UUID correlation identifier propagated across service boundaries",
"location": "$message.header#/correlationId"
}
}
Message Examples
Each message can include multiple examples with name, summary, headers JSON, and payload JSON. Examples are displayed with syntax highlighting in the published viewer.
Order Created Event
Payment Processed Event
Inventory Updated Event
Message Traits
Message traits define reusable cross-cutting properties that apply to multiple messages. Common use cases include standard headers for correlation, auditing, and CloudEvents envelopes.