Skip to content

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.

  • Who it is forDevelopers and project leads
  • LevelGuide
  • Reading timeabout 8 minutes
  • Last updated24 October 2026

What you will learn

  • What should be settled before the first request
  • How to observe and record what an API actually does
  • Why error cases have to be triggered deliberately
  • How your own OpenAPI description makes assumptions visible
  • Where the investigation stops for legal reasons

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:

  • Contract and terms of use. Is using the API for your purpose permitted? Are there volume limits or rules for automated requests?
  • A contact person. Is there someone at the provider who answers technical questions – even if it takes a few days? A single answer to a well-phrased question often saves days of trial and error.
  • Test access. A separate test environment (often called a sandbox) lets you trigger errors without creating real orders, invoices or messages. If there is none, agree with the provider which experiments are acceptable in the live system.
  • Existing material. Older documentation, sample requests, another customer's integration, change logs. Patchy material is better than none, as long as you know how old it is.
  • Data. No real personal data is used in testing. Anything that is transferred nonetheless should be agreed with whoever handles data protection in your organisation.

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:

  • Whether a field is missing, empty or set to null – three states that often mean different things.
  • What formats dates, times, time zones, amounts and quantities actually use.
  • How long lists are split into pages (pagination) and whether the sort order is stable.
  • Whether the same request returns the same response when repeated.
  • Which identifiers are stable and which change when a record is modified.

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:

  • Omit a required field, send a field in the wrong format, pass a text that is too long.
  • Make a request with an invalid or expired key.
  • Request an identifier that does not exist, and create the same record twice.
  • Reach the agreed request limit, provided the provider has consented.
  • Abort a request and check whether the transaction was created at the provider anyway.

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:

In OpenAPI, the labels can go into description text or into custom extension fields.
LabelMeaningHandling in production
documentedIn the provider’s material and confirmed by observation.Treated as reliable, but still checked.
observedSeen this way in testing, but promised nowhere.Deviations are logged and reported.
assumedNeither 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:

  • Responses are validated against your own description. If a required field is missing or has an unexpected format, the transaction is halted and reported instead of continuing with wrong values.
  • Unknown additional fields are tolerated but logged – they are often the first sign of a new version.
  • All access sits in one place in the code. If the API changes, only that place needs adapting.
  • Repeated requests must not create duplicate transactions; see Preventing duplicate processing.
  • Errors are logged with request, response and time, as described in Error handling and logging.

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

It can, but the investigation takes time. That time belongs in the plan as a step of its own, not as a buffer inside the build.

Test environments often differ in data volume, request limits and version. The first days in production therefore deserve particularly close monitoring.

Some APIs report errors in the body of a response with status 200. Only observation shows whether that is the case.

Further sources

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.