What is API integration? How it works and where it breaks
How API integration works: what it connects, the request and event styles behind it, how authentication and rate limits shape the design, and why a retry without an idempotency key is the usual point where it stops being reliable.
On this page
API integration is connecting your software to another service through the interface that service publishes, so the two exchange data automatically instead of someone copying it by hand.
A checkout page calling a carrier's API for a shipping rate is one of the plainest API integration examples: your code calls another team's code, and that team ships changes whenever it wants. System integration is the wider problem of making systems you own act as one. This is the narrower case, where only one side of the connection belongs to you.
How API integration works: REST, GraphQL and webhooks
Most API integrations move data through one of three styles. Pick the wrong one and you usually get a slow or wasteful integration rather than a broken one.
A REST API integration answers a specific request for a specific resource at a specific URL, using standard IETF RFC 9110 HTTP semantics, one call at a time. It's simple to reason about, easy to cache, and fits any case where your own code decides when it needs something. A data pipeline usually pulls from exactly this kind of endpoint on a schedule.
GraphQL keeps the request-response shape but lets the caller name the exact fields it wants across several resources in one query, instead of chaining REST calls together. It pays off when a client's data needs change from screen to screen. For one predictable shape of data, it's usually more machinery than the job needs.
Webhook integration flips the direction. Your code no longer asks whether something happened; the vendor pushes an event to a URL you host the moment it does. That suits anything you'd otherwise poll for constantly, like a payment clearing or a shipment changing status. The price is a public endpoint that has to assume a delivery can repeat or arrive out of order.
How API authentication works
API authentication mostly comes down to three mechanisms. Their real cost tends to show up after launch, when keys leak, tokens expire and certificates come due.
An API key is a static secret sent with every request, usually in a header. It's the simplest to add and the easiest to get wrong: a key checked into source control stays valid until someone notices and rotates it, because nothing about it expires on its own.
OAuth 2.0 (IETF RFC 6749) covers two situations that people often conflate. A user delegating access to their own account uses the authorization code flow, which gets your app a token without seeing their password. Two systems talking directly with no user involved use the client credentials grant instead, which issues your application its own token. Access tokens are usually short-lived either way, so the integration has to renew them automatically or it stops working the moment one expires.
mTLS goes further. Both sides present a certificate, so the connection itself proves identity instead of a credential that could be copied and reused (RFC 8705 defines how OAuth uses it). It costs more to run: someone has to issue and rotate a certificate per service, and a missed rotation fails the connection outright. That's why you mostly see it in regulated, higher-trust integrations.
Rate limits, retries, and idempotency
Every vendor caps how many requests you can make in a window. How you react when you hit that cap matters more to reliability than the cap itself.
A vendor at its limit returns 429 Too Many Requests, sometimes with a Retry-After header saying how long to wait. If every failed caller retries at once, it only adds to the load that triggered the limit, and the struggling service stays throttled longer. Exponential backoff (waiting longer after each failure) plus jitter to randomize the wait spreads retries out so they don't all land together.
None of that makes retrying safe by itself. A request can succeed on the vendor's end while the response gets lost to a timeout, and retrying it plainly repeats whatever it did. You end up with a record created twice. An idempotency key fixes that: a unique value attached to one attempt, so the vendor recognizes a repeat and sends back what the first attempt already produced, rather than doing the work twice.
Why API integrations fail in production
Most of these problems stay hidden while both sides are still testing. They surface once real traffic arrives.
- A sandbox that doesn't match production. Simulating real rate limits, latency and malformed responses is its own project, and many vendors skip it. An integration that has only seen clean success in testing meets its first real edge case live.
- Undocumented behavior. Docs tend to cover the happy path. A specific error code, a field that's only sometimes populated, a rate limit tighter than advertised: you often find these only when the integration runs into them.
- Breaking changes with no version to pin to. A vendor renames a field or retires an endpoint without a version bump or notice, and the integration breaks the next time that code path runs, with no changelog to explain why.
- Silent partial failure. A batch call can succeed overall and still fail for some records inside it, hidden in an ordinary-looking 200 response unless something checks every item.
When API integration becomes a build
One integration is a manageable task: pick an auth method, handle retries, ship it. That changes once a product depends on a dozen vendor APIs at once, each with its own auth scheme and failure behavior. At that point someone has to own the whole integration layer, or each new connection repeats mistakes the earlier ones already made. The same goes for LLM providers: an AI integration runs into the same rate limits and retry questions as any other vendor API.
Money moving through the integration raises the stakes on the retry problem above. A duplicated charge is far worse than a duplicated log line, and a badly handled vendor outage can double-bill a customer before anyone checks the numbers.
Compliance adds weight in a less obvious place: logs. Verbose or debug logging often captures full request and response bodies, and a log line holding a card number or a patient record becomes a breach risk, next to the authorization and data-exposure flaws listed in the OWASP API Security Top 10. Plan redaction before anything gets logged; it's much harder to add later.
Custom software development and product development teams usually take over at this point, scoping and building the integration layer once it has outgrown what one engineer can own. The clearest case is payment gateway integration: the same mechanics, concentrated where getting them wrong moves someone else's money.
Frequently asked questions
It's wiring your own software to a service someone else runs, through the interface that service exposes for this purpose, so data moves between the two without anyone re-entering it by hand. The work covers authenticating each request, handling the format the other side returns, and reacting sensibly when a call fails.
For calls that don't move money or touch personal data, yes, if you treat it like any other secret. Keep it in a secrets manager instead of a repository, scope it to what that one integration needs, and rotate it on a schedule instead of waiting for a leak. Once the call can charge a card or expose a record, pair the key with something stronger or move to OAuth.
Because polling for something that might not have happened yet wastes calls and still misses the exact moment it does happen. The trade is operational. You need a publicly reachable endpoint that's always listening, and a way to confirm each delivery actually came from the vendor rather than from anyone who found the URL.
Documentation and auth complexity matter more than the number of endpoints. A single, well-documented REST endpoint behind an API key can be days of work. OAuth, webhooks, and the retry and idempotency handling that make an integration production-grade rather than a demo usually turn it into weeks.
The API is the interface a vendor publishes, meaning its endpoints, data formats and auth rules. The API integration is the code on your side that calls it and keeps working when the vendor is slow, rate limits you or renames a field.
Keep exploring
System integration: patterns, methods, and when you need it
A plain-language reference on system integration, covering what it means, the four patterns teams actually use, how to pick one, and the failure modes that make integration projects overrun.
6 min readEngineeringWhat is a data pipeline: stages, patterns, and failure modes
Data moves through several distinct stages on its way from a source to wherever it gets used, picking up structure along the way: the stages of a data pipeline, what separates ETL from ELT, batch versus streaming, and where a pipeline stops producing numbers anyone can trust.
7 min readEngineeringWhat is alphanumeric: character sets, validation, and encoding
Alphanumeric means letters plus digits and nothing else. See the 62 ASCII characters, Unicode letter and number classes, regex patterns for JavaScript and Python, EBCDIC pitfalls, and where an alphanumeric allow-list helps security.
6 min read