Back to resources

Know who is calling before you answer, and greet every customer by name

How to make your voice agent know who is calling before it answers and greet them by name, step by step, and what happens if your system doesn't reply.

What knowing who is calling before you answer means

As soon as a call comes in, and before your agent says its first word, Lera asks your system a question. It passes on the caller's number and asks whose it is.

By your system we mean wherever you keep your customers, such as your CRM, your business software or one of your own automations in n8n. Your system replies with whatever it knows about that number, like the name, whether they're already a customer or what their last request was, and your agent uses it from the very first sentence.

The technical name is a pre-call webhook. A webhook is an automatic message one program sends another at a specific moment, here when the call comes in, to a web address you provide.

Take a customer service line. Marta calls to ask what time you close today. Your system recognises her number, replies "Marta", and the first thing she hears is "Hi Marta, thanks for calling, how can I help?". She didn't have to introduce herself.

What it's good for

Existing customers feel recognised from the first second, without having to say who they are every time they call.

Your agent can treat a customer differently from a first-time caller. If your system says they're already a customer, your instructions can tell the agent to get straight to the point, or not to ask again for details you already have.

And that data stays at hand for the whole call. Whatever it returns is saved as variables, named slots like {{customer_name}} that fill themselves in, ready for the greeting, the instructions and any flow.

A function at the start of the conversation can't do this. The greeting is spoken before the caller says anything, and a function only runs once the conversation has started, so at best you'd recognise them from their second sentence.

How to set it up, step by step

Open your agent in Agents and find the Know who is calling section. Turn on "Ask my system who is calling".

In "Your endpoint", paste the web address of the part of your system that will answer. It must start with https, and whoever looks after your CRM or your automations can give it to you.

Under "When to ask", choose where it should ask. Inbound phone calls are ticked by default, and you can add calls from your website and outbound calls.

Click Test. Lera sends the real request with an example number, which you can swap for your own, and shows you exactly what your system replied and how long it took. Always do this before opening it up to customers, so any problem shows up here rather than on a real call.

Put the name in the greeting. In Welcome message, write something like "Hi {{customer_name}}, thanks for calling". The slot's name has to match the one your system uses in its reply. In a flow agent, the greeting goes in the start node.

Save and publish the agent. If you'd rather, you can also ask Maite, the panel's copilot, with something like "make my agent know who's calling, the address is…".

What your system receives and what it sends back

Lera sends your system the caller's number, the number they dialled, whether the call is coming in by phone or from your website, and a call ID you can use later to match it with its summary.

Your system replies with a list of named values, like customer_name, is_customer or last_request. You choose the names, in lowercase with underscores, and every value is sent as text. Whoever builds it will find the exact format in the developer documentation, and if the reply doesn't follow it, the call carries on without the name and Test tells you why.

Every request is signed with the same secret as your functions, the one under Tools. That way your system can check the request really comes from your Lera account.

By default, your system's reply can only give the agent data. It can do other things, such as rejecting the call or handing it to another of your agents, but those are switched off and you turn them on one at a time under "What your response may do". So if your system ever replies with something odd, it can't start hanging up on callers by itself.

What to know

While your system replies, the caller hears silence. The call has already been picked up, which is why Lera waits 2.5 seconds at most by default. Under "How long we wait" you can choose 1, 2.5 or 4 seconds, and that time also covers any retries.

If your system doesn't reply in time or fails, the call is answered anyway, by your usual agent and without the name. You never lose a call because your system is down. In the call's detail, under Call history, you'll see a "Lookup in your system before answering" line with what happened and how long it took.

Write the greeting so it also sounds right without the name. If the name doesn't arrive, the slot is simply skipped, and "Hi {{customer_name}}, thanks for calling" becomes "Hi, thanks for calling".

The caller's number can be spoofed. It's fine for a greeting, but before giving out a balance, an appointment or an order status, have the agent ask for something only the account holder knows, like their customer number, and check it with a function.

Connecting your agent to your system isn't included in every plan. The pricing page shows which ones have it.

Frequently asked questions

Does it work for website calls and outbound calls too? Yes. Under "When to ask" you choose inbound phone calls, calls from your website or outbound calls. Website calls have no caller number, and your system receives the channel so it knows. On an outbound call, the person's number is the one you're calling.

What if they call from a withheld number? Your system gets no number to look up, so the agent greets them without a name and the call carries on as normal.

Do I need to know how to code? Not in the panel. What you need is the web address that answers, and that's set up by whoever looks after your CRM, your business software or your automations.

How much does it cost to try? €20 free credit, no card needed. You can connect your system, click Test and call yourself to hear how it greets you.