API reference
The confirmation object
A confirmation is one delivery or collection that AnyoneIn is checking with the customer. It carries the order, the plan, every message in and out, and the outcome.
A confirmation is created from one order. It holds what you sent (normalised), the plan of steps it will work through, a timeline of events, and, once the customer has answered, an outcome.
Attributes
idstringUnique identifier,
cf_followed by 16 hex characters.createdAtstringWhen it was created, ISO 8601 in UTC.
updatedAtstringWhen anything on it last changed.
sourcestringapifor confirmations created through the API.externalIdstring or nullYour own reference, as you sent it. Not required to be unique.
brandobjectThe name,
colors.primary,supportEmailandtoneused in every message. See create.customerobjectname,first(what the agent calls them),phonein E.164 andemailin lower case.orderobjectref,type(deliveryorcollection),date,window,items,address,requiresSignature,notesandrescheduleOptions. After a customer picks another slot,dateandwindowhold the new slot andpreviousholds the original.channelsobjectWhich of
email,smsandcallare switched on.smsViastringsmsorwhatsapp.cadencestringstandardordemo. See cadence.webhookUrlstringWhere
confirmation.updatedevents are sent. Empty if you didn't set one.statusstringWhere it is in its life. See statuses.
outcomeobject or nullThe customer's answer, once there is one. See outcome.
stepsarrayThe plan: one step per channel, in order. See steps.
eventsarrayEverything that happened, oldest first: messages out, replies in, what the agent understood. See events. Left out of list responses.
callobject or nullThe latest phone call:
state(queued,ringing,in_progressorcompleted),live,startedAt,answeredAtandendedAt.callAttemptsintegerHow many calls have been placed. The standard cadence retries an unanswered call once.
giveUpAtstringPresent once every step has gone out: when it will be marked
unreachableif nobody replies.optedOutbooleanPresent and
trueonce the customer has asked to stop. Nothing more is sent to them.webhookobjectThe result of the last webhook delivery:
{ "status": 200, "at": "…" }, or{ "error": "…", "at": "…" }if it couldn't be delivered.links.customerstringThe customer's branded page, signed and unique to them. It has one-tap buttons for "I'll be in", "someone else will be in" and "I need a different day". The email and text link to it.
emailThreadbooleanWhether an email thread exists that the customer can reply to.
Statuses
Every confirmation starts scheduled, moves to in_progress when the first step goes out or the customer replies, and closes in one of five states.
| Status | Open? | Meaning | What ops usually does |
|---|---|---|---|
scheduled | Yes | Created; nothing has gone out yet | Nothing |
in_progress | Yes | At least one step has gone out, or the customer has replied | Nothing |
confirmed | No | Someone will be in. outcome.signerName is set if it's someone else | Dispatch |
rescheduled | No | The customer picked one of your rescheduleOptions. order.date and order.window hold the new slot | Move the booking in your system |
action_needed | No | A clear answer that needs a person: a different day, cancel, wrong person, opted out, or wants a person | Read outcome.summary and follow up |
unreachable | No | Every step went out and nobody answered | Call the customer before dispatch |
cancelled | No | You cancelled it | Nothing |
A closed confirmation can still change: if the customer writes again after it closed ("actually, can we make it Thursday?"), the agent reads it and the status and outcome can update. You get another webhook when that happens.
Outcome
outcome is null until there's an answer. Then it looks like this:
intentstringWhat the customer meant. See the table below.
summarystringOne plain sentence for your team, such as "Confirmed; partner Jo will sign." or "Can't do Tuesday, prefers any weekday after 3pm."
signerNamestring or nullFor
alternate_signer: who will be in instead.preferredstring or nullFor
reschedule: what suits them, in their words.newSlotobject or nullFor
pick_option: thedateandwindowthey picked.channelstring or nullWhere the answer came from:
email,sms,callorweb(the customer page).nullforno_response.atstringWhen the outcome was decided.
intent | Status | Meaning |
|---|---|---|
confirm | confirmed | They, or someone 18 or over in the household, will be in |
alternate_signer | confirmed | Someone else, named in signerName, will be in |
pick_option | rescheduled | They chose one of your rescheduleOptions |
reschedule | action_needed | They can't do it and none of the offered slots work. preferred says what would |
cancel | action_needed | They want to cancel the order |
not_customer | action_needed | Wrong person or wrong number |
opt_out | action_needed | They asked to stop (STOP, unsubscribe). optedOut is set |
human | action_needed | They want a person, are unhappy, or raised something the agent can't handle, such as damage or a refund |
no_response | unreachable | Nobody answered any step |
Along the way the agent may also record question (it answered a question and asked again) or unclear (it asked them to clarify). These appear on ai events, never as an outcome.
Steps
Each channel you switch on gets one step, in the order email, text, call. A step is a planned message or call.
idstringst_followed by 8 hex characters.channelstringemail,smsorcall. WithsmsVia: "whatsapp", thesmsstep goes by WhatsApp.dueAtstringWhen it's due to go out.
statestringpending,sending,sent,delivered(a text the network confirmed),failed,cancelled(no longer needed), or for callsanswered,no_answerorvoicemail.livebooleantrueif it went through a real provider,falsein the sandbox.sentAtstringWhen it went out.
detailstringWhy it failed, if it did.
retrybooleantrueon the extra call step added after an unanswered call.
When a step fails, the next one is brought forward to a few seconds later. When the customer replies, every pending step is held back (by eight hours on the standard cadence), so nobody gets a text while they're mid-conversation by email.
Events
events is the timeline, oldest first, capped at the latest 500.
idstringev_followed by 10 hex characters.atstringWhen it happened.
kindstringsystem(a note, such as "Calling Priya…"),out(a message or line we sent or said),in(what the customer wrote or said),ai(what the agent understood from it) oroutcome.channelstringemail,sms,callorweb. Absent on some system events.textstringThe message, the line of the call, or the note.
subjectstringOn outbound emails.
htmlstringOn outbound emails: the full HTML that was sent.
intentstringOn
aiandoutcomeevents.tonestringgood,warnorbad, for display.livebooleanWhether it happened over a real channel.
viastringOn texts:
smsorwhatsapp.
Call transcripts are events too: each turn of the call is an out or in event with channel: "call".
Cadence
cadence decides when steps go out.
standard | demo | |
|---|---|---|
| 10am, three days before | About two seconds after creation | |
| Text | 10am, two days before | About 90 seconds later |
| Call | 11am, the day before | About 90 seconds after the text |
| Gap between steps | At least 2 hours | About 90 seconds |
| Contact hours | Email 7am–9pm, texts and calls 9am–8pm, UK time | None |
| Unanswered call | One retry about 3 hours later | No retry |
| Pause after a reply | 8 hours | 3 minutes |
Marked unreachable | 6 hours after the last step | 2 minutes after the last step |
On the standard cadence a step is never scheduled in the past: if the delivery is only a day or two away, the steps go out sooner, still two hours apart and inside contact hours.
Important
If you leave cadence out, the current release uses demo. Always send "cadence": "standard" for real customers.
Base URL https://api.anyonein.co.uk/v1 is a placeholder until the production domain is confirmed. Found a mistake? Tell us.