[{"data":1,"prerenderedAt":415},["ShallowReactive",2],{"page:\u002Fleads\u002Fingest":3,"operation:ingestRentalLead":266},{"id":4,"title":5,"body":6,"description":256,"extension":257,"meta":258,"navigation":259,"operation":260,"path":261,"rawbody":262,"seo":263,"stem":264,"__hash__":265},"docs\u002Fleads\u002Fingest.md","Ingest a rental lead",{"type":7,"value":8,"toc":249},"minimark",[9,29,34,185,203,225,229,239],[10,11,12,13,17,18,22,23,28],"p",{},"Creates a lead looking to ",[14,15,16],"strong",{},"rent"," from a short form submission. Vestta turns the payload into a lead of type ",[19,20,21],"code",{},"demandante"," with search preferences, and a readable summary of the form in its notes. For full control over the lead, use ",[24,25,27],"a",{"href":26},"\u002Fleads\u002Finquiries","Create an inquiry"," instead.",[30,31,33],"h2",{"id":32},"how-the-payload-is-used","How the payload is used",[35,36,37,50],"table",{},[38,39,40],"thead",{},[41,42,43,47],"tr",{},[44,45,46],"th",{},"Field",[44,48,49],{},"What Vestta does with it",[51,52,53,64,93,111,121,131,141,172],"tbody",{},[41,54,55,61],{},[56,57,58],"td",{},[19,59,60],{},"contact.name",[56,62,63],{},"Lead name.",[41,65,66,72],{},[56,67,68,71],{},[19,69,70],{},"contact"," phone fields",[56,73,74,75,78,79,82,83,82,86,82,89,92],{},"The first value that is a valid phone number becomes the primary phone, in this order: ",[19,76,77],{},"areaCode"," + ",[19,80,81],{},"phoneNumber",", ",[19,84,85],{},"phoneE164",[19,87,88],{},"phone",[19,90,91],{},"phoneRaw",".",[41,94,95,100],{},[56,96,97],{},[19,98,99],{},"search.budget",[56,101,102,103,106,107,110],{},"The upper bound becomes the maximum monthly rent. ",[19,104,105],{},"1200"," and ",[19,108,109],{},"900-1200"," both mean 1,200 €.",[41,112,113,118],{},[56,114,115],{},[19,116,117],{},"search.habs",[56,119,120],{},"Minimum bedrooms, for apartments and houses.",[41,122,123,128],{},[56,124,125],{},[19,126,127],{},"search.location",[56,129,130],{},"The search location used for matching.",[41,132,133,138],{},[56,134,135],{},[19,136,137],{},"source",[56,139,140],{},"Lead source.",[41,142,143,169],{},[56,144,145,82,148,82,151,82,154,82,157,82,160,82,163,82,166],{},[19,146,147],{},"sourcePage",[19,149,150],{},"search.entryDate",[19,152,153],{},"search.exitDate",[19,155,156],{},"search.people",[19,158,159],{},"search.area",[19,161,162],{},"search.pets",[19,164,165],{},"search.workSituation",[19,167,168],{},"search.freeText",[56,170,171],{},"Written into the lead notes for the agent.",[41,173,174,182],{},[56,175,176,82,179],{},[19,177,178],{},"id",[19,180,181],{},"createdAt",[56,183,184],{},"Required, but not stored. Use them for your own tracing.",[10,186,187,188,191,192,106,195,198,199,202],{},"The lead is created with operation ",[19,189,190],{},"alquiler"," and property types ",[19,193,194],{},"apartamento",[19,196,197],{},"casa",", rating 3, and high urgency (",[19,200,201],{},"alta-urgencia",").",[204,205,206],"warning",{},[10,207,208,210,211,82,214,217,218,221,222,92],{},[19,209,99],{}," must be a whole number or a range of whole numbers. Values such as ",[19,212,213],{},"1.200",[19,215,216],{},"1200€"," or ",[19,219,220],{},"about 1000"," make the request fail with ",[19,223,224],{},"500",[30,226,228],{"id":227},"duplicates","Duplicates",[10,230,231,232,238],{},"If the workspace already has a lead with the same primary phone, ",[14,233,234,235],{},"nothing is created and the response is still ",[19,236,237],{},"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.",[10,240,241,242,245,246,92],{},"If no phone field holds a valid number, the request fails with ",[19,243,244],{},"422"," and the message ",[19,247,248],{},"Invalid phone number. Use international format, e.g. +34600111222",{"title":250,"searchDepth":251,"depth":251,"links":252},"",3,[253,255],{"id":32,"depth":254,"text":33},2,{"id":227,"depth":254,"text":228},"Create a rental-seeking lead from the compact payload used by rental landing forms.","md",{},true,"ingestRentalLead","\u002Fleads\u002Fingest","---\ntitle: Ingest a rental lead\ndescription: Create a rental-seeking lead from the compact payload used by rental landing forms.\noperation: ingestRentalLead\n---\n\nCreates 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](\u002Fleads\u002Finquiries) instead.\n\n## How the payload is used\n\n| Field | What Vestta does with it |\n| --- | --- |\n| `contact.name` | Lead name. |\n| `contact` phone fields | The first value that is a valid phone number becomes the primary phone, in this order: `areaCode` + `phoneNumber`, `phoneE164`, `phone`, `phoneRaw`. |\n| `search.budget` | The upper bound becomes the maximum monthly rent. `1200` and `900-1200` both mean 1,200 €. |\n| `search.habs` | Minimum bedrooms, for apartments and houses. |\n| `search.location` | The search location used for matching. |\n| `source` | Lead source. |\n| `sourcePage`, `search.entryDate`, `search.exitDate`, `search.people`, `search.area`, `search.pets`, `search.workSituation`, `search.freeText` | Written into the lead notes for the agent. |\n| `id`, `createdAt` | Required, but not stored. Use them for your own tracing. |\n\nThe lead is created with operation `alquiler` and property types `apartamento` and `casa`, rating 3, and high urgency (`alta-urgencia`).\n\n::warning\n`search.budget` must be a whole number or a range of whole numbers. Values such as `1.200`, `1200€` or `about 1000` make the request fail with `500`.\n::\n\n## Duplicates\n\nIf 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.\n\nIf no phone field holds a valid number, the request fails with `422` and the message `Invalid phone number. Use international format, e.g. +34600111222`.\n",{"title":5,"description":256},"leads\u002Fingest","rrIdI6OMHuoUcod6aNGujLJCRVEAKlFxScUCqU-eSl0",{"id":260,"method":267,"path":261,"fullPath":268,"summary":5,"tag":269,"scopes":270,"url":272,"description":273,"pathParams":274,"queryParams":275,"headerParams":276,"body":277,"responses":364,"samples":398,"docsPath":261},"POST","\u002Fv1\u002Fleads\u002Fingest","Leads",[271],"leads:ingest","https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest","Accepts the existing rental landing payload. Duplicate phones are ignored. Requires the `leads:ingest` scope.",[],[],[],{"schemaName":278,"required":259,"fields":279,"ignored":363},"RentingLead",[280,285,288,291,294,317],{"name":178,"type":281,"required":259,"nullable":282,"description":283,"constraints":284},"string",false,"Your identifier for the submission. Required, but not stored by Vestta.",[],{"name":181,"type":281,"required":259,"nullable":282,"description":286,"constraints":287},"When the form was submitted, ISO 8601. Required, but not stored by Vestta.",[],{"name":137,"type":281,"required":259,"nullable":282,"description":289,"constraints":290},"Where the lead comes from, e.g. `web`. Stored as the lead source.",[],{"name":147,"type":281,"required":259,"nullable":282,"description":292,"constraints":293},"URL of the page with the form. Added to the lead notes.",[],{"name":70,"type":295,"required":259,"nullable":282,"constraints":296,"children":297},"RentingLeadContact",[],[298,302,305,308,311,314],{"name":299,"type":281,"required":259,"nullable":282,"description":300,"constraints":301},"name","Contact's full name. Stored as the lead name.",[],{"name":88,"type":281,"required":259,"nullable":282,"description":303,"constraints":304},"Phone number. Include the international prefix (`+34600111222`); numbers without one are read as Spanish.",[],{"name":91,"type":281,"required":282,"nullable":259,"description":306,"constraints":307},"Phone exactly as typed. Used only when no other phone field can be normalised.",[],{"name":77,"type":281,"required":282,"nullable":259,"description":309,"constraints":310},"International prefix, e.g. `+34`. Combined with `phoneNumber` and tried first.",[],{"name":81,"type":281,"required":282,"nullable":259,"description":312,"constraints":313},"National number without prefix. Combined with `areaCode`.",[],{"name":85,"type":281,"required":282,"nullable":259,"description":315,"constraints":316},"Phone already in E.164 format. Tried after `areaCode` + `phoneNumber`.",[],{"name":318,"type":319,"required":259,"nullable":282,"constraints":320,"children":321},"search","RentingLeadSearch",[],[322,326,330,334,338,342,346,350,354,359],{"name":323,"type":281,"required":259,"nullable":282,"description":324,"constraints":325},"budget","Monthly budget in euros: a whole number (`1200`) or a range (`900-1200`). The upper bound is stored as the maximum rent.",[],{"name":327,"type":281,"required":259,"nullable":282,"description":328,"constraints":329},"entryDate","Desired move-in date. Free text, added to the lead notes; `YYYY-MM-DD` recommended.",[],{"name":331,"type":281,"required":259,"nullable":282,"description":332,"constraints":333},"exitDate","Desired move-out date. Free text, added to the lead notes.",[],{"name":335,"type":281,"required":259,"nullable":282,"description":336,"constraints":337},"people","Number of occupants. Added to the lead notes.",[],{"name":339,"type":281,"required":259,"nullable":282,"description":340,"constraints":341},"area","Preferred area, as free text. Added to the lead notes.",[],{"name":343,"type":281,"required":259,"nullable":282,"description":344,"constraints":345},"habs","Minimum bedrooms. Stored as the minimum bedrooms for apartments and houses.",[],{"name":347,"type":281,"required":259,"nullable":282,"description":348,"constraints":349},"pets","Whether the occupants have pets. Added to the lead notes.",[],{"name":351,"type":281,"required":259,"nullable":282,"description":352,"constraints":353},"workSituation","Employment situation. Added to the lead notes.",[],{"name":355,"type":356,"required":259,"nullable":282,"description":357,"constraints":358},"location","object","Location used for property matching, e.g. `{\"name\": \"Madrid\"}`, or a map area with `geometry`.",[],{"name":360,"type":281,"required":259,"nullable":282,"description":361,"constraints":362},"freeText","Free-text message from the contact. Added to the lead notes.",[],[],[365,380,384,387,390,393,396],{"status":237,"description":366,"schemaName":367,"fields":368,"example":378,"exampleHtml":379},"Successful response.","LeadIngestResponse",[369,374],{"name":370,"type":281,"required":259,"nullable":282,"enumValues":371,"constraints":373},"status",[372],"ok",[],{"name":375,"type":281,"required":282,"nullable":259,"description":376,"constraints":377},"authenticated_as","Name of the business that owns the API key.",[],"{\n  \"status\": \"ok\",\n  \"authenticated_as\": \"Inmobiliaria Ejemplo\"\n}","\u003Cpre class=\"shiki github-light\" style=\"background-color:#fff;color:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#005CC5\">  \"status\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"ok\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#005CC5\">  \"authenticated_as\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Inmobiliaria Ejemplo\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"status":381,"description":382,"schemaName":383},"401","The API key is missing, malformed, unknown, revoked or expired.","ExternalApiError",{"status":385,"description":386,"schemaName":383},"403","The API key lacks the required scope.",{"status":388,"description":389,"schemaName":383},"404","The resource does not exist in this business.",{"status":391,"description":392,"schemaName":383},"409","Duplicate contact or idempotency key reused with a different payload.",{"status":244,"description":394,"schemaName":395},"A path parameter, query parameter or body field is invalid.","ExternalValidationError",{"status":224,"description":397,"schemaName":383},"Unexpected server error while processing the request.",[399,405,410],{"id":400,"label":401,"lang":402,"code":403,"html":404},"curl","cURL","bash","curl -X POST \"https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest\" \\\n  -H \"X-Api-Key: $VESTTA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"id\": \"web-123\",\n  \"createdAt\": \"2026-09-22T10:30:00Z\",\n  \"source\": \"web\",\n  \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Falquiler\",\n  \"contact\": {\n    \"name\": \"Ana García\",\n    \"phone\": \"+34600111222\"\n  },\n  \"search\": {\n    \"budget\": \"900-1200\",\n    \"entryDate\": \"2026-10-01\",\n    \"exitDate\": \"2027-09-30\",\n    \"people\": \"2\",\n    \"area\": \"Madrid centro\",\n    \"habs\": \"2\",\n    \"pets\": \"No\",\n    \"workSituation\": \"Contrato indefinido\",\n    \"location\": {\n      \"name\": \"Madrid\"\n    },\n    \"freeText\": \"Preferimos una vivienda amueblada\"\n  }\n}'","\u003Cpre class=\"shiki github-light\" style=\"background-color:#fff;color:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6F42C1\">curl\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\"> -X\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\"> POST\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\"> \"https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest\"\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\"> \\\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#005CC5\">  -H\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\"> \"X-Api-Key: \u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">$VESTTA_API_KEY\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\"> \\\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#005CC5\">  -H\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\"> \"Content-Type: application\u002Fjson\"\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\"> \\\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#005CC5\">  -d\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\"> '{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"id\": \"web-123\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"createdAt\": \"2026-09-22T10:30:00Z\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"source\": \"web\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Falquiler\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"contact\": {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"name\": \"Ana García\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"phone\": \"+34600111222\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"search\": {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"budget\": \"900-1200\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"entryDate\": \"2026-10-01\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"exitDate\": \"2027-09-30\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"people\": \"2\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"area\": \"Madrid centro\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"habs\": \"2\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"pets\": \"No\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"workSituation\": \"Contrato indefinido\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"location\": {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"name\": \"Madrid\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"freeText\": \"Preferimos una vivienda amueblada\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">}'\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":406,"label":407,"lang":406,"code":408,"html":409},"javascript","JavaScript","const response = await fetch('https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': process.env.VESTTA_API_KEY,\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    \"id\": \"web-123\",\n    \"createdAt\": \"2026-09-22T10:30:00Z\",\n    \"source\": \"web\",\n    \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Falquiler\",\n    \"contact\": {\n      \"name\": \"Ana García\",\n      \"phone\": \"+34600111222\"\n    },\n    \"search\": {\n      \"budget\": \"900-1200\",\n      \"entryDate\": \"2026-10-01\",\n      \"exitDate\": \"2027-09-30\",\n      \"people\": \"2\",\n      \"area\": \"Madrid centro\",\n      \"habs\": \"2\",\n      \"pets\": \"No\",\n      \"workSituation\": \"Contrato indefinido\",\n      \"location\": {\n        \"name\": \"Madrid\"\n      },\n      \"freeText\": \"Preferimos una vivienda amueblada\"\n    }\n  }),\n})\n\nconst data = await response.json()","\u003Cpre class=\"shiki github-light\" style=\"background-color:#fff;color:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#D73A49\">const\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\"> response\u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\"> =\u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\"> await\u003C\u002Fspan>\u003Cspan style=\"color:#6F42C1\"> fetch\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">(\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">'https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest'\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">, {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">  method: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">'POST'\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">  headers: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    'X-Api-Key'\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: process.env.\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">VESTTA_API_KEY\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    'Content-Type'\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">'application\u002Fjson'\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">  },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">  body: \u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">JSON\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">.\u003C\u002Fspan>\u003Cspan style=\"color:#6F42C1\">stringify\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">({\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"id\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"web-123\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"createdAt\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2026-09-22T10:30:00Z\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"source\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"web\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"sourcePage\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"https:\u002F\u002Fexample.com\u002Falquiler\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"contact\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Ana García\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"phone\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"+34600111222\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">    },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"search\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"budget\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"900-1200\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"entryDate\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2026-10-01\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"exitDate\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2027-09-30\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"people\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"area\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Madrid centro\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"habs\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"pets\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"No\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"workSituation\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Contrato indefinido\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"location\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Madrid\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">      },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"freeText\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Preferimos una vivienda amueblada\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">  }),\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">})\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#D73A49\">const\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\"> data\u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\"> =\u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\"> await\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\"> response.\u003C\u002Fspan>\u003Cspan style=\"color:#6F42C1\">json\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">()\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":411,"label":412,"lang":411,"code":413,"html":414},"python","Python","import os\n\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest\",\n    headers={\"X-Api-Key\": os.environ[\"VESTTA_API_KEY\"]},\n    json={\n        \"id\": \"web-123\",\n        \"createdAt\": \"2026-09-22T10:30:00Z\",\n        \"source\": \"web\",\n        \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Falquiler\",\n        \"contact\": {\n            \"name\": \"Ana García\",\n            \"phone\": \"+34600111222\",\n        },\n        \"search\": {\n            \"budget\": \"900-1200\",\n            \"entryDate\": \"2026-10-01\",\n            \"exitDate\": \"2027-09-30\",\n            \"people\": \"2\",\n            \"area\": \"Madrid centro\",\n            \"habs\": \"2\",\n            \"pets\": \"No\",\n            \"workSituation\": \"Contrato indefinido\",\n            \"location\": {\n                \"name\": \"Madrid\",\n            },\n            \"freeText\": \"Preferimos una vivienda amueblada\",\n        },\n    },\n)\nresponse.raise_for_status()\ndata = response.json()","\u003Cpre class=\"shiki github-light\" style=\"background-color:#fff;color:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#D73A49\">import\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\"> os\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#D73A49\">import\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\"> requests\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">response \u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\">=\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\"> requests.post(\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Fingest\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E36209\">    headers\u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\">=\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">{\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"X-Api-Key\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: os.environ[\u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"VESTTA_API_KEY\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">]},\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E36209\">    json\u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\">=\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"id\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"web-123\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"createdAt\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2026-09-22T10:30:00Z\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"source\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"web\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"sourcePage\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"https:\u002F\u002Fexample.com\u002Falquiler\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"contact\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Ana García\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"phone\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"+34600111222\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">        },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"search\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"budget\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"900-1200\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"entryDate\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2026-10-01\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"exitDate\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2027-09-30\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"people\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"area\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Madrid centro\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"habs\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"2\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"pets\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"No\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"workSituation\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Contrato indefinido\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"location\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">                \"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Madrid\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">            },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">            \"freeText\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Preferimos una vivienda amueblada\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">        },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">    },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">response.raise_for_status()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">data \u003C\u002Fspan>\u003Cspan style=\"color:#D73A49\">=\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\"> response.json()\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",1791929309891]