Home
Web Product

Documentation Of An API
API is called by pages from time to time to fetch data. Some APIs are called by external integrations. APIs return data in serialised formats, often as JSON.

Action APIs
In some web applications, especially SPAs, and AJAX, API is used to perform action, and the job of redirecting the user to the next page is performed by the frontend. In such cases from the end user’s perspective this is an “action” and should be documented as an Action.

URL and Parameters
URL and parameters should be documented, along with validation, and expected error messages.

Output
The output of an API is usually JSON, the structure of the returned JSON should be documented here.

Reusable JSON Objects
If an API is using a JSON object in multiple places, it makes sense to document that JSON object independently. If the JSON object is used across multiple APIs, the JSON object documentation should be moved to a dedicated document for that JSON object, or that family of JSON objects.