[{"data":1,"prerenderedAt":405},["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,"body":276,"responses":363,"samples":388,"docsPath":261},"POST","\u002Fv1\u002Fext\u002Fleads\u002Fingest","Leads",[271],"leads:ingest","https:\u002F\u002Fapi.vestta.app\u002Fv1\u002Fext\u002Fleads\u002Fingest","Creates a rental-seeking lead from the compact payload used by rental landing forms. If the business already has a lead with the same primary phone, nothing is created and the response is still `ok`. Requires the `leads:ingest` scope.",[],[],{"schemaName":277,"required":259,"fields":278,"ignored":362},"RentingLead",[279,284,287,290,293,316],{"name":178,"type":280,"required":259,"nullable":281,"description":282,"constraints":283},"string",false,"Your identifier for the submission. Required, but not stored by Vestta.",[],{"name":181,"type":280,"required":259,"nullable":281,"description":285,"constraints":286},"When the form was submitted, ISO 8601. Required, but not stored by Vestta.",[],{"name":137,"type":280,"required":259,"nullable":281,"description":288,"constraints":289},"Where the lead comes from, e.g. `web`. Stored as the lead source.",[],{"name":147,"type":280,"required":259,"nullable":281,"description":291,"constraints":292},"URL of the page with the form. Added to the lead notes.",[],{"name":70,"type":294,"required":259,"nullable":281,"constraints":295,"children":296},"RentingLeadContact",[],[297,301,304,307,310,313],{"name":298,"type":280,"required":259,"nullable":281,"description":299,"constraints":300},"name","Contact's full name. Stored as the lead name.",[],{"name":88,"type":280,"required":259,"nullable":281,"description":302,"constraints":303},"Phone number. Include the international prefix (`+34600111222`); numbers without one are read as Spanish.",[],{"name":91,"type":280,"required":281,"nullable":259,"description":305,"constraints":306},"Phone exactly as typed. Used only when no other phone field can be normalised.",[],{"name":77,"type":280,"required":281,"nullable":259,"description":308,"constraints":309},"International prefix, e.g. `+34`. Combined with `phoneNumber` and tried first.",[],{"name":81,"type":280,"required":281,"nullable":259,"description":311,"constraints":312},"National number without prefix. Combined with `areaCode`.",[],{"name":85,"type":280,"required":281,"nullable":259,"description":314,"constraints":315},"Phone already in E.164 format. Tried after `areaCode` + `phoneNumber`.",[],{"name":317,"type":318,"required":259,"nullable":281,"constraints":319,"children":320},"search","RentingLeadSearch",[],[321,325,329,333,337,341,345,349,353,358],{"name":322,"type":280,"required":259,"nullable":281,"description":323,"constraints":324},"budget","Monthly budget in euros: a whole number (`1200`) or a range (`900-1200`). The upper bound is stored as the maximum rent.",[],{"name":326,"type":280,"required":259,"nullable":281,"description":327,"constraints":328},"entryDate","Desired move-in date. Free text, added to the lead notes; `YYYY-MM-DD` recommended.",[],{"name":330,"type":280,"required":259,"nullable":281,"description":331,"constraints":332},"exitDate","Desired move-out date. Free text, added to the lead notes.",[],{"name":334,"type":280,"required":259,"nullable":281,"description":335,"constraints":336},"people","Number of occupants. Added to the lead notes.",[],{"name":338,"type":280,"required":259,"nullable":281,"description":339,"constraints":340},"area","Preferred area, as free text. Added to the lead notes.",[],{"name":342,"type":280,"required":259,"nullable":281,"description":343,"constraints":344},"habs","Minimum bedrooms. Stored as the minimum bedrooms for apartments and houses.",[],{"name":346,"type":280,"required":259,"nullable":281,"description":347,"constraints":348},"pets","Whether the occupants have pets. Added to the lead notes.",[],{"name":350,"type":280,"required":259,"nullable":281,"description":351,"constraints":352},"workSituation","Employment situation. Added to the lead notes.",[],{"name":354,"type":355,"required":259,"nullable":281,"description":356,"constraints":357},"location","object","Location used for property matching, e.g. `{\"name\": \"Madrid\"}`, or a map area with `geometry`.",[],{"name":359,"type":280,"required":259,"nullable":281,"description":360,"constraints":361},"freeText","Free-text message from the contact. Added to the lead notes.",[],[],[364,379,383,386],{"status":237,"description":365,"schemaName":366,"fields":367,"example":377,"exampleHtml":378},"Successful response.","LeadIngestResponse",[368,373],{"name":369,"type":280,"required":259,"nullable":281,"enumValues":370,"constraints":372},"status",[371],"ok",[],{"name":374,"type":280,"required":281,"nullable":259,"description":375,"constraints":376},"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":380,"description":381,"schemaName":382},"401","The API key is missing, malformed, unknown, revoked or expired, or lacks the required scope.","ExternalApiError",{"status":244,"description":384,"schemaName":385},"A path parameter, query parameter or body field is invalid.","ExternalValidationError",{"status":224,"description":387,"schemaName":382},"Unexpected server error while processing the request.",[389,395,400],{"id":390,"label":391,"lang":392,"code":393,"html":394},"curl","cURL","bash","curl -X POST \"https:\u002F\u002Fapi.vestta.app\u002Fv1\u002Fext\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.app\u002Fv1\u002Fext\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":396,"label":397,"lang":396,"code":398,"html":399},"javascript","JavaScript","const response = await fetch('https:\u002F\u002Fapi.vestta.app\u002Fv1\u002Fext\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.app\u002Fv1\u002Fext\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":401,"label":402,"lang":401,"code":403,"html":404},"python","Python","import os\n\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fapi.vestta.app\u002Fv1\u002Fext\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.app\u002Fv1\u002Fext\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>",1791110048921]