API reference

Simulate the customer

In the sandbox, reply as the customer or answer the call, so you can test every outcome without messaging anyone.

POST/v1/confirmations/{id}/simulate

With a test key, nothing reaches a real phone or inbox. This endpoint plays the customer's side instead: reply to the email or message in your own words, or answer the call and talk to the agent. The agent reads it exactly as it would a real reply, and the same outcomes and webhooks follow.

Request body

actionstringrequired

reply, answer, say or decline.

channelstringoptional

For reply: sms (the default, the message step) or email.

textstringrequired for `reply` and `say`

What the customer writes or says, up to 1,000 characters.

actionWhat it does
replyThe customer replies to the email or message. The agent answers on the same channel and, if the answer is clear, closes the confirmation
answerThe customer answers the call, which must be ringing. The agent greets them
sayThe customer says something on the call in progress. The agent's reply is added to the timeline
declineThe customer doesn't answer the ringing call, or hangs up the one in progress

Send the next step straight away with advance to get to the message or the call without waiting.

Returns

200 OK with the updated confirmation. The customer's words and the agent's answers are in and out events, with "live": false.

Errors

StatuscodeWhen
403live_modeThe key is a live key
404not_foundNo confirmation with that id for this key
409conflictNo call is ringing (answer) or in progress (say, decline)
422validation_failedAn unknown action, or text is missing
429rate_limitedMore than 120 in 10 minutes

Base URL https://api.anyonein.co.uk/v1 is a placeholder until the production domain is confirmed. Found a mistake? Tell us.