# Diagnosing API Failures in Support: JWTs, OAuth Errors, TLS and Webhooks

> “Your API returns 401” usually ends with a live token pasted into a ticket and an escalation anyway. API diagnostics reads JWTs without keeping them, translates OAuth errors, walks DNS, TCP, TLS and HTTP in order, digs errors out of payloads, and shows webhook and dependency health, so support can solve it.

Source: https://www.ticketresolve.ai/blog/api-diagnostics-jwt-oauth-tls · Published 2026-11-14 · TicketResolve AI

**Integration tickets have a pattern. The customer says "your API returns 401", support asks for the request, the customer pastes a curl command with a live token in it, and the ticket goes to engineering anyway. Most of these can be solved in support, if the tools are safe to use.**

Here's that pattern at a company that sells an e-signature API. In one week:

- **Ticket 1:** *"401 on every call since this morning."* The customer pastes a curl with a live bearer token. The agent forwards it to engineering. The token was simply expired.
- **Ticket 2:** *"invalid_grant when refreshing."* The agent searches online and finds six possible meanings. Escalated.
- **Ticket 3:** *"Requests time out."* Engineering spends an hour; the customer's certificate pinning had an expired intermediate certificate.
- **Ticket 4:** *"Webhooks stopped arriving."* The receiver was returning 410 Gone; their endpoint had been deleted.

Four escalations, one live token in a ticket, and none of them needed engineering.

## First, the basics

- **A JWT** (JSON Web Token) is a token that carries information about itself: when it was issued, when it expires, who it's for and who issued it.
- **`aud`** (audience) says who a token is for; **`iss`** (issuer) says who created it; **`alg`** says how it's signed.
- **OAuth** is a standard for granting access; it has standard error codes like `invalid_grant`.
- **DNS, TCP, TLS, HTTP** are the layers a request goes through: finding the address, connecting, securing the connection, and the request itself.
- **A certificate** proves a server's identity; it has an expiry date.
- **A SOAP fault** is how older XML APIs report errors.
- **A webhook** is a call your system makes to a customer's endpoint when something happens.
- **Masking** hides secrets and personal data in what's shown or stored.

**Why does this matter?** Most API integration problems have a clear technical answer that support can find with the right tools: an expired token, a wrong audience, a dead certificate, a deleted endpoint. Safe tools that never keep secrets mean customers don't have to paste live tokens, and engineers don't get tickets they don't need.

## The problem, in plain terms

1. **Customers paste live tokens** into tickets.
2. **OAuth errors** have many meanings.
3. **"It times out"** could be any layer.
4. **Errors hide** in nested payloads.
5. **Answers already in your data** (webhook failures, latency) aren't looked at.

## Read the token, not the secret

**A JWT carries its own diagnosis: when it was issued, when it expires, who it's for (`aud`), who issued it (`iss`), and how it's signed (`alg`). The common failures are visible without verifying the signature:**

- **expired ten minutes ago: refresh it**
- **the audience is `api`, but this endpoint expects `billing`**
- **signed with `HS256` when the API expects `RS256`**
- **`alg: none`: never accept it**
- **issued "in the future": the issuer's clock is ahead**

