By · Updated

AI-generated photograph: folders, documents and laptop on a desk
AI-generated illustration
Practical method

Document an API before integration

Reliable integration requires more than one successful request. Describe data, errors, permissions and recovery after interruption. Documentation should let another person understand the contract without inheriting your personal access.

01

Define the data contract

Describe required fields, types, units, missing values and dates. Provide an explicitly synthetic example without personal data. Document pagination, sorting and filtering.

Separate internal and supplier identifiers. Specify update and deletion rules. Retaining mappings avoids creating the same object at every import.

02

Limit and organise access

Identify permissions needed for each operation and separate trial and production environments. Documentation describes authentication mechanisms; it never contains usable keys.

Plan expiry, revocation and renewal through authorised organisational processes. Check what happens when permissions are missing or expired and who receives the incident.

03

Plan errors and retries

Distinguish validation errors, access refusal, request limits and outages. Define which operations can be retried without creating duplicate payments, messages or objects.

Adapt retries to the API contract and limit attempts. Keep progress records to resume unprocessed items. Logs should explain failure without exposing tokens or sensitive content.

04

Test a complete cycle

Test authorised creation, reading, updates and deletion using trial data. Also test missing values, duplicates, partial responses and outages. Compare results in both systems.

Document versions and the procedure for incompatible changes. Assign an integration owner, a monitoring point and evidence that data has been reconciled correctly.

05

Decide whether a request can be repeated

A timeout does not prove that the server executed nothing. After a POST creation, check the result or the contract’s deduplication mechanism before trying again. A blind automatic retry can create two operations.

Idempotence describes the intended effect of identical requests, not the absence of logs or an always-identical response. GET is idempotent; POST is not generally defined as idempotent. Document receipt evidence, recovery strategy and maximum attempts for each operation.

06

Verify collection across multiple pages

A correct first page does not establish complete collection. Examine pagination, termination and result ordering. Keep the starting request and actual parameters so the collected scope can be explained.

Test results changing between pages and inspect identifiers and duplicates. If the API supplies no stable snapshot, document that limitation and plan reconciliation; do not automatically describe combined pages as an exhaustive inventory.

07

Test missing values and type changes

Define behaviour for absent fields, nulls and empty strings. A number transmitted as text needs an explicit rule; an identifier remains different from a quantity. Document permitted conversions in the integration contract.

Keep small fictional examples, including an unknown field. The application should accept a compatible change or give a useful diagnostic. Silent conversion to zero can turn unknown information into an apparently certain result.

A record to keep with the decision

Minimum evidence for a review
ItemEvidence
DataFields, units, missing values
ErrorsStatuses, retries and repeatable operations
AcceptanceTest fixtures and reconciliation

Frequently asked questions

Is a successful response sufficient?

No. Also check content, pagination and all expected objects. Technical success can hide an incomplete import.

Reference material

MDN · Méthodes HTTP

IETF · HTTP semantics — Idempotent Methods

The practical checklist is an editorial synthesis to adapt to your service. It does not constitute a certification or an audit result.

Continue with a related decision

Source note

Document an API integration for day-to-day operations

API documentation serves both the developer integrating a service and the person diagnosing a failure. Describe each operation by method and path, required parameters, request schema and possible responses. In OpenAPI, path parameters must match the segments declared in the URL template.

Add a valid example and a representative error example, then explain authentication and recovery after failure. Have someone who did not design the API test the document: if they cannot send a request and interpret its response without oral guidance, information is missing.

Document details an integrator cannot infer: absent versus empty fields, date format, time zone and monetary units. For lists, explain pagination and requesting the next page. For operations changing data, explain the effects of resending a request before recommending automatic retries.

In OpenAPI, distinguish declaring an authentication scheme from applying it to relevant operations. Use fictional identifiers and data in examples. Match documentation to the deployed version and test examples in a designated environment without exposing access keys in a repository or screenshot.

Request
Method, path, parameters and an example request.
Response
Status codes, schemas and an actionable error example.
Access
Authentication and diagnostic or recovery procedure.

Is an example returning a successful response enough?

Add errors relevant to integration: invalid input, denied access or a missing resource, depending on the service. Readers should distinguish input errors from access problems without interpreting ambiguous wording.

Try the reasoning

An API request times out but the operation may have been processed. Should it be blindly repeated?

Reasoning: Document how to retrieve the result and avoid a second creation, according to the API’s capabilities. Distinguish no response from no execution.

Primary source : OpenAPI Initiative — OpenAPI Specification 3.1.1