Skip to content

Insights · Engineering · Jul 9, 2026 · 7 min read

API integration troubleshooting: a practical guide to fixing broken calls

Integrations break quietly and clients notice first. Here is how to triage a failing API call end to end: status codes, token expiry, rate limits, webhook retries, payload drift and monitoring that warns you first.

Agent running - queue empty

Flow 04

01

Trigger

Webhook

02

Enrich

Normalise

03

Decide

Policy

04

Act

Resolve

Run log

> Matched 42 records

> Routed 7 exceptions to a human

> Closed 35 tickets automatically

35

Auto-resolved today

6h

Engineer time saved daily

When an integration breaks, the fastest route to a fix is to stop guessing and follow one failing request from your code to the provider's server and back. Broken integrations nearly always trace back to the same handful of causes: authentication, rate limits, retry and delivery behaviour, payload shape, environment differences, or a change on the provider's side that nobody told you about. Work through them in that order and you end up fixing a cause rather than guessing at symptoms.

Key takeaways

  • Reproduce a single failing request with full headers, body and a correlation ID before you change any code.
  • The status code narrows the search: 4xx means your request, 5xx means theirs, and a timeout means the two sides disagreed about who gives up first.
  • Retry only what is safe to repeat. Idempotency keys and a de-duplication table make webhook redelivery harmless.
  • Payload drift is the quiet failure. Schema validation at the boundary catches a renamed field before your client does.
  • Alert on the integration's own signals, not just on whether the site loads.

Start with one failing request, end to end

Broken integrations get debugged badly because people start in the middle: reading application code, re-reading provider documentation, changing two things at once. Start at the edge instead, with one concrete request you can point at.

  1. Capture the failing call in full: method, URL, headers with secrets redacted, request body, response status, response headers and response body, plus a timestamp.
  2. Attach a correlation ID to every outbound request and log it on both sides of the boundary. Most providers echo their own request ID in a response header. Record both.
  3. Replay the same request with curl or a REST client, outside your application. If it fails there too, the problem is the request or the provider. If it succeeds, the problem is your code, your configuration or your environment.
  4. Check the provider's own log or developer dashboard for that request ID. Their view of the call often carries a validation message your client never surfaced.
  5. Change one variable at a time: one header, one field, one credential. Two changes at once turn a diagnosis into a guess.

Keep the captured request in the ticket. When the same failure returns months later, that artefact saves the next person the slowest part of the work.

What the status code is actually telling you

Status codes are coarse, and providers apply them inconsistently, but they still cut the search space down. Read the code, then read the response body, because the body usually carries the specific field or rule that failed.

ResponseUsual causeFirst thing to check
400Malformed request or bad JSONContent-Type header, encoding, and whether a field is sent as a string instead of a number
401Missing, expired or malformed credentialToken expiry, header format, and which environment the key belongs to
403Valid credential without permissionScopes granted at authorisation, plan level, IP allow lists
404Wrong path, wrong ID, or a record in the other environmentBase URL, API version segment, and whether the ID exists in this tenant
409Conflict or duplicateWhether a retry already created the record
422Well-formed request, invalid valuesThe per-field errors in the response body
429Rate limit reachedRetry-After and any remaining-quota headers
5xxProvider fault, or a payload that broke themProvider status page, then whether one specific payload reproduces it
TimeoutSlow endpoint or a client timeout set too lowYour timeout value against their documented processing time
A 200 response with an error object in the body is still a failure. Parse the payload, not just the status line.

Auth and token expiry: the failures that lie

Authentication problems are the most common and the most misread, because a 401 rarely means what the log says it means. Expired access tokens, rotated refresh tokens, revoked scopes, a key copied from the sandbox, and clock skew all surface as the same terse message.

Work through it in a fixed order. Confirm which environment the credential belongs to. Confirm the header format, including the scheme word before the token. Decode the token if it is a JWT and read the expiry and issuer claims rather than trusting your refresh logic. Check the machine clock: signed requests and short-lived tokens fail on a server whose clock has drifted, so make sure time sync is running.

Then fix the pattern, not the incident. Refresh proactively, once a token passes roughly 80 percent of its lifetime, instead of waiting for a 401. Hold a lock around refresh so concurrent workers do not each request a new token and invalidate one another. Log the expiry timestamp, never the token. Treat a refresh failure as a distinct alert, because a rotated or revoked credential will not fix itself.

Rate limits, retries and idempotency

Retries are where a small outage becomes a large one. A client that retries immediately, in a tight loop, across every worker, turns a brief 429 into a sustained block.

Respect Retry-After when the provider sends it. Otherwise back off: delay = min(cap, base × 2^attempt) + random jitter, with a hard cap on attempts and a dead-letter queue for what still fails. Jitter matters more than the curve, because it stops every retry in your fleet firing on the same tick.

