[{"data":1,"prerenderedAt":968},["ShallowReactive",2],{"page:\u002Fleads\u002Finquiries":3,"operation:createLeadInquiry":452},{"id":4,"title":5,"body":6,"description":442,"extension":443,"meta":444,"navigation":445,"operation":446,"path":447,"rawbody":448,"seo":449,"stem":450,"__hash__":451},"docs\u002Fleads\u002Finquiries.md","Create an inquiry",{"type":7,"value":8,"toc":435},"minimark",[9,13,18,25,101,104,108,114,250,327,337,341,350,354,396,400,403,431],[10,11,12],"p",{},"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.",[14,15,17],"h2",{"id":16},"lead-type","Lead type",[10,19,20,24],{},[21,22,23],"code",{},"type"," accepts Vestta's lead types and a few English and Spanish aliases:",[26,27,28,41],"table",{},[29,30,31],"thead",{},[32,33,34,38],"tr",{},[35,36,37],"th",{},"You send",[35,39,40],{},"Stored as",[42,43,44,70,85],"tbody",{},[32,45,46,65],{},[47,48,49,52,53,52,56,52,59,52,62],"td",{},[21,50,51],{},"buyer",", ",[21,54,55],{},"tenant",[21,57,58],{},"comprador",[21,60,61],{},"inquilino",[21,63,64],{},"demandante",[47,66,67,69],{},[21,68,64],{}," — looking to buy or rent",[32,71,72,80],{},[47,73,74,52,77],{},[21,75,76],{},"owner",[21,78,79],{},"propietario",[47,81,82,84],{},[21,83,79],{}," — owns a property",[32,86,87,98],{},[47,88,89,52,92,52,95],{},[21,90,91],{},"agencia-inmobiliaria",[21,93,94],{},"entidad-bancaria",[21,96,97],{},"proveedor-servicios",[47,99,100],{},"Unchanged",[10,102,103],{},"Matching is case-insensitive. Any other value fails.",[14,105,107],{"id":106},"search-preferences","Search preferences",[10,109,110,113],{},[21,111,112],{},"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:",[115,116,121],"pre",{"className":117,"code":118,"language":119,"meta":120,"style":120},"language-json shiki shiki-themes github-light","{\n  \"operations\": [\"alquiler\"],\n  \"property_types\": [\"apartamento\", \"casa\"],\n  \"apartamento\": { \"bedrooms_min\": 2, \"price_rent_max\": 1200 },\n  \"casa\": { \"bedrooms_min\": 3, \"price_rent_max\": 1500 },\n  \"locations\": [{ \"name\": \"Madrid\" }]\n}\n","json","",[21,122,123,132,149,167,198,224,244],{"__ignoreMap":120},[124,125,128],"span",{"class":126,"line":127},"line",1,[124,129,131],{"class":130},"sgsFI","{\n",[124,133,135,139,142,146],{"class":126,"line":134},2,[124,136,138],{"class":137},"sYu0t","  \"operations\"",[124,140,141],{"class":130},": [",[124,143,145],{"class":144},"sYBdl","\"alquiler\"",[124,147,148],{"class":130},"],\n",[124,150,152,155,157,160,162,165],{"class":126,"line":151},3,[124,153,154],{"class":137},"  \"property_types\"",[124,156,141],{"class":130},[124,158,159],{"class":144},"\"apartamento\"",[124,161,52],{"class":130},[124,163,164],{"class":144},"\"casa\"",[124,166,148],{"class":130},[124,168,170,173,176,179,182,185,187,190,192,195],{"class":126,"line":169},4,[124,171,172],{"class":137},"  \"apartamento\"",[124,174,175],{"class":130},": { ",[124,177,178],{"class":137},"\"bedrooms_min\"",[124,180,181],{"class":130},": ",[124,183,184],{"class":137},"2",[124,186,52],{"class":130},[124,188,189],{"class":137},"\"price_rent_max\"",[124,191,181],{"class":130},[124,193,194],{"class":137},"1200",[124,196,197],{"class":130}," },\n",[124,199,201,204,206,208,210,213,215,217,219,222],{"class":126,"line":200},5,[124,202,203],{"class":137},"  \"casa\"",[124,205,175],{"class":130},[124,207,178],{"class":137},[124,209,181],{"class":130},[124,211,212],{"class":137},"3",[124,214,52],{"class":130},[124,216,189],{"class":137},[124,218,181],{"class":130},[124,220,221],{"class":137},"1500",[124,223,197],{"class":130},[124,225,227,230,233,236,238,241],{"class":126,"line":226},6,[124,228,229],{"class":137},"  \"locations\"",[124,231,232],{"class":130},": [{ ",[124,234,235],{"class":137},"\"name\"",[124,237,181],{"class":130},[124,239,240],{"class":144},"\"Madrid\"",[124,242,243],{"class":130}," }]\n",[124,245,247],{"class":126,"line":246},7,[124,248,249],{"class":130},"}\n",[251,252,253,270,310],"ul",{},[254,255,256,181,259,52,262,265,266,269],"li",{},[21,257,258],{},"operations",[21,260,261],{},"venta",[21,263,264],{},"alquiler"," and\u002For ",[21,267,268],{},"traspaso",".",[254,271,272,181,275,52,278,52,281,52,284,52,287,52,290,52,293,52,296,52,299,302,303,306,307,269],{},[21,273,274],{},"property_types",[21,276,277],{},"apartamento",[21,279,280],{},"casa",[21,282,283],{},"local",[21,285,286],{},"nave",[21,288,289],{},"almacenaje",[21,291,292],{},"oficina",[21,294,295],{},"terreno",[21,297,298],{},"aparcamiento",[21,300,301],{},"edificio",". Criteria for each type go in the object of the same name, such as ",[21,304,305],{},"apartamento.price_rent_max"," or ",[21,308,309],{},"casa.price_max",[254,311,312,315,316,319,320,269],{},[21,313,314],{},"locations",": places by ",[21,317,318],{},"name",", or map areas in the same shapes as the ",[321,322,324,326],"a",{"href":323},"\u002Fproperties\u002Flist#map-areas",[21,325,314],{}," filter",[10,328,329,330,333,334,269],{},"When at least one search has content, the lead is created with status ",[21,331,332],{},"searching_property","; otherwise with status ",[21,335,336],{},"new",[14,338,340],{"id":339},"notes","Notes",[10,342,343,344,347,348,269],{},"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 ",[21,345,346],{},"search_preferences[0].internal_notes"," if set, otherwise from ",[21,349,339],{},[14,351,353],{"id":352},"defaults-set-by-vestta","Defaults set by Vestta",[10,355,356,357,361,362,365,366,369,370,373,374,52,377,380,381,384,385,380,388,391,392,395],{},"Inquiries are always stored as ",[358,359,360],"strong",{},"active",", with ",[358,363,364],{},"rating 3"," and captured by ",[21,367,368],{},"Web",". ",[21,371,372],{},"profile_category"," defaults to ",[21,375,376],{},"potencial",[21,378,379],{},"urgency_profile"," to ",[21,382,383],{},"poca-urgencia"," and ",[21,386,387],{},"source",[21,389,390],{},"manual"," — send ",[21,393,394],{},"\"source\": \"web\""," or your site's name so agents know where the lead came from.",[14,397,399],{"id":398},"duplicates","Duplicates",[10,401,402],{},"The primary phone is unique within a workspace:",[251,404,405,420],{},[254,406,407,408,411,412,415,416,419],{},"If a lead with the same phone exists ",[358,409,410],{},"without a name"," (for example, someone who first wrote on WhatsApp), it is ",[358,413,414],{},"completed"," with this inquiry and its ",[21,417,418],{},"lead_id"," is returned.",[254,421,422,423,426,427,430],{},"If a lead with the same primary phone exists ",[358,424,425],{},"with a name",", the request fails with ",[21,428,429],{},"409",". Treat it as \"already in Vestta\": do not retry.",[432,433,434],"style",{},"html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":120,"searchDepth":151,"depth":151,"links":436},[437,438,439,440,441],{"id":16,"depth":134,"text":17},{"id":106,"depth":134,"text":107},{"id":339,"depth":134,"text":340},{"id":352,"depth":134,"text":353},{"id":398,"depth":134,"text":399},"Create a lead with contact details and structured search preferences, and get its ID back.","md",{},true,"createLeadInquiry","\u002Fleads\u002Finquiries","---\ntitle: Create an inquiry\ndescription: Create a lead with contact details and structured search preferences, and get its ID back.\noperation: createLeadInquiry\n---\n\nCreates 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.\n\n## Lead type\n\n`type` accepts Vestta's lead types and a few English and Spanish aliases:\n\n| You send | Stored as |\n| --- | --- |\n| `buyer`, `tenant`, `comprador`, `inquilino`, `demandante` | `demandante` — looking to buy or rent |\n| `owner`, `propietario` | `propietario` — owns a property |\n| `agencia-inmobiliaria`, `entidad-bancaria`, `proveedor-servicios` | Unchanged |\n\nMatching is case-insensitive. Any other value fails.\n\n## Search preferences\n\n`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:\n\n```json\n{\n  \"operations\": [\"alquiler\"],\n  \"property_types\": [\"apartamento\", \"casa\"],\n  \"apartamento\": { \"bedrooms_min\": 2, \"price_rent_max\": 1200 },\n  \"casa\": { \"bedrooms_min\": 3, \"price_rent_max\": 1500 },\n  \"locations\": [{ \"name\": \"Madrid\" }]\n}\n```\n\n- `operations`: `venta`, `alquiler` and\u002For `traspaso`.\n- `property_types`: `apartamento`, `casa`, `local`, `nave`, `almacenaje`, `oficina`, `terreno`, `aparcamiento`, `edificio`. Criteria for each type go in the object of the same name, such as `apartamento.price_rent_max` or `casa.price_max`.\n- `locations`: places by `name`, or map areas in the same shapes as the [`locations` filter](\u002Fproperties\u002Flist#map-areas).\n\nWhen at least one search has content, the lead is created with status `searching_property`; otherwise with status `new`.\n\n## Notes\n\nVestta 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`.\n\n## Defaults set by Vestta\n\nInquiries 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.\n\n## Duplicates\n\nThe primary phone is unique within a workspace:\n\n- 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_id` is returned.\n- 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.\n",{"title":5,"description":442},"leads\u002Finquiries","U0-NUMpGx5-osdINF_K5CLFSr2mn-vkCiLbB_-dhLZs",{"id":446,"method":453,"path":447,"fullPath":454,"summary":5,"tag":455,"scopes":456,"url":458,"description":459,"pathParams":460,"queryParams":461,"headerParams":462,"body":463,"responses":913,"samples":951,"docsPath":447},"POST","\u002Fv1\u002Fleads\u002Finquiries","Leads",[457],"leads:ingest","https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Finquiries","Accepts structured contact-form inquiries and retains configured outreach. Requires the `leads:ingest` scope.",[],[],[],{"schemaName":464,"required":445,"fields":465,"ignored":888},"LeadInquiryRequest",[466,471,475,478,481,484,488,492,496,500,504,508,511,515,518,863,868],{"name":318,"type":467,"required":445,"nullable":468,"description":469,"constraints":470},"string",false,"Contact's full name.",[],{"name":472,"type":467,"required":468,"nullable":445,"description":473,"constraints":474},"dni","National ID document number.",[],{"name":23,"type":467,"required":445,"nullable":468,"description":476,"constraints":477},"Lead type. `buyer`, `comprador`, `demandante`, `tenant` and `inquilino` are stored as `demandante`; `owner` and `propietario` as `propietario`. Other values must be a Vestta lead type (`agencia-inmobiliaria`, `entidad-bancaria`, `proveedor-servicios`).",[],{"name":372,"type":467,"required":468,"nullable":445,"description":479,"constraints":480},"`standard` or `potencial`. Defaults to `potencial`.",[],{"name":379,"type":467,"required":468,"nullable":445,"description":482,"constraints":483},"`alta-urgencia` or `poca-urgencia`. Defaults to `poca-urgencia`.",[],{"name":485,"type":467,"required":468,"nullable":445,"description":486,"constraints":487},"preferred_language","`es`, `gb`, `fr`, `ge` or `it`.",[],{"name":489,"type":467,"required":445,"nullable":468,"description":490,"constraints":491},"phone_number_1","Primary phone. Normalised to E.164: include the international prefix (`+34600111222`); numbers without one are read as Spanish.",[],{"name":493,"type":467,"required":468,"nullable":445,"description":494,"constraints":495},"phone_number_2","Secondary phone, normalised to E.164.",[],{"name":497,"type":467,"required":468,"nullable":445,"description":498,"constraints":499},"landline_phone","Landline, normalised to E.164.",[],{"name":501,"type":467,"required":468,"nullable":445,"description":502,"constraints":503},"personal_email","Personal email address.",[],{"name":505,"type":467,"required":468,"nullable":445,"description":506,"constraints":507},"professional_email","Work email address.",[],{"name":387,"type":467,"required":468,"nullable":445,"description":509,"defaultValue":390,"constraints":510},"Where the inquiry comes from, e.g. `web` or your site's name. Stored as the lead source; defaults to `manual`.",[],{"name":512,"type":467,"required":468,"nullable":445,"description":513,"constraints":514},"sourcePage","URL of the page where the inquiry was submitted. Added to the lead notes.",[],{"name":339,"type":467,"required":468,"nullable":445,"description":516,"constraints":517},"Free-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_notes` is set.",[],{"name":112,"type":519,"required":468,"nullable":468,"description":520,"constraints":521,"children":522},"array of objects","What the contact is looking for. All entries are stored and used for property matching; the first one is summarised in the notes.",[],[523,526,529,531,588,632,667,697,720,756,786,807,846,848,851,854,857,860],{"name":524,"type":467,"required":468,"nullable":445,"constraints":525},"request_id",[],{"name":258,"type":527,"required":468,"nullable":468,"constraints":528},"array of strings",[],{"name":274,"type":527,"required":468,"nullable":468,"constraints":530},[],{"name":277,"type":532,"required":468,"nullable":468,"constraints":533,"children":534},"ApartmentPreferences",[],[535,538,542,545,548,551,555,558,561,564,567,570,573,576,579,582,585],{"name":536,"type":527,"required":468,"nullable":468,"constraints":537},"requireds",[],{"name":539,"type":540,"required":468,"nullable":445,"constraints":541},"specs","object",[],{"name":543,"type":527,"required":468,"nullable":445,"constraints":544},"views",[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":547},"features",[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":550},"subtypes",[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":554},"size_max","integer",[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":557},"size_min",[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":560},"price_max",[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":563},"price_min",[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":566},"price_rent_max",[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":569},"price_rent_min",[],{"name":571,"type":553,"required":468,"nullable":445,"constraints":572},"bedrooms_min",[],{"name":574,"type":553,"required":468,"nullable":445,"constraints":575},"bathrooms_min",[],{"name":577,"type":553,"required":468,"nullable":445,"constraints":578},"num_terraces_min",[],{"name":580,"type":553,"required":468,"nullable":445,"constraints":581},"size_terraces_min",[],{"name":583,"type":553,"required":468,"nullable":445,"constraints":584},"doble_bedrooms_min",[],{"name":586,"type":553,"required":468,"nullable":445,"constraints":587},"suite_bathrooms_min",[],{"name":280,"type":589,"required":468,"nullable":468,"constraints":590,"children":591},"HousePreferences",[],[592,594,596,598,600,602,604,606,608,610,612,614,616,618,620,622,624,626,629],{"name":536,"type":527,"required":468,"nullable":468,"constraints":593},[],{"name":539,"type":540,"required":468,"nullable":445,"constraints":595},[],{"name":543,"type":527,"required":468,"nullable":445,"constraints":597},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":599},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":601},[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":603},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":605},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":607},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":609},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":611},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":613},[],{"name":571,"type":553,"required":468,"nullable":445,"constraints":615},[],{"name":574,"type":553,"required":468,"nullable":445,"constraints":617},[],{"name":577,"type":553,"required":468,"nullable":445,"constraints":619},[],{"name":580,"type":553,"required":468,"nullable":445,"constraints":621},[],{"name":583,"type":553,"required":468,"nullable":445,"constraints":623},[],{"name":586,"type":553,"required":468,"nullable":445,"constraints":625},[],{"name":627,"type":553,"required":468,"nullable":445,"constraints":628},"plot_size_min",[],{"name":630,"type":553,"required":468,"nullable":445,"constraints":631},"porch_size_min",[],{"name":283,"type":633,"required":468,"nullable":468,"constraints":634,"children":635},"LocalPreferences",[],[636,638,640,642,644,646,648,650,652,654,656,659,662,665],{"name":536,"type":527,"required":468,"nullable":468,"constraints":637},[],{"name":539,"type":540,"required":468,"nullable":445,"constraints":639},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":641},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":643},[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":645},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":647},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":649},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":651},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":653},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":655},[],{"name":657,"type":553,"required":468,"nullable":445,"constraints":658},"height_min",[],{"name":660,"type":553,"required":468,"nullable":445,"constraints":661},"facade_meters_min",[],{"name":663,"type":553,"required":468,"nullable":445,"constraints":664},"showcase_meters_min",[],{"name":574,"type":553,"required":468,"nullable":445,"constraints":666},[],{"name":286,"type":668,"required":468,"nullable":468,"constraints":669,"children":670},"NavePreferences",[],[671,673,675,677,679,681,683,685,687,689,691,693,695],{"name":536,"type":527,"required":468,"nullable":468,"constraints":672},[],{"name":539,"type":540,"required":468,"nullable":445,"constraints":674},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":676},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":678},[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":680},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":682},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":684},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":686},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":688},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":690},[],{"name":657,"type":553,"required":468,"nullable":445,"constraints":692},[],{"name":660,"type":553,"required":468,"nullable":445,"constraints":694},[],{"name":663,"type":553,"required":468,"nullable":445,"constraints":696},[],{"name":289,"type":698,"required":468,"nullable":468,"description":699,"constraints":700,"children":701},"StoragePreferences","Preferencias para almacenes y trasteros independientes.",[],[702,704,706,708,710,712,714,716,718],{"name":536,"type":527,"required":468,"nullable":468,"constraints":703},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":705},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":707},[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":709},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":711},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":713},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":715},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":717},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":719},[],{"name":292,"type":721,"required":468,"nullable":468,"constraints":722,"children":723},"OficinaPreferences",[],[724,726,728,730,732,734,736,738,740,742,744,747,749,752,754],{"name":536,"type":527,"required":468,"nullable":468,"constraints":725},[],{"name":539,"type":540,"required":468,"nullable":445,"constraints":727},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":729},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":731},[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":733},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":735},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":737},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":739},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":741},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":743},[],{"name":745,"type":553,"required":468,"nullable":445,"constraints":746},"offices_min",[],{"name":574,"type":553,"required":468,"nullable":445,"constraints":748},[],{"name":750,"type":553,"required":468,"nullable":445,"constraints":751},"meeting_rooms_min",[],{"name":577,"type":553,"required":468,"nullable":445,"constraints":753},[],{"name":580,"type":553,"required":468,"nullable":445,"constraints":755},[],{"name":295,"type":757,"required":468,"nullable":468,"constraints":758,"children":759},"TerrenoPreferences",[],[760,762,764,766,768,771,773,775,777,779,781,783],{"name":536,"type":527,"required":468,"nullable":468,"constraints":761},[],{"name":543,"type":527,"required":468,"nullable":445,"constraints":763},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":765},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":767},[],{"name":769,"type":527,"required":468,"nullable":445,"constraints":770},"topography",[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":772},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":774},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":776},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":778},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":780},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":782},[],{"name":784,"type":553,"required":468,"nullable":445,"constraints":785},"size_built_min",[],{"name":298,"type":787,"required":468,"nullable":468,"constraints":788,"children":789},"AparcamientoPreferences",[],[790,792,794,796,799,801,803,805],{"name":536,"type":527,"required":468,"nullable":468,"constraints":791},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":793},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":795},[],{"name":797,"type":553,"required":468,"nullable":445,"constraints":798},"min_seats",[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":800},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":802},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":804},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":806},[],{"name":301,"type":808,"required":468,"nullable":468,"constraints":809,"children":810},"BuildingPreferences",[],[811,813,815,817,819,821,823,825,827,829,831,834,837,840,843],{"name":536,"type":527,"required":468,"nullable":468,"constraints":812},[],{"name":539,"type":540,"required":468,"nullable":445,"constraints":814},[],{"name":546,"type":527,"required":468,"nullable":445,"constraints":816},[],{"name":552,"type":553,"required":468,"nullable":445,"constraints":818},[],{"name":556,"type":553,"required":468,"nullable":445,"constraints":820},[],{"name":549,"type":527,"required":468,"nullable":445,"constraints":822},[],{"name":559,"type":553,"required":468,"nullable":445,"constraints":824},[],{"name":562,"type":553,"required":468,"nullable":445,"constraints":826},[],{"name":565,"type":553,"required":468,"nullable":445,"constraints":828},[],{"name":568,"type":553,"required":468,"nullable":445,"constraints":830},[],{"name":832,"type":553,"required":468,"nullable":445,"constraints":833},"num_floors_min",[],{"name":835,"type":553,"required":468,"nullable":445,"constraints":836},"num_locales_min",[],{"name":838,"type":553,"required":468,"nullable":445,"constraints":839},"usable_area_min",[],{"name":841,"type":553,"required":468,"nullable":445,"constraints":842},"num_parkings_min",[],{"name":844,"type":553,"required":468,"nullable":445,"constraints":845},"num_viviendas_min",[],{"name":314,"type":519,"required":468,"nullable":468,"constraints":847},[],{"name":849,"type":467,"required":468,"nullable":445,"constraints":850},"internal_notes",[],{"name":852,"type":467,"required":468,"nullable":445,"constraints":853},"title",[],{"name":855,"type":467,"required":468,"nullable":445,"constraints":856},"color",[],{"name":858,"type":467,"required":468,"nullable":445,"constraints":859},"urgency",[],{"name":861,"type":467,"required":468,"nullable":445,"constraints":862},"status",[],{"name":864,"type":865,"required":468,"nullable":468,"description":866,"constraints":867},"agency_property_ids","array of integers","Property IDs linked to the contact. Stored only when `type` is `agencia-inmobiliaria`.",[],{"name":869,"type":519,"required":468,"nullable":468,"description":870,"constraints":871,"children":872},"services","Services offered by the contact. Stored only when `type` is `entidad-bancaria` or `proveedor-servicios`.",[],[873,876,880,885],{"name":318,"type":467,"required":445,"nullable":468,"constraints":874},[875],"1–255 chars",{"name":877,"type":467,"required":468,"nullable":445,"constraints":878},"category",[879],"≤ 80 chars",{"name":881,"type":882,"required":468,"nullable":445,"constraints":883},"approximate_cost","number",[884],"≥ 0",{"name":339,"type":467,"required":468,"nullable":445,"constraints":886},[887],"≤ 2000 chars",[889,894,898,902,907,910],{"name":890,"type":553,"required":468,"nullable":445,"description":891,"defaultValue":892,"constraints":893,"ignored":445},"rating","Ignored: inquiries are stored with rating 3.","0",[],{"name":360,"type":895,"required":468,"nullable":445,"description":896,"constraints":897,"ignored":445},"boolean","Ignored: inquiries are always stored as active.",[],{"name":899,"type":467,"required":468,"nullable":445,"description":900,"constraints":901,"ignored":445},"captured_by","Ignored: inquiries are stored as captured by `Web`.",[],{"name":903,"type":553,"required":468,"nullable":445,"description":904,"constraints":905,"ignored":445},"agency_id","Ignored by this endpoint.",[906],"≥ 1",{"name":908,"type":865,"required":468,"nullable":468,"description":904,"constraints":909,"ignored":445},"agency_client_ids",[],{"name":911,"type":553,"required":468,"nullable":445,"description":904,"defaultValue":892,"constraints":912,"ignored":445},"time_to_create",[],[914,932,936,939,942,944,948],{"status":915,"description":916,"schemaName":917,"fields":918,"example":930,"exampleHtml":931},"200","Successful response.","LeadInquiryResponse",[919,923,927],{"name":861,"type":467,"required":445,"nullable":468,"enumValues":920,"constraints":922},[921],"ok",[],{"name":924,"type":467,"required":468,"nullable":445,"description":925,"constraints":926},"authenticated_as","Name of the business that owns the API key.",[],{"name":418,"type":553,"required":468,"nullable":445,"description":928,"constraints":929},"ID of the created lead, or of the existing unnamed lead that was completed.",[],"{\n  \"status\": \"ok\",\n  \"authenticated_as\": \"Inmobiliaria Ejemplo\",\n  \"lead_id\": 228\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>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#005CC5\">  \"lead_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">228\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"status":933,"description":934,"schemaName":935},"401","The API key is missing, malformed, unknown, revoked or expired.","ExternalApiError",{"status":937,"description":938,"schemaName":935},"403","The API key lacks the required scope.",{"status":940,"description":941,"schemaName":935},"404","The resource does not exist in this business.",{"status":429,"description":943,"schemaName":935},"Duplicate contact or idempotency key reused with a different payload.",{"status":945,"description":946,"schemaName":947},"422","A path parameter, query parameter or body field is invalid.","ExternalValidationError",{"status":949,"description":950,"schemaName":935},"500","Unexpected server error while processing the request.",[952,958,963],{"id":953,"label":954,"lang":955,"code":956,"html":957},"curl","cURL","bash","curl -X POST \"https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Finquiries\" \\\n  -H \"X-Api-Key: $VESTTA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"name\": \"Ana García\",\n  \"type\": \"demandante\",\n  \"preferred_language\": \"es\",\n  \"phone_number_1\": \"+34600111222\",\n  \"personal_email\": \"ana@example.com\",\n  \"source\": \"web\",\n  \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Fcontacto\",\n  \"notes\": \"Busco piso de dos habitaciones cerca del centro.\",\n  \"search_preferences\": [\n    {\n      \"operations\": [\n        \"alquiler\"\n      ],\n      \"property_types\": [\n        \"apartamento\"\n      ],\n      \"apartamento\": {\n        \"price_rent_max\": 1200,\n        \"bedrooms_min\": 2\n      },\n      \"locations\": [\n        {\n          \"name\": \"Madrid\"\n        }\n      ]\n    }\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\u002Finquiries\"\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\">  \"name\": \"Ana García\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"type\": \"demandante\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"preferred_language\": \"es\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"phone_number_1\": \"+34600111222\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"personal_email\": \"ana@example.com\",\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\u002Fcontacto\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"notes\": \"Busco piso de dos habitaciones cerca del centro.\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">  \"search_preferences\": [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"operations\": [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"alquiler\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      ],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"property_types\": [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"apartamento\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      ],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"apartamento\": {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"price_rent_max\": 1200,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"bedrooms_min\": 2\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">      \"locations\": [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        {\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\">      ]\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>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">}'\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":959,"label":960,"lang":959,"code":961,"html":962},"javascript","JavaScript","const response = await fetch('https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Finquiries', {\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    \"name\": \"Ana García\",\n    \"type\": \"demandante\",\n    \"preferred_language\": \"es\",\n    \"phone_number_1\": \"+34600111222\",\n    \"personal_email\": \"ana@example.com\",\n    \"source\": \"web\",\n    \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Fcontacto\",\n    \"notes\": \"Busco piso de dos habitaciones cerca del centro.\",\n    \"search_preferences\": [\n      {\n        \"operations\": [\n          \"alquiler\"\n        ],\n        \"property_types\": [\n          \"apartamento\"\n        ],\n        \"apartamento\": {\n          \"price_rent_max\": 1200,\n          \"bedrooms_min\": 2\n        },\n        \"locations\": [\n          {\n            \"name\": \"Madrid\"\n          }\n        ]\n      }\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\u002Finquiries'\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\">    \"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\">    \"type\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"demandante\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"preferred_language\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"es\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"phone_number_1\"\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:#032F62\">    \"personal_email\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"ana@example.com\"\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\u002Fcontacto\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"notes\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Busco piso de dos habitaciones cerca del centro.\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">    \"search_preferences\"\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\">        \"operations\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">          \"alquiler\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">        ],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"property_types\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">          \"apartamento\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">        ],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"apartamento\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">          \"price_rent_max\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">1200\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">          \"bedrooms_min\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">2\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#24292E\">        },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"locations\"\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\">            \"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:#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\">})\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":964,"label":965,"lang":964,"code":966,"html":967},"python","Python","import os\n\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fapi.vestta.io\u002Fv1\u002Fleads\u002Finquiries\",\n    headers={\"X-Api-Key\": os.environ[\"VESTTA_API_KEY\"]},\n    json={\n        \"name\": \"Ana García\",\n        \"type\": \"demandante\",\n        \"preferred_language\": \"es\",\n        \"phone_number_1\": \"+34600111222\",\n        \"personal_email\": \"ana@example.com\",\n        \"source\": \"web\",\n        \"sourcePage\": \"https:\u002F\u002Fexample.com\u002Fcontacto\",\n        \"notes\": \"Busco piso de dos habitaciones cerca del centro.\",\n        \"search_preferences\": [\n            {\n                \"operations\": [\n                    \"alquiler\",\n                ],\n                \"property_types\": [\n                    \"apartamento\",\n                ],\n                \"apartamento\": {\n                    \"price_rent_max\": 1200,\n                    \"bedrooms_min\": 2,\n                },\n                \"locations\": [\n                    {\n                        \"name\": \"Madrid\",\n                    },\n                ],\n            },\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\u002Finquiries\"\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\">        \"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\">        \"type\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"demandante\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"preferred_language\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"es\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"phone_number_1\"\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:#032F62\">        \"personal_email\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"ana@example.com\"\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\u002Fcontacto\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"notes\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#032F62\">\"Busco piso de dos habitaciones cerca del centro.\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">        \"search_preferences\"\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\">                \"operations\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">                    \"alquiler\"\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\">                \"property_types\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">                    \"apartamento\"\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\">                \"apartamento\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">                    \"price_rent_max\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">1200\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#032F62\">                    \"bedrooms_min\"\u003C\u002Fspan>\u003Cspan style=\"color:#24292E\">: \u003C\u002Fspan>\u003Cspan style=\"color:#005CC5\">2\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\">                \"locations\"\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\">                        \"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:#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\">)\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>",1791929309906]