When a Call Fails
Overview#
APIs are down sometimes, tokens expire, and customers give the wrong reference number. A tool is not finished until you have decided what happens then.
What the agent says#
If the call fails is what the agent is told when the request does not come back — and it is what the customer effectively hears:
Sorry, I couldn't reach the policy system.Write it as something a customer can act on. Say what did not work and what to do instead:
"I can't reach our policy system at the moment. If it's urgent I can pass you to a colleague, or you can try again in a few minutes."
Never leak the error itself
The raw error is replaced by your wording on purpose. API errors mention hostnames, status codes and sometimes keys — none of which belongs in a customer conversation, and none of which the customer can do anything about.
The ways a call goes wrong#
| What happened | What it usually means |
|---|---|
| Timed out | The API took longer than the tool's timeout. Either it is struggling, or the timeout is too tight for it. |
| Refused the credential | The token is wrong, expired, or lacks permission for that endpoint. |
| Not found | The address is wrong, or the customer's reference does not exist. |
| Returned something unexpected | The call worked, but the response did not contain what was mapped. |
The last one is worth watching for, because it does not look like a failure. The call succeeded; the agent simply has nothing useful to say.
Finding out which#
Call it is the fastest way to tell these apart. It makes the real request from our servers and shows you what came back, so you can see whether the problem is the address, the credential, or which fields you ticked.
Work through it in this order:
- Does the call come back at all? If not, it is the address, the credential or the API itself.
- Does the response contain what you expect? If the call worked but the agent is told nothing, the dotted paths in the mapping do not match the response.
- Does it come back in time? A response that arrives after the timeout counts as a failure, even though the API is working.
Where a tool has inputs, fill in Try it with before calling — those sample values are what the trial request uses.
When the mapping is wrong#
If the response arrives but the agent is told nothing useful, check which fields are ticked under IT WILL BE GIVEN.
Call it again and the response is re-read, so you can tick different fields. An API that has changed shape — a value that moved, or a list that is now nested — shows up straight away, because the paths on offer come from the answer itself.
Only ticked fields reach the agent, so one left unticked is simply invisible: the call will look as though it did nothing.
Failures inside a flow#
In a flow, a failed call takes the It didn't branch. That branch is where you decide what the conversation does next — apologise and offer a callback, hand off to a person, or try a different route.
A flow whose failure branch is empty leaves the customer with nothing at all. The editor flags it, and it is worth taking seriously: the failure path is the one a customer meets on your worst day.
Before you let an agent use it#
- Call it with a value you know works, and check the fields you ticked are the right ones.
- Call it with a value you know is wrong — an id that does not exist — and check the failure message reads well.
- If it changes something, confirm the wording the customer is asked before it goes ahead.