Skip to content
Latchkey

API Contract - CI/CD Glossary Definition

An API contract is the machine-checkable agreement describing how a client and server exchange requests and responses.

An API contract is the agreed specification of how a client and server communicate: the endpoints, request and response shapes, status codes, and error formats. In CI, a contract test asserts that a running service still honors this agreement before deploy.

Contracts turn "the API should work" into something a pipeline can verify. Contract tests run in CI to catch a service drifting away from what its consumers expect, before that drift reaches production.

Why it matters in CI

A contract test in a workflow fails the build when a producer changes a response shape a consumer relies on, catching integration breaks before merge instead of in production.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →