liveBook · Manning

API documentation

As explained in Secure APIs

API documentation is written technical material that describes how to use an API and its available interface.

API documentation describes an API’s interface and behavior. For security, it provides a map of what exists, how APIs work, and where protection must be applied. section 3.0 section 3.7

Use documentation to establish control of the API surface:

  • Create a specification before implementation when possible; design exposes unsafe flows and data models early. section 3.0
  • For existing APIs, generate a specification from code, traffic, or specialist analysis; an inaccurate specification is still a useful starting point. section 1.2.1
  • Keep documentation current so undocumented, deprecated, duplicated, or third-party APIs do not expand the attack surface unnoticed. section 2.3 section 3.7

Recovering a missing specification

A legacy API without a design can be documented by generating a specification from code, using FastAPI’s automatic documentation, or intercepting web-application traffic with Burp. Fuzzing can then help identify gaps. section 1.2.1

How Secure APIs covers it

How deep it goes
Explains documentation’s security role and specification-recovery methods, but does not detail specification formats.
Examples
Uses FastAPI-generated documentation, Burp traffic interception, API writers, specialist services, and fuzzing.
What you can do after
Evaluate API security by obtaining a specification and using it to identify and control the attack surface.
How it connects
Connects API documentation with security by design, API sprawl, API catalogs, fuzzing, and zero-trust security.

Also explained in

Compare how 4 books explain API documentation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.