Skip to content

Loading…

Ingest a rental lead

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

POST/v1/ext/leads/ingest

Requires the leads:ingest scope

On this page

Creates a lead looking to rent from a short form submission. Vestta turns the payload into a lead of type demandante with search preferences, and a readable summary of the form in its notes. 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.budgetThe upper bound becomes the maximum monthly rent. 1200 and 900-1200 both mean 1,200 €.
search.habsMinimum bedrooms, for apartments and houses.
search.locationThe search location used for matching.
sourceLead source.
sourcePage, search.entryDate, search.exitDate, search.people, search.area, search.pets, search.workSituation, search.freeTextWritten into the lead notes for the agent.
id, createdAtRequired, but not stored. Use them for your own tracing.

The lead is created with operation alquiler and property types apartamento and casa, rating 3, and high urgency (alta-urgencia).

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. This makes retries safe, but it also means a returning visitor's new form is not recorded.

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.app/v1/ext/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

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, or lacks the required scope.
422 Unprocessable ContentA path parameter, query parameter or body field is invalid.
500 Internal Server ErrorUnexpected server error while processing the request.

Error bodies and how to handle each case: Errors.