curl --request POST \
--url https://staging.housera.ro/api/v1/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com",
"note": "<string>",
"price": 50000000
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.housera.ro/api/v1/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'phone' => '<string>',
'email' => 'jsmith@example.com',
'note' => '<string>',
'price' => 50000000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone: '<string>',
email: 'jsmith@example.com',
note: '<string>',
price: 50000000
})
};
fetch('https://staging.housera.ro/api/v1/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging.housera.ro/api/v1/leads"
payload = {
"name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com",
"note": "<string>",
"price": 50000000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": 123,
"source": "phone",
"status": "new",
"listing": {
"code": "<string>",
"external_ref": "<string>"
},
"complex": {
"code": "<string>",
"title": "<string>",
"url": "<string>"
},
"contact": {
"name": "<string>",
"phone": "<string>",
"email": "<string>"
},
"message": "<string>",
"erased": true,
"note": "<string>",
"price": 123,
"agent": {
"name": "<string>",
"email": "<string>",
"display_name": "<string>"
},
"requests": {
"callback_at": "<string>",
"viewing_at": "<string>"
},
"office": {
"id": 123,
"name": "<string>"
},
"inbox": {
"reason": "no_listing",
"since": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"meta": {
"possible_duplicate": {
"id": 123,
"matched_on": "<string>"
}
}
}{
"data": {
"id": 123,
"source": "phone",
"status": "new",
"listing": {
"code": "<string>",
"external_ref": "<string>"
},
"complex": {
"code": "<string>",
"title": "<string>",
"url": "<string>"
},
"contact": {
"name": "<string>",
"phone": "<string>",
"email": "<string>"
},
"message": "<string>",
"erased": true,
"note": "<string>",
"price": 123,
"agent": {
"name": "<string>",
"email": "<string>",
"display_name": "<string>"
},
"requests": {
"callback_at": "<string>",
"viewing_at": "<string>"
},
"office": {
"id": 123,
"name": "<string>"
},
"inbox": {
"reason": "no_listing",
"since": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"meta": {
"possible_duplicate": {
"id": 123,
"matched_on": "<string>"
}
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}Add a contact
A contact added by hand, like the “Add” button in your requests on the portal, with the same rules for name, phone and email. The key’s account becomes responsible for it. The firm’s owner, an admin or a manager adds it to the firm’s requests, and board set to personal keeps it in their own requests; for anyone else the contact stays in their own requests. Without status, the contact starts at the new stage. Requires the leads:read and leads:write abilities. With Idempotency-Key, a request repeated within 10 minutes returns the contact added the first time (200), with the same meta.possible_duplicate, and adds no other.
curl --request POST \
--url https://staging.housera.ro/api/v1/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com",
"note": "<string>",
"price": 50000000
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.housera.ro/api/v1/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'phone' => '<string>',
'email' => 'jsmith@example.com',
'note' => '<string>',
'price' => 50000000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone: '<string>',
email: 'jsmith@example.com',
note: '<string>',
price: 50000000
})
};
fetch('https://staging.housera.ro/api/v1/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging.housera.ro/api/v1/leads"
payload = {
"name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com",
"note": "<string>",
"price": 50000000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": 123,
"source": "phone",
"status": "new",
"listing": {
"code": "<string>",
"external_ref": "<string>"
},
"complex": {
"code": "<string>",
"title": "<string>",
"url": "<string>"
},
"contact": {
"name": "<string>",
"phone": "<string>",
"email": "<string>"
},
"message": "<string>",
"erased": true,
"note": "<string>",
"price": 123,
"agent": {
"name": "<string>",
"email": "<string>",
"display_name": "<string>"
},
"requests": {
"callback_at": "<string>",
"viewing_at": "<string>"
},
"office": {
"id": 123,
"name": "<string>"
},
"inbox": {
"reason": "no_listing",
"since": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"meta": {
"possible_duplicate": {
"id": 123,
"matched_on": "<string>"
}
}
}{
"data": {
"id": 123,
"source": "phone",
"status": "new",
"listing": {
"code": "<string>",
"external_ref": "<string>"
},
"complex": {
"code": "<string>",
"title": "<string>",
"url": "<string>"
},
"contact": {
"name": "<string>",
"phone": "<string>",
"email": "<string>"
},
"message": "<string>",
"erased": true,
"note": "<string>",
"price": 123,
"agent": {
"name": "<string>",
"email": "<string>",
"display_name": "<string>"
},
"requests": {
"callback_at": "<string>",
"viewing_at": "<string>"
},
"office": {
"id": 123,
"name": "<string>"
},
"inbox": {
"reason": "no_listing",
"since": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"meta": {
"possible_duplicate": {
"id": 123,
"matched_on": "<string>"
}
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}Headers
A unique value for this creation (for example a UUID). A request repeated with the same value within 10 minutes returns what the first one created, without creating anything else: the listing for POST /listings, the contact for POST /leads, the message for POST /leads/{lead}/messages. For listings and messages, only the first 64 characters count.
Query Parameters
The response language, ro or en. It changes error messages (title, detail), labels and, when the listing has an approved translation in that language, its title and description. Codes are the same in every language. It takes precedence over Accept-Language and over the account's language.
ro, en Body
Where the contact goes: firm (the firm's requests, only for the owner, admins and managers) or personal (your own requests). Without it, the contact goes to the firm's requests for whoever runs them and to their own requests for everyone else.
firm, personal, null