For API’s the service provider should write a ‘contract’ (behavior) of the format of requests to send to the API, and what will be sent back in response. Essentially requirements of how the API will behave. These are called contracts, because it’s an agreement between the service provider and user of how the API will behave.
Documenting the ‘contract’ can be done through a wiki / confluence page, but best practice dictates to use API documentation tools like swagger, this was the contract is documented from the actual code, not a static document which have to keep up to date all the time.
]]>