Contacts, agents and webhooks in the API
- New Feature
- Integration
The API can now send a contact to an agent, stop a conversation, opt out a contact or a phone number, list your agents and their fields, and add or remove webhooks.
Until now the API could find a contact and record a conversion. It now covers the other half of the loop.
Send a contact to an agent. Post a phone number and an agent, and Mav saves the contact and the agent starts working them. Each agent lists the fields it reads, so your form can match it: home fields for a home insurance agent, auto fields for the rest.
Stop a conversation. When a contact no longer needs follow-up, one call stops Mav's texts and calls for that conversation. The contact is not opted out.
Opt out a contact or a phone number. When someone asks your team to stop, one call stops Mav's texts and calls too, and adds the number to your blocked numbers. It works for a number Mav has never seen, so Mav doesn't start on it later.
Add webhooks from code. Name a URL, the events and the agents, and Mav posts each matching event as it happens. A webhook added this way shows in Mav next to the ones made there, and you can edit it in Mav and remove it in either place.
The API docs have a request and a response for every call. The Webhooks section there now matches how outbound notifications work: a webhook belongs to your account and covers every agent or the ones you pick.
Read the API docs Outbound webhooks and the API
API changes
POST /api/v3/contactssends a contact to an agent, which starts texting or calling them. A phone number you already have returns that contact.POST /api/v3/contacts/{contact_id}/stopstops a contact's open conversation without opting them out.POST /api/v3/contacts/{contact_id}/opt_outopts a contact out and adds their phone number to your blocked numbers. Mav sends no confirmation text.POST /api/v3/opt_outsopts out a phone number, whether or not you have a contact with it.- Stopping and opting out return
messages, which says what Mav did. GET /api/v3/agentslists your agents, each with itstype.GET /api/v3/agents/{agent_id}/contact_fieldslists the fields an agent reads on a new contact.GET /api/v3/eventslists every event a webhook can send.POST /api/v3/webhooksadds a webhook for the events and agents you name, with an optional bearer token. Webhooks returnmanaged_by, which iszapierfor one a Zap made.DELETE /api/v3/webhooks/{id}removes a webhook.GET /api/v3/webhooks/samplesreturns your newest events, in the shape a webhook delivers.- A webhook whose URL answers
410 Goneis now turned off right away, with no retries.