Provide service contracts per API
Framework question: How do you design your workload service architecture?
- Risk if not established
- Medium
- Framework verified
- 6 Sept 2026
AWS Well-Architected Framework — REL03-BP03 Provide service contracts per API
Executive summary
Why this practice matters
An API or service boundary is safer to evolve when producers and consumers share an explicit, versioned contract for observable behaviour. The contract should be precise enough to support independent development, automated verification and controlled compatibility changes without exposing unnecessary implementation detail.
Business impact
- Service teams can change and deploy more independently without accidental breaking changes.
- Consumers have a clear, machine-readable definition of the interface they integrate with.
- Compatibility and deprecation decisions become explicit rather than emerging from production failures.
- Contract-driven tests can identify integration defects earlier in delivery.
- Service boundaries are less tightly coupled to each other's implementation technology.
Assign
Accountable and responsible roles
Responsibilities are held separately from roles, so accountability type and typical roles are stated explicitly.
| Responsibility | Accountability type | Typical roles |
|---|---|---|
Define and manage the API contract and compatibility strategy Ensure the contract represents intended business/consumer behaviour and manage its version lifecycle. Typical roles: Service Owner, API Product Owner | responsible | Service OwnerAPI Product Owner |
Implement the service in conformance with the contract Maintain the technical definition and avoid consumer-visible breaking changes outside the agreed lifecycle. Typical roles: Software Engineer, API Developer | responsible | Software EngineerAPI Developer |
Verify contract conformance and compatibility Test producer/consumer behaviour, schemas and backward-compatibility expectations. Typical roles: Quality Assurance / Test, Quality Assurance Engineer | responsible | Quality Assurance / TestQuality Assurance Engineer |
Support safe deployment and automated contract checks Integrate relevant verification into delivery workflows and support rollback or release controls. Typical roles: DevOps Engineer, DevOps Engineer | consulted | DevOps EngineerDevOps Engineer |
Keep consumer-facing API documentation understandable and current Maintain clear documentation alongside contract versions and changes. Typical roles: Technical Writer | consulted | Technical Writer |
Assessment
Assessment and evidence state
States describe how far the practice has moved from intent to something continuously validated.
- 0
Not Assessed
No deliberate assessment has been made of API/service contract coverage, compatibility or implementation conformance.
Indicators
- Teams cannot identify which interfaces require stable consumer contracts.
- Contract ownership and supported versions are unknown.
- 1
Not Implemented
Interfaces rely on informal or prose-only documentation with implicit behaviour and no controlled compatibility lifecycle.
Indicators
- Schemas, errors or consumer-visible semantics remain undocumented.
- Breaking-change expectations are not defined.
- Consumers discover incompatibility during integration or production.
- 2
Partially Implemented
Some versioned or machine-readable contracts exist, but coverage, lifecycle or verification is inconsistent.
Indicators
- Important interfaces have contracts but some consumer assumptions remain undocumented.
- Compatibility testing is manual or applied only to selected APIs.
- Deprecated versions accumulate without clear consumer migration ownership.
- 3
Implemented
Material service APIs have current, versioned contracts with explicit compatibility rules and verification against implementation.
Indicators
- Consumer-visible behaviour, schemas and errors are represented.
- Breaking-change and deprecation rules are defined.
- Contract/conformance checks are part of delivery where practical.
- Ownership is clear for producer-consumer changes.
- 4
Continuously Validated
Contract quality and consumer compatibility are continuously checked as interfaces and usage evolve.
Indicators
- Implementation drift is detected automatically or through reliable continuous verification.
- Consumer adoption and deprecation progress are visible.
- Production integration failures feed contract and compatibility improvements.
- Contract obligations evolve without exposing unnecessary implementation coupling.
Assessment dimensions
Contract completeness
Practice-specificImplicit / partial · Mostly defined · Complete for material behaviour
Compatibility and lifecycle
Practice-specificUndefined · Partly governed · Explicit and managed
Implementation conformance
Practice-specificUnverified · Periodically checked · Continuously / reliably verified
Consumer coverage
Practice-specificUnknown · Partly understood · Known / actively managed
Caution
A machine-readable API description is not sufficient evidence if it is stale, omits consumer-visible obligations or is not governed and verified against the deployed interface.
Standard
What you should be able to demonstrate
Statements a reviewer should be able to confirm from evidence, not from intent.
- Each material service API has a current contract defining operations, schemas and consumer-visible behaviour.
- The contract includes error behaviour and compatibility expectations, not just the happy path.
- A versioning and deprecation strategy explains how breaking changes are introduced and how consumers migrate.
- Machine-readable definitions are used where they improve validation, code generation or interoperability.
- Tests or compatibility checks demonstrate that the implementation conforms to the declared contract.
- Ownership is clear for resolving ambiguity and coordinating consumer-impacting changes.
Trade-offs to hold in view
- A contract should define observable obligations without freezing unnecessary implementation detail that prevents independent evolution.
- Adding versions indefinitely can create operational and support cost; deprecation and migration are part of the lifecycle.
- Strict contracts improve safety, but extension rules should still allow compatible evolution without requiring a new version for every change.
Assess
Questions to ask
Each question exposes the difference between an intention and an operating practice.
- challenge
What consumer-visible behaviour do integrations rely on that is not represented in the current contract?
Undocumented dependencies are a common source of breaking changes.
Usually asked by: Service Owner
- evidence
Which changes are considered breaking, and how would a producer know before release?
Compatibility rules need to be explicit and testable.
Usually asked by: Software Engineer
- evidence
What evidence demonstrates that the deployed implementation still conforms to the published contract?
A contract that is not verified can drift from runtime behaviour.
Usually asked by: Quality Assurance / Test
- discovery
How are affected consumers identified and supported when a contract version is deprecated?
Versioning without lifecycle management merely accumulates compatibility debt.
Usually asked by: Service Owner
Evidence
Required and expected evidence
Reusable evidence definitions held once in the evidence library and referenced by every practice that relies on them. Each links to what good evidence looks like and to worked examples.
API / Service Contract
A controlled, versioned contract defining the externally observable behaviour of an API or independently evolving service interface, including operations, inputs, outputs, errors, compatibility expectations, lifecycle and ownership.
Use the API / Service Contract as the authoritative, versioned definition of consumer-visible behaviour, schemas, errors, compatibility and lifecycle expectations, with verification against the implementation where practical.
Minimum expected content
- Contract identity, service/API name, owner and current version/status
- Intended consumers, scope and interface purpose
- Operations, endpoints, events or callable behaviours in scope
- Request/input schemas, constraints and required/optional fields
- Response/output schemas and semantic meaning
- Expected behaviour, state changes and material side effects
- Error model, error codes/conditions and retry expectations where relevant
- Authentication/authorisation and trust expectations where they form part of the interface
- Compatibility and versioning policy
- Deprecation, migration and support-window expectations
- Material reliability, timeout, idempotency or rate/usage expectations where consumers depend on them
- Machine-readable contract/specification where appropriate
- Verification or contract-test approach
- Change history and communication expectations for consumers
Anti-patterns
- Documentation generated from implementation but never reviewed as a producer-consumer contract
- Only endpoint names are documented while schemas, semantics and errors remain implicit
- Breaking changes are released under the same contract/version with no migration path
- The contract embeds unnecessary implementation internals that prevent independent evolution
- Versioning exists in the URL or metadata but no compatibility policy defines what versions mean
- Consumers rely on behaviours not represented in the contract
- Contract tests validate examples only and miss meaningful compatibility or schema changes
- The published contract is stale compared with the deployed interface
- No named owner or change path exists when producers and consumers disagree about expected behaviour
Review: Review whenever the interface, schemas, behaviour, compatibility policy or lifecycle materially changes, and keep the current contract version aligned with the deployed/supported interface.
Diagnosis
Common evidence gaps
Documentation exists but there is no real contract
Endpoint prose exists while schemas, semantics, errors and compatibility obligations remain implicit.
Version number without a compatibility policy
Teams label versions but cannot explain which changes are breaking or how consumers migrate.
Published contract drifts from runtime behaviour
The implementation changes without automated or review-based conformance checks.
Consumer dependencies are discovered during release
Undocumented behaviour or assumptions only become visible when integrations fail.
Implementation
Implementation guidance
Define the contract before relying on the integration
Specify operations, strongly typed inputs/outputs, consumer-visible behaviour and errors in a machine-readable format where appropriate.
Define compatibility and version lifecycle
State what constitutes a breaking change, how compatible extensions work and how versions are deprecated and migrated.
Verify producer and consumer expectations
Use contract tests, schema validation, mocks or equivalent checks so that implementation drift is detected before integration failures.
Keep contracts implementation-neutral where possible
Expose the obligations consumers depend on without unnecessarily coupling them to the producer's internal technology choices.
Measure
Measurements
- Percentage of material service APIs with a current versioned contract and named owner.
- Percentage of contract changes assessed for compatibility before release.
- Percentage of material API contracts with automated conformance or compatibility verification.
- Number and age of consumers remaining on versions scheduled for deprecation.
- Number of production integration incidents attributable to undocumented or broken contract behaviour.
Related
Outcomes and practices
Business outcomes
Practices
Use this to
Relevant journeys
Guided routes that already use this practice, with responsibilities, evidence and roles mapped.