§ 02 ·
The architecture
The architectural primitives that have held up across the API ecosystems we work with.
The contract is the architecture
The schema, the SLA, the deprecation policy, the rate limits, the authentication requirements, the error model: every one of these is part of the contract. The contract is documented, versioned, and testable. The implementation is the producer's problem; the contract is the consumer's guarantee.
The contract is consumed by machine, not by human
The schema is a machine-readable artifact (OpenAPI, Protobuf, JSON Schema, GraphQL SDL). The documentation is generated from the schema, not maintained by hand. The tests are generated from the schema, not maintained by hand. A contract that is maintained by hand is a contract that drifts from the implementation.
The federation is the unit of trust
Two APIs exchanging data is not federation; it is a copy of data with extra steps. Federation requires a contract: schema, conformance tests, failure modes, deprecation policy. Without the contract, the integration is just a less honest one.
The API is a product, not a project
The API has a roadmap, a changelog, a status page, a feedback channel, a deprecation policy. The producer is responsible for the contract; the consumer is responsible for the implementation. The contract is reviewed; the implementation is owned.
The error model is part of the contract
The API returns errors that are machine-readable and human-actionable. The error response includes an error code (machine-readable), a human-readable message, and ideally a link to the documentation. The error model is documented; the error responses are tested.