Skip to content

Loading…

Ingest a rental lead

Create a rental-seeking lead from the compact payload used by rental landing forms.

POST/v1/leads/ingest

Requires the leads:ingest scope

On this page

Creates a lead of type demandante from a rental form submission, with a readable summary in its notes and a tenant profile. General search forms also create a search request from the criteria sent, even when partial. Forms about a specific property (propertyId) save the candidacy without creating a general search request. For full control over the lead, use Create an inquiry instead.

How the payload is used

FieldWhat Vestta does with it
contact.nameLead name.
contact phone fieldsThe first value that is a valid phone number becomes the primary phone, in this order: areaCode + phoneNumber, phoneE164, phone, phoneRaw.
search.budgetFor general searches, the upper bound becomes the maximum monthly rent. 1200 and 900-1200 both mean 1,200 €. Empty means unknown.
search.habsFor general searches, minimum bedrooms for apartments and houses. Empty means unknown.
search.locationFor general searches, the location used for matching. {} means unknown.
sourceLead source.
sourcePage, search.entryDate, search.exitDate, search.people, search.area, search.pets, search.workSituation, search.freeTextWritten into the lead notes for the agent. The ones Vestta can read also fill the tenant profile (see below).
tenantOptional. Structured tenant data stored as the contact's tenant profile.
propertyIdOptional. The property the form was about: the contact becomes a candidate of its open rental, without a general search request. Search criteria remain in the notes.
id, createdAtRequired, but not stored. Use them for your own tracing.

All new leads have rating 3 and high urgency (alta-urgencia). Without propertyId, sending a budget, bedroom count or location creates a general residential search with operation alquiler and property types apartamento and casa; missing criteria remain unset. A profile alone (income, employment, pets, occupants or dates) does not create a search request. Leads without a search request start with status new; those with one start with searching_property.

Tenant profile and rental applications

Each lead keeps one tenant profile, which Vestta compares with the requirements of every rental the agency is marketing. It is filled from:

  • search.people (a number of occupants), search.pets (No, Sí, Sí, un gato…), search.workSituation (Contrato indefinido, Autónomo, Estudiante…), search.entryDate and search.exitDate (as YYYY-MM-DD, for the move-in date and the length of stay). A value Vestta cannot read is left out of the profile, never guessed.
  • tenant, when you send it. Its fields always win over what was read from search, and it is the only way to send the household's net monthly income (monthlyIncome), smokers, a guarantor or the contact's consent to hear about other rentals (benchConsent).

With propertyId, the contact is added as a candidate of that property's open rental and rated against its requirements right away. If the property has no open rental, or the lead cannot be a tenant, the lead is still created and nothing else happens: the request does not fail.

Duplicates

If the workspace already has a lead with the same primary phone, nothing is created and the response is still 200, without a lead ID. The existing lead is not updated, except for its tenant profile and, with propertyId, its rental application: answers are merged into the profile and the contact is added as a candidate unless they already are. This makes retries safe.

If no phone field holds a valid number, the request fails with 422 and the message Invalid phone number. Use international format, e.g. +34600111222.

Example request

curl -X POST "https://api.vestta.io/v1/leads/ingest" \
  -H "X-Api-Key: $VESTTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "web-123",
  "createdAt": "2026-09-22T10:30:00Z",
  "source": "web",
  "sourcePage": "https://example.com/alquiler",
  "contact": {
    "name": "Ana García",
    "phone": "+34600111222"
  },
  "search": {
    "budget": "900-1200",
    "entryDate": "2026-10-01",
    "exitDate": "2027-09-30",
    "people": "2",
    "area": "Madrid centro",
    "habs": "2",
    "pets": "No",
    "workSituation": "Contrato indefinido",
    "location": {
      "name": "Madrid"
    },
    "freeText": "Preferimos una vivienda amueblada"
  }
}'

Authorization

  • X-Api-Keystringheaderrequired

    Your API key, AC_LIVE_<key_id>.<secret>. Authorization: ApiKey <key> is also accepted.

Request body

application/json · required

  • idstringrequired

    Your identifier for the submission. Required, but not stored by Vestta.

  • createdAtstringrequired

    When the form was submitted, ISO 8601. Required, but not stored by Vestta.

  • sourcestringrequired

    Where the lead comes from, e.g. web. Stored as the lead source.

  • sourcePagestringrequired

    URL of the page with the form. Added to the lead notes.

  • contactRentingLeadContactrequired
  • searchRentingLeadSearchrequired
  • tenantRentingLeadTenant

    Structured tenant data. Stored as the contact's tenant profile, which rates them against each rental's requirements.

  • propertyIdinteger≥ 1

    Vestta property the form was about. When it has an open rental, the contact becomes a candidate of it. No general search request is created for a property-specific submission, even without an open rental.

Response

200 Successful response.

Example response
{
  "status": "ok",
  "authenticated_as": "Inmobiliaria Ejemplo"
}

Response fields

  • statusstringrequired always ok
  • authenticated_asstring

    Name of the business that owns the API key.

Errors

StatusWhen
401 UnauthorizedThe API key is missing, malformed, unknown, revoked or expired.
403 ForbiddenThe API key lacks the required scope, or the business plan does not include API access.
404 Not FoundThe resource does not exist in this business.
409 ConflictDuplicate contact or idempotency key reused with a different payload.
422 Unprocessable ContentA path parameter, query parameter or body field is invalid.
429 The API key reached its request limit. Wait for the number of seconds in `Retry-After` before retrying.
500 Internal Server ErrorUnexpected server error while processing the request.

Error bodies and how to handle each case: Errors.