If the contract is only in people’s heads, a rename can break a client without anyone noticing. Writing it down in a machine-readable form lets tests check it.
API contract
The written agreement about what an API accepts and returns, which both client and server must keep.