**TR Investigate's JWT check shows these and nothing else: subject and personal claims are hidden, the token itself is never returned or stored, and it says plainly that the signature wasn't checked (TR-AI doesn't hold your keys).**

## Translate OAuth error codes

**`invalid_grant` is the most-searched OAuth error for a reason: it covers an expired authorization code, a reused one, a revoked refresh token and a code issued to another client. Paste the response body or the `WWW-Authenticate` header and get the meaning and the next step, including the missing scope when the header names it.**

## Walk the connection

**"It times out" could be DNS, a firewall, an expired certificate or a slow server. Check each layer in order (DNS, TCP, TLS, HTTP) timing each step and stopping at the first failure. Certificate expiry is reported even when it's still valid, because "expires in 3 days" is a ticket you can prevent.**

## Find the error in the payload

**Error messages hide in nested JSON (`errors[0].detail`) and SOAP faults. A payload inspector should pull them out and mask anything that looks like a secret (`access_token`, `api_key`, `password`, Stripe-style and GitHub-style keys, embedded JWTs) and personal fields.**

## Look at what you already have

**Some answers are already in your data:**

- **Webhook health: delivery success per endpoint, failure codes with hints (401 means the receiver rejects your signature; 410 means it's gone)**
- **Latency and timeouts per endpoint from your test requests**
- **Dependencies between services from traces: which call is failing**

**All of this sits under TR Investigate → API diagnostics, next to the API workbench that replays the customer's request from your OpenAPI file.**

## A worked example, start to finish

Here's the e-signature company's week, with API diagnostics. The details are illustrative.

**Ticket 1, the 401.** The customer has pasted a curl with a token in it. The agent, Yasmin, copies the token into the **JWT check** and redacts it from the ticket. The check shows: **expired 12 minutes ago**; `aud` is `api`; `alg` is `RS256`. Subject and personal claims are **hidden**; the token is **never returned or stored**; the check says the **signature wasn't checked**. Yasmin replies: *"Your token expired at 09:12; your client isn't refreshing it. Here's how."* No escalation.

**Ticket 2, invalid_grant.** The customer pastes the response body. The **OAuth translator** explains: *the refresh token was revoked*; the next step is to re-authorise the app. The `WWW-Authenticate` header names a missing scope, `documents.write`, which the explanation includes. Solved in one reply.

**Ticket 3, timeouts.** Yasmin runs the **connection walk** against the customer's callback host: **DNS** fine (20 ms), **TCP** fine (40 ms), **TLS fails**: the intermediate certificate expired. It stops there. She tells the customer which certificate to replace. A second host's certificate **expires in 3 days**, reported even though it's still valid; she mentions it too.

**Ticket 4, webhooks.** **Webhook health** shows the customer's endpoint failing with **410**: *gone*. Hint: the endpoint was deleted. The customer had moved it and forgotten to update the URL. Solved.

**A payload with a secret.** Another customer pastes a nested JSON error that includes an `api_key`. The **payload inspector** pulls out `errors[0].detail` and **masks** the key.

**End of week.** Four tickets that would have gone to engineering were solved in support, and the one live token that arrived was redacted from the ticket.

## Five more real-world scenarios

### 1. A token from the future

**Situation.** The token's issue time is ahead of now.

**How TR handles it.** The issuer's clock is ahead; the check says so.

### 2. alg: none

**Situation.** A token isn't signed.

**How TR handles it.** Flagged: never accept it.

### 3. A SOAP fault

**Situation.** An older integration returns XML.

**How TR handles it.** The payload inspector pulls the fault out.

### 4. A slow endpoint

**Situation.** One endpoint keeps timing out in tests.

**How TR handles it.** Latency and timeouts per endpoint show it.

### 5. A failing dependency

**Situation.** A call fails because a downstream service is down.

**How TR handles it.** Dependencies from traces show which call is failing.

## Before and after

**Before.** Four escalations, a live token in a ticket, an hour of engineering time on a certificate, and a deleted endpoint nobody spotted.

**After.** An expired token read without being kept, an OAuth error translated with its missing scope, a TLS failure found at the right layer, a 410 explained, and all four solved in support.

## How to tell it's working

- **Fewer integration tickets** reach engineering.
- **Fewer live tokens** left sitting in tickets.
- **Certificate expiries** are caught before they break.

## Who it's for

- **Support agents** at API companies.
- **Developer support** and solutions engineers.
- **Security teams** worried about tokens in tickets.

## How it fits with the rest of TicketResolve

API diagnostics sits beside the **API workbench** under **TR Investigate**. Webhook health uses your **outbound webhooks**; latency comes from **test requests**; dependencies come from **traces**. Findings feed **investigations** through the API diagnostics agent.

## Why the signature isn't checked

Checking a JWT's signature needs your signing keys. Holding them in a support tool would be a serious risk. Most token problems (expiry, audience, algorithm, clock skew) are visible without the signature, so the check reads what it can, hides personal claims, never keeps the token, and says plainly that the signature wasn't verified.

## Asking customers for the right thing

When a customer reports an API problem, ask for the smallest safe thing: the response body and status code, the `WWW-Authenticate` header, the time it happened, and the host they're calling. Ask them not to paste full requests with live tokens; if a token arrives anyway, read it with the JWT check and redact it from the ticket. With those, most integration tickets can be diagnosed without engineering, and without a single live credential in your help desk.

## Mistakes to avoid

- **Asking for full curl commands** with live tokens.
- **Guessing what invalid_grant means.**
- **Debugging the HTTP layer** before checking DNS, TCP and TLS.

## Do it in TicketResolve, step by step

**Where:** TR Investigate → **API diagnostics** (`/dashboard/api-workbench`). **You'll need:** nothing for the JWT, OAuth and connection checks; outbound webhooks, test requests and traces for the health views. **Full guides:** [API workbench: reproduce a customer’s API call](https://www.ticketresolve.ai/docs/guide/api-workbench) and [API and webhooks](https://www.ticketresolve.ai/docs/guide/api-and-webhooks).

1. **Open API diagnostics.**
2. **For 401s**, use the JWT check: expiry, audience, issuer, algorithm.
3. **For OAuth errors**, paste the response body or `WWW-Authenticate` header.
4. **For timeouts**, walk the connection: DNS, TCP, TLS, HTTP.
5. **For confusing errors**, use the payload inspector.
6. **Check webhook health, latency and dependencies.**
7. **Replay the request** in the API workbench if needed.

**How to check it worked:** each check shows its finding and next step, with secrets and personal data masked.

## Frequently asked questions

**Does the JWT check store the token?**
No. It's never returned or stored.

**Does it verify the signature?**
No, and it says so; TR-AI doesn't hold your keys.

**What JWT problems does it find?**
Expiry, wrong audience, unexpected algorithm, alg none, and issue times in the future.

**What does the OAuth translator do?**
Explains error codes like invalid_grant and the next step, including missing scopes.

**What does the connection walk check?**
DNS, TCP, TLS and HTTP in order, stopping at the first failure.

**Are certificates checked even when valid?**
Yes. Upcoming expiry is reported.

**What does the payload inspector mask?**
Tokens, API keys, passwords, Stripe- and GitHub-style keys, embedded JWTs and personal fields.

**Where's webhook health?**
In API diagnostics, with delivery success and failure codes per endpoint.

**Can support solve most of these without engineering?**
Expired tokens, wrong audiences, OAuth errors, certificate problems and deleted webhook endpoints usually can.

**Can I check a host before a customer reports a problem?**
Yes. Walk the connection to any host you are allowed to check; certificate expiry is reported even when the certificate is still valid, so you can warn customers early.

**Does the OAuth translator need the full request?**
No. The response body or the WWW-Authenticate header is enough.