Retry only what is safe to repeat. Reads and idempotent updates are fine. Anything that creates a record, charges a card or sends a message needs an idempotency key: a stable value you generate per logical operation and send on every attempt, so the provider returns the original result instead of creating a second record. Where the provider offers no such key, keep your own outbound log and check it before resending.

Webhooks are the same problem from the other direction. Providers retry deliveries until they get a fast success, so duplicates and out-of-order events are normal traffic. A durable handler does five things in order: verify the signature, check the event ID against a de-duplication table, acknowledge with a 200 straight away, queue the real work for a background worker, and only then process. Compare a version or updated timestamp before writing, so a stale redelivery cannot overwrite newer state. Log every rejected delivery with its reason; a wall of signature failures usually means a rotated signing secret rather than an attack.

Payload drift and environment gaps

The hardest integration bugs are the ones where nothing errors. A provider adds an enum value, changes a decimal to a string, makes an optional field nullable, or moves to cursor pagination, and your mapping quietly writes a null into a field the business depends on.

Validate responses at the boundary against a schema and fail loudly when they do not match, rather than letting a malformed record travel three layers into your domain logic. Log unknown fields at a low level so you can see additions arriving. Pin the API version explicitly in the request instead of following whatever the default has become, and subscribe to the provider's changelog with a real person's inbox behind it. Keep the field mapping in one place, documented, so a rename is a one-line change and not an archaeology project. This is ordinary integration architecture discipline, and it pays for itself the first time a supplier ships a breaking change on a Friday.

Sandbox environments deserve their own suspicion. They often run an older version, return stubbed values, skip validation rules and enforce different limits. Anything that behaves in sandbox and fails in production is usually a version, a validation rule or a volume difference. Run a small live smoke test against production before launch, and keep credentials, base URLs and webhook endpoints in configuration rather than in code so nobody ships the wrong pair.

Monitoring so you find out before the client does

Uptime checks tell you the site is up. They say nothing about the integration that has been failing silently since Tuesday. Instrument the boundary itself.

Track error rate and latency per provider and per endpoint, retry counts, dead-letter queue depth, and the age of the most recent successful call and the most recent webhook received. Staleness is the signal that catches quiet failures: if a feed that normally delivers every hour has been silent all morning, that is an incident even though nothing errored. Run a synthetic canary call on a schedule against a cheap read endpoint. Alert on the things a human can act on, route them to somebody who is actually on shift, and keep a short runbook next to the alert with the replay steps above. Teams that pair this with end-to-end ownership of the stack catch integration faults themselves instead of hearing about them in a client email.

How OlDevs helps

OlDevs has been building and repairing integrations from Vancouver since 2014, across payments, CRMs, booking systems, ERPs and internal services. We work as one accountable team, ship a working demo every week, and hand over code, designs, accounts and IP that you own outright. A typical engagement starts with an audit of your existing boundaries: credential handling, retry and idempotency behaviour, schema validation, webhook durability and monitoring coverage, with a prioritised list of what to fix first. From there we can harden what you have or rebuild the integration layer as part of broader web app development work, with WCAG 2.2 AA accessibility and bilingual EN/FR capability where you need them.

If an integration is failing now, or you want to know where the next one will break, request a quote. We reply to every enquiry within one business day.

FAQ

Questions on this topic.

Sandbox environments often run older API versions, return stubbed data, apply looser validation and enforce softer rate limits. Production also has real volume, real payment states and real edge cases. Pin the API version in both environments, validate payloads at the boundary in sandbox too, and run at least one live smoke test against production before launch.

Retry on timeouts, connection errors, 429 and 5xx responses, and only for operations that are safe to repeat or that carry an idempotency key. Never retry a 400, 401, 403 or 422 without changing the request first, because the same call will fail again. Use exponential backoff with jitter and a hard cap on attempts.

Store every provider event ID in a table with a unique constraint and check it before processing. If the ID already exists, acknowledge with a 200 and stop. Providers retry deliveries whenever they do not receive a fast success response, so duplicates are normal traffic rather than a bug, and de-duplication belongs in your handler.

Still have a question? Ask us when you request a quote

Let’s connect

Want this applied to your business?

Tell us what you’re building. We’ll reply within one business day with next steps and a tailored quote.

We’ll only use your details to prepare your quote. No lists, no spam.

Call us Request a quote
We use cookies for personalized content and ads, social features, and analytics. We share site usage data with our partners.
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Privacy Policy

What information do we collect?

We collect information from you when you register on our site or place an order. When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address or mailing address.

What do we use your information for?

