name: design-an-event-streaming-api
description: Defines an event stream contract with schemas, delivery semantics, replay, and backpressure. Use when the user needs a streaming API for ordered domain events.
domain: api-design
tags: [event-streaming, messaging, event-contracts]
triggers: ["event streaming api", "design a streaming event contract", "specify event topic retention"]
Defines an event stream contract with schemas, delivery semantics, replay, and backpressure
Purpose
Defines an event stream contract with schemas, delivery semantics, replay, and backpressure.
When to use
Use when the user needs a streaming API for ordered domain events.
When NOT to use
Do not use this for internal function signatures; use software-engineering instead.
Inputs required
- The consumers and what they need
- The resources and the operations involved
- The versioning, auth and rate-limit policy
Procedure
- Define event topics, keys, producers, and the fields in each envelope.
- Specify schema versions and rules for evolving event payloads.
- Choose delivery, ordering, acknowledgement, and consumer-offset semantics.
- Define retention, replay, backpressure, and failure handling.
- Document authentication, rate limits, and observability for the stream.
Output contract
A documented contract with endpoints, payloads, error shapes and versioning rules.
Validation checklist
Safety notes
Never change an existing response shape without a version bump and a migration note.
Related skills
design-an-authentication-flow
design-an-authorization-model
design-an-error-response-format
1---2name: design-an-event-streaming-api3description: Defines an event stream contract with schemas, delivery semantics, replay, and backpressure. Use when the user needs a streaming API for ordered domain events.4---5---6name: design-an-event-streaming-api7description: Defines an event stream contract with schemas, delivery semantics, replay, and backpressure. Use when the user needs a streaming API for ordered domain events.8domain: api-design9tags: [event-streaming, messaging, event-contracts]10triggers: ["event streaming api", "design a streaming event contract", "specify event topic retention"]11---1213# Defines an event stream contract with schemas, delivery semantics, replay, and backpressure1415## Purpose1617Defines an event stream contract with schemas, delivery semantics, replay, and backpressure.1819## When to use2021Use when the user needs a streaming API for ordered domain events.2223## When NOT to use2425Do not use this for internal function signatures; use software-engineering instead.2627## Inputs required2829- The consumers and what they need30- The resources and the operations involved31- The versioning, auth and rate-limit policy3233## Procedure34351. Define event topics, keys, producers, and the fields in each envelope.362. Specify schema versions and rules for evolving event payloads.373. Choose delivery, ordering, acknowledgement, and consumer-offset semantics.384. Define retention, replay, backpressure, and failure handling.395. Document authentication, rate limits, and observability for the stream.4041## Output contract4243A documented contract with endpoints, payloads, error shapes and versioning rules.4445## Validation checklist4647- [ ] Every error has a stable machine-readable code48- [ ] Pagination, filtering and idempotency are defined49- [ ] The contract is versioned and backward compatible5051## Safety notes5253Never change an existing response shape without a version bump and a migration note.5455## Related skills5657- `design-an-authentication-flow`58- `design-an-authorization-model`59- `design-an-error-response-format`