Create an inquiry
Create a lead with contact details and structured search preferences, and get its ID back.
/v1/ext/leads/inquiriesRequires the leads:ingest scope
On this page
Creates a lead from a contact form or any external service, with the contact details and search preferences you provide. This is the recommended way to send leads to Vestta.
Lead type
type accepts Vestta's lead types and a few English and Spanish aliases:
Matching is case-insensitive. Any other value fails.
Search preferences
search_preferences is a list of searches. Each entry has the operations and property types the lead wants, optional criteria per property type, and locations:
operations:venta,alquilerand/ortraspaso.property_types:apartamento,casa,local,nave,almacenaje,oficina,terreno,aparcamiento,edificio. Criteria for each type go in the object of the same name, such asapartamento.price_rent_maxorcasa.price_max.locations: places byname, or map areas in the same shapes as thelocationsfilter.
When at least one search has content, the lead is created with status searching_property; otherwise with status new.
Notes
Vestta writes a summary of the inquiry into the lead notes — operations, property types, locations, origin page and your message — so agents can read it at a glance. Your message is taken from search_preferences[0].internal_notes if set, otherwise from notes.
Defaults set by Vestta
Inquiries are always stored as active, with rating 3 and captured by Web. profile_category defaults to potencial, urgency_profile to poca-urgencia and source to manual — send "source": "web" or your site's name so agents know where the lead came from.
Duplicates
The primary phone is unique within a workspace:
- If a lead with the same phone exists without a name (for example, someone who first wrote on WhatsApp), it is completed with this inquiry and its
lead_idis returned. - If a lead with the same primary phone exists with a name, the request fails with
409. Treat it as "already in Vestta": do not retry.
Example request
curl -X POST "https://api.vestta.app/v1/ext/leads/inquiries" \
-H "X-Api-Key: $VESTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Ana García",
"type": "demandante",
"preferred_language": "es",
"phone_number_1": "+34600111222",
"personal_email": "ana@example.com",
"source": "web",
"sourcePage": "https://example.com/contacto",
"notes": "Busco piso de dos habitaciones cerca del centro.",
"search_preferences": [
{
"operations": [
"alquiler"
],
"property_types": [
"apartamento"
],
"apartamento": {
"price_rent_max": 1200,
"bedrooms_min": 2
},
"locations": [
{
"name": "Madrid"
}
]
}
]
}'Authorization
X-Api-KeystringheaderrequiredYour API key,
AC_LIVE_<key_id>.<secret>.Authorization: ApiKey <key>is also accepted.
Request body
application/json · required
namestringrequiredContact's full name.
dnistringNational ID document number.
typestringrequiredLead type.
buyer,comprador,demandante,tenantandinquilinoare stored asdemandante;ownerandpropietarioaspropietario. Other values must be a Vestta lead type (agencia-inmobiliaria,entidad-bancaria,proveedor-servicios).profile_categorystringstandardorpotencial. Defaults topotencial.urgency_profilestringalta-urgenciaorpoca-urgencia. Defaults topoca-urgencia.preferred_languagestringes,gb,fr,georit.phone_number_1stringrequiredPrimary phone. Normalised to E.164: include the international prefix (
+34600111222); numbers without one are read as Spanish.phone_number_2stringSecondary phone, normalised to E.164.
landline_phonestringLandline, normalised to E.164.
personal_emailstringPersonal email address.
professional_emailstringWork email address.
sourcestring default:manualWhere the inquiry comes from, e.g.
webor your site's name. Stored as the lead source; defaults tomanual.sourcePagestringURL of the page where the inquiry was submitted. Added to the lead notes.
notesstringFree-text message. Vestta stores a generated summary of the inquiry as the lead notes and includes this text in it, unless
search_preferences[0].internal_notesis set.search_preferencesarray of objectsWhat the contact is looking for. All entries are stored and used for property matching; the first one is summarised in the notes.
agency_property_idsarray of integersProperty IDs linked to the contact. Stored only when
typeisagencia-inmobiliaria.servicesarray of objectsServices offered by the contact. Stored only when
typeisentidad-bancariaorproveedor-servicios.
Accepted but ignored (6)
These fields pass validation because the endpoint shares its model with the Vestta app, but this endpoint does not use them. Leave them out.
ratinginteger default:0Ignored: inquiries are stored with rating 3.
activebooleanIgnored: inquiries are always stored as active.
captured_bystringIgnored: inquiries are stored as captured by
Web.agency_idinteger≥ 1Ignored by this endpoint.
agency_client_idsarray of integersIgnored by this endpoint.
time_to_createinteger default:0Ignored by this endpoint.
Response
200 Successful response.
Response fields
statusstringrequired alwaysokauthenticated_asstringName of the business that owns the API key.
lead_idintegerID of the created lead, or of the existing unnamed lead that was completed.
Errors
Error bodies and how to handle each case: Errors.