Investigating and integrating an API with insufficient documentation
An API needs to be integrated, but the documentation is thin, out of date or contradictory. That is no reason to abandon the project – but it is a reason to plan the investigation as a step of its own and write down every assumption.
What you will learn
Clarify, observe, then write it down
When the documentation does not hold up, systematic observation takes its place. With the provider's permission and in a test account, real requests are made, the responses recorded and error cases triggered on purpose. The findings become your own description, in which every statement is labelled as documented, observed or assumed. In production, the integration then keeps checking whether those assumptions still hold.
What an API has to do in principle is covered in What is an API?. This article picks up where the provider leaves those questions unanswered.
Before the first request
The most valuable hour of such an integration is often the first, and it passes without any code:
Observing and recording real responses
Every request made in the test account is stored together with its complete response: URL, method, headers, body, status code and time. Keys and passwords are masked. This collection is the raw material for everything that follows and later serves as the basis for tests.
When evaluating it, look closely at details that documentation tends to leave out:
Triggering error cases deliberately
Every API is happy to show its success cases. How it behaves when things go wrong you only learn by triggering errors in the test account on purpose:
HTTP has status codes in five classes, whose meanings are defined in RFC 9110. Codes from 400 indicate errors on the client's side, from 500 errors on the server's side. Some APIs describe errors using the format from RFC 9457 (“problem details”), with fields such as type, title and detail. Others reply with status 200 even on failure and hide the error in the body. Deviations like these belong in your notes. How to turn these cases into lasting tests is explained in Testing APIs properly.
A hypothetical example
The delivery date that is sometimes missing
A parcel carrier's tracking API documents a “delivery date” field as a date. Observation in the test account shows three variants: when delivery is scheduled there is a date, for parcels not yet scheduled the field is missing altogether, and after a failed delivery attempt it is an empty string.
Your own description records all three states and labels the two undocumented ones as “observed”. The integration treats them separately: no date means “still open”, an empty value means “delivery failed, follow-up needed”. A short query to the provider confirms this reading and mentions a fourth state that never appeared in testing. Without the observation, the empty value would have surfaced in production as a bug – on a real parcel.
Writing your own description
The OpenAPI Specification is a widely used format for describing an HTTP API in machine-readable form: paths, parameters, request and response bodies, error responses and examples. As of October 2026, version 3.2.1 is the current release. You can write such a description even if the provider does not supply one – it then becomes your record of what you know.
What matters is labelling every statement:
| Label | Meaning | Handling in production |
|---|---|---|
| documented | In the provider’s material and confirmed by observation. | Treated as reliable, but still checked. |
| observed | Seen this way in testing, but promised nowhere. | Deviations are logged and reported. |
| assumed | Neither documented nor observed, but needed for the build. | Raised with the provider; handled defensively until answered. |
The description also serves as a handover document: whoever maintains the integration later can see which parts rest on commitments and which on observation. It is the same question that comes first when taking over existing software.
Securing assumptions in production
An API without reliable documentation may change without anyone telling you. The integration should notice:
Where the investigation stops
This boundary also makes practical sense: anything that only works by getting round a block can be shut down by the provider at any time. An integration a business is meant to rely on needs a use the provider knows about and accepts. If you would rather not investigate such an integration yourself, we take it on as part of our API integration work.
Common misconceptions
Further sources
- OpenAPI Specification v3.2.1 format for describing HTTP APIs, current release as of October 2026
- RFC 9110 – HTTP Semantics HTTP methods and status codes
- RFC 9457 – Problem Details for HTTP APIs a standard format for error responses
About the author
Fabian Lücker is managing partner of PHP Schmiede KG in Rheine and has worked in software development since 2007. He is responsible for development and design, and writes here about decisions that come up in real projects.
An API with gaps?
Tell us about the system, the material you have and what needs to be transferred. We will estimate how much investigation is needed before building starts.