An API contract states how to call an endpoint and what comes back. It covers paths and methods as well as field types, required properties, status codes, and authentication. A documented schema lets client and server implementations check against the same promise.
The demo shows an old client accepting an added optional field, then failing when a required field is renamed. Check consumers and compatibility before changing the contract.
When to use
Use it when teams or services implement against a shared API, especially a long lived public one.