AI agent that texts back missed calls
How an AI agent on your business number texts a caller within seconds of a missed call, finds out what they needed and books them, using the agent.call_ended event and one API call.

A customer calls a detailing shop at 12:10. Both techs are under a car, the phone rings six times and goes to voicemail. The customer does not leave one. Nobody does any more. They scroll to the next shop in the map results and call that.
The fix is not answering every call. It is making sure the caller hears from you before they dial the next number. An agent on the shop's line can text them inside a few seconds: "Sorry we missed you at Bayview Detailing. What can we help with?" Most people answer a text they would never have left as a voicemail.
Two building blocks
This use case needs exactly two things from the API.
The first is the agent.call_ended webhook event. Every call on your number ends with one of these. When the call reached an agent it carries the transcript and an analysis of what was said. For a call nobody picked up, the useful part is the caller's number and the fact that it never connected.
The second is POST /v1/messages. Same number, caller's number, a short body. That is the whole text-back.
curl https://api.agentphone.ai/v1/messages \-H "Authorization: Bearer $AGENTPHONE_API_KEY" \-H "Content-Type: application/json" \-d '{"number_id": "num_bayview","to_number": "+14155550177","body": "Sorry we missed your call at Bayview Detailing. What can we help with? Reply STOP to opt out."}'
Your handler receives the event, sees the call was not answered, and sends the text. Ten lines of code in most stacks. Record the call id before you send, and skip the send if a retried webhook delivery brings the same id again.
What the agent does once they reply
The caller writes back "need a full interior clean, how much and when". That reply lands as an agent.message event on the same webhook, in the same conversation, with recentHistory showing the text-back you just sent. From here it is an ordinary texting agent: quote from your price list, offer two slots, book the one they pick, confirm in the thread.
A few things we have learned running this:
- Keep the first text short and specific to the business. "Sorry we missed your call" plus one question. Not a paragraph.
- Send it from the same number they called. A text from a different number after a missed call looks like spam.
- Voicemail is available on every number. If you keep it on and the caller leaves one, the text-back can say so: "Got your voicemail, we will call back by 2."
- Store what you learn in
conversationState. If the shop calls them back later, the thread already says "interior clean, Thursday preferred".
When a human should take over
Not every missed call wants an agent. A caller who texts back "it's about the invoice you sent me, it's wrong" should reach a person. Your model can spot that and reply "Let me get Ana to look at this, she will text you here within the hour", then flag the conversation. The customer stays on one thread with one number the whole time.
If you want the agent to actually answer calls rather than just text back afterwards, that is the AI receptionist setup and the two combine well: hosted voice picks up when it can and the text-back covers the calls that still slip through.
Registration
The text-back is an outbound message from a US local number, so it needs 10DLC registration. A missed call is a reason to reach out, not consent to text. A phone number on its own is not consent. Carriers want a documented opt-in: a checkbox next to the phone field, a verbal yes you record, or a keyword the person texts you. Collect it, keep the evidence and describe that exact flow in the registration. A line in your voicemail greeting and on your website that says you reply to missed calls by text, and the caller's option to reply STOP, is the shape that gets approved. We submit the registration, review it, and approval usually takes one to three business days. $25 once for a sole proprietor or standard brand.
Inbound texts and the voice side both work without registration, so you can wire up the webhook and test the whole flow on inbound while it is pending.
What it costs
| Item | Price |
|---|---|
| Number | $3 per month |
| Text-back sent | $0.02 per segment |
| Each reply, both directions | $0.02 per segment |
| Call answered by hosted AI instead | $0.22 per minute |
| 10DLC registration | $25 once for a sole proprietor or standard brand |
A shop missing 150 calls a month that texts each one back and gets a short conversation out of half of them spends under $10 on messages. Prices are from the pricing page.
FAQ
How quickly can the text go out after a missed call? As soon as the agent.call_ended event reaches your webhook and your handler calls POST /v1/messages, usually within seconds of the call ending.
Does the text come from the same number the customer called? Yes. The number is both the voice line and the texting line, so the text-back shows up under the number they just dialled.
Do I need 10DLC registration for missed-call text-backs? Yes, because the text-back is outbound from a US local number. AgentPhone submits the registration for $25 (sole proprietor or standard brand) and carriers usually approve in one to three business days.
What if the caller left a voicemail? Voicemail stays available on the number. Your text-back can acknowledge it and promise a callback, or you can skip the text for callers who left one.
Can the agent book the appointment over text? Yes. Replies come back as agent.message events with the conversation history, your agent offers slots and books the one the caller picks.