Any of the information we collect from you may be used in one of the following ways: To personalize your experience (your information helps us to better respond to your individual needs) To improve our website (we continually strive to improve our website offerings based on the information and feedback we receive from you) To improve customer service (your information helps us to more effectively respond to your customer service requests and support needs) To process transactions Your information, whether public or private, will not be sold, exchanged, transferred, or given to any other company for any reason whatsoever, without your consent, other than for the express purpose of delivering the purchased product or service requested. To administer a contest, promotion, survey or other site feature To send periodic emails The email address you provide for order processing, will only be used to send you information and updates pertaining to your order.

How do we protect your information?

We implement a variety of security measures to maintain the safety of your personal information when you place an order or enter, submit, or access your personal information. We offer the use of a secure server. All supplied sensitive/credit information is transmitted via Secure Socket Layer (SSL) technology and then encrypted into our Payment gateway providers database only to be accessible by those authorized with special access rights to such systems, and are required to?keep the information confidential. After a transaction, your private information (credit cards, social security numbers, financials, etc.) will not be kept on file for more than 60 days.

Do we use cookies?

Yes (Cookies are small files that a site or its service provider transfers to your computers hard drive through your Web browser (if you allow) that enables the sites or service providers systems to recognize your browser and capture and remember certain information We use cookies to help us remember and process the items in your shopping cart, understand and save your preferences for future visits, keep track of advertisements and compile aggregate data about site traffic and site interaction so that we can offer better site experiences and tools in the future. We may contract with third-party service providers to assist us in better understanding our site visitors. These service providers are not permitted to use the information collected on our behalf except to help us conduct and improve our business. If you prefer, you can choose to have your computer warn you each time a cookie is being sent, or you can choose to turn off all cookies via your browser settings. Like most websites, if you turn your cookies off, some of our services may not function properly. However, you can still place orders by contacting customer service. Google Analytics We use Google Analytics on our sites for anonymous reporting of site usage and for advertising on the site. If you would like to opt-out of Google Analytics monitoring your behaviour on our sites please use this link (https://tools.google.com/dlpage/gaoptout/)

Do we disclose any information to outside parties?

We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.

Registration

The minimum information we need to register you is your name, email address and a password. We will ask you more questions for different services, including sales promotions. Unless we say otherwise, you have to answer all the registration questions. We may also ask some other, voluntary questions during registration for certain services (for example, professional networks) so we can gain a clearer understanding of who you are. This also allows us to personalise services for you. To assist us in our marketing, in addition to the data that you provide to us if you register, we may also obtain data from trusted third parties to help us understand what you might be interested in. This ‘profiling’ information is produced from a variety of sources, including publicly available data (such as the electoral roll) or from sources such as surveys and polls where you have given your permission for your data to be shared. You can choose not to have such data shared with the Guardian from these sources by logging into your account and changing the settings in the privacy section. After you have registered, and with your permission, we may send you emails we think may interest you. Newsletters may be personalised based on what you have been reading on theguardian.com. At any time you can decide not to receive these emails and will be able to ‘unsubscribe’. Logging in using social networking credentials If you log-in to our sites using a Facebook log-in, you are granting permission to Facebook to share your user details with us. This will include your name, email address, date of birth and location which will then be used to form a Guardian identity. You can also use your picture from Facebook as part of your profile. This will also allow us and Facebook to share your, networks, user ID and any other information you choose to share according to your Facebook account settings. If you remove the Guardian app from your Facebook settings, we will no longer have access to this information. If you log-in to our sites using a Google log-in, you grant permission to Google to share your user details with us. This will include your name, email address, date of birth, sex and location which we will then use to form a Guardian identity. You may use your picture from Google as part of your profile. This also allows us to share your networks, user ID and any other information you choose to share according to your Google account settings. If you remove the Guardian from your Google settings, we will no longer have access to this information. If you log-in to our sites using a twitter log-in, we receive your avatar (the small picture that appears next to your tweets) and twitter username.

Children’s Online Privacy Protection Act Compliance

We are in compliance with the requirements of COPPA (Childrens Online Privacy Protection Act), we do not collect any information from anyone under 13 years of age. Our website, products and services are all directed to people who are at least 13 years old or older.

Updating your personal information

We offer a ‘My details’ page (also known as Dashboard), where you can update your personal information at any time, and change your marketing preferences. You can get to this page from most pages on the site – simply click on the ‘My details’ link at the top of the screen when you are signed in.

Online Privacy Policy Only

This online privacy policy applies only to information collected through our website and not to information collected offline.

Your Consent

By using our site, you consent to our privacy policy.

Changes to our Privacy Policy

If we decide to change our privacy policy, we will post those changes on this page.
Save settings
Cookies settings