cURL
curl --request POST \
--url https://flatbay.fr/fr/api/contacts/create/{etablissementId} \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@example.com",
"phone": "+33612345678",
"civility": "user.civility.m",
"birthDate": "1990-01-15",
"nationality": "FR",
"situationfamiliale": "user.situationfamiliale.celib",
"groupe": "user.groupe.seul",
"optin": "1",
"rentsellType": "property.rentsellType.rent"
}
]
}
'import requests
url = "https://flatbay.fr/fr/api/contacts/create/{etablissementId}"
payload = { "users": [
{
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@example.com",
"phone": "+33612345678",
"civility": "user.civility.m",
"birthDate": "1990-01-15",
"nationality": "FR",
"situationfamiliale": "user.situationfamiliale.celib",
"groupe": "user.groupe.seul",
"optin": "1",
"rentsellType": "property.rentsellType.rent"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
users: [
{
firstName: 'Jean',
lastName: 'Dupont',
email: 'jean.dupont@example.com',
phone: '+33612345678',
civility: 'user.civility.m',
birthDate: '1990-01-15',
nationality: 'FR',
situationfamiliale: 'user.situationfamiliale.celib',
groupe: 'user.groupe.seul',
optin: '1',
rentsellType: 'property.rentsellType.rent'
}
]
})
};
fetch('https://flatbay.fr/fr/api/contacts/create/{etablissementId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://flatbay.fr/fr/api/contacts/create/{etablissementId}",
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([
'users' => [
[
'firstName' => 'Jean',
'lastName' => 'Dupont',
'email' => 'jean.dupont@example.com',
'phone' => '+33612345678',
'civility' => 'user.civility.m',
'birthDate' => '1990-01-15',
'nationality' => 'FR',
'situationfamiliale' => 'user.situationfamiliale.celib',
'groupe' => 'user.groupe.seul',
'optin' => '1',
'rentsellType' => 'property.rentsellType.rent'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://flatbay.fr/fr/api/contacts/create/{etablissementId}"
payload := strings.NewReader("{\n \"users\": [\n {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@example.com\",\n \"phone\": \"+33612345678\",\n \"civility\": \"user.civility.m\",\n \"birthDate\": \"1990-01-15\",\n \"nationality\": \"FR\",\n \"situationfamiliale\": \"user.situationfamiliale.celib\",\n \"groupe\": \"user.groupe.seul\",\n \"optin\": \"1\",\n \"rentsellType\": \"property.rentsellType.rent\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://flatbay.fr/fr/api/contacts/create/{etablissementId}")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@example.com\",\n \"phone\": \"+33612345678\",\n \"civility\": \"user.civility.m\",\n \"birthDate\": \"1990-01-15\",\n \"nationality\": \"FR\",\n \"situationfamiliale\": \"user.situationfamiliale.celib\",\n \"groupe\": \"user.groupe.seul\",\n \"optin\": \"1\",\n \"rentsellType\": \"property.rentsellType.rent\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://flatbay.fr/fr/api/contacts/create/{etablissementId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"users\": [\n {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@example.com\",\n \"phone\": \"+33612345678\",\n \"civility\": \"user.civility.m\",\n \"birthDate\": \"1990-01-15\",\n \"nationality\": \"FR\",\n \"situationfamiliale\": \"user.situationfamiliale.celib\",\n \"groupe\": \"user.groupe.seul\",\n \"optin\": \"1\",\n \"rentsellType\": \"property.rentsellType.rent\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"errors": [
"<string>"
],
"users": [
{
"id": 123456,
"email": "jean.dupont@example.com"
}
]
}{
"error": "<string>"
}Endpoint Examples
Créer des contacts sans bien
Création de contacts en recherche sans bien. Chaque contact est rattaché au groupe et au répertoire de l’agence, sans candidature sur un bien.
POST
/
contacts
/
create
/
{etablissementId}
cURL
curl --request POST \
--url https://flatbay.fr/fr/api/contacts/create/{etablissementId} \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@example.com",
"phone": "+33612345678",
"civility": "user.civility.m",
"birthDate": "1990-01-15",
"nationality": "FR",
"situationfamiliale": "user.situationfamiliale.celib",
"groupe": "user.groupe.seul",
"optin": "1",
"rentsellType": "property.rentsellType.rent"
}
]
}
'import requests
url = "https://flatbay.fr/fr/api/contacts/create/{etablissementId}"
payload = { "users": [
{
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@example.com",
"phone": "+33612345678",
"civility": "user.civility.m",
"birthDate": "1990-01-15",
"nationality": "FR",
"situationfamiliale": "user.situationfamiliale.celib",
"groupe": "user.groupe.seul",
"optin": "1",
"rentsellType": "property.rentsellType.rent"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
users: [
{
firstName: 'Jean',
lastName: 'Dupont',
email: 'jean.dupont@example.com',
phone: '+33612345678',
civility: 'user.civility.m',
birthDate: '1990-01-15',
nationality: 'FR',
situationfamiliale: 'user.situationfamiliale.celib',
groupe: 'user.groupe.seul',
optin: '1',
rentsellType: 'property.rentsellType.rent'
}
]
})
};
fetch('https://flatbay.fr/fr/api/contacts/create/{etablissementId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://flatbay.fr/fr/api/contacts/create/{etablissementId}",
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([
'users' => [
[
'firstName' => 'Jean',
'lastName' => 'Dupont',
'email' => 'jean.dupont@example.com',
'phone' => '+33612345678',
'civility' => 'user.civility.m',
'birthDate' => '1990-01-15',
'nationality' => 'FR',
'situationfamiliale' => 'user.situationfamiliale.celib',
'groupe' => 'user.groupe.seul',
'optin' => '1',
'rentsellType' => 'property.rentsellType.rent'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://flatbay.fr/fr/api/contacts/create/{etablissementId}"
payload := strings.NewReader("{\n \"users\": [\n {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@example.com\",\n \"phone\": \"+33612345678\",\n \"civility\": \"user.civility.m\",\n \"birthDate\": \"1990-01-15\",\n \"nationality\": \"FR\",\n \"situationfamiliale\": \"user.situationfamiliale.celib\",\n \"groupe\": \"user.groupe.seul\",\n \"optin\": \"1\",\n \"rentsellType\": \"property.rentsellType.rent\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://flatbay.fr/fr/api/contacts/create/{etablissementId}")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@example.com\",\n \"phone\": \"+33612345678\",\n \"civility\": \"user.civility.m\",\n \"birthDate\": \"1990-01-15\",\n \"nationality\": \"FR\",\n \"situationfamiliale\": \"user.situationfamiliale.celib\",\n \"groupe\": \"user.groupe.seul\",\n \"optin\": \"1\",\n \"rentsellType\": \"property.rentsellType.rent\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://flatbay.fr/fr/api/contacts/create/{etablissementId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"users\": [\n {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@example.com\",\n \"phone\": \"+33612345678\",\n \"civility\": \"user.civility.m\",\n \"birthDate\": \"1990-01-15\",\n \"nationality\": \"FR\",\n \"situationfamiliale\": \"user.situationfamiliale.celib\",\n \"groupe\": \"user.groupe.seul\",\n \"optin\": \"1\",\n \"rentsellType\": \"property.rentsellType.rent\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"errors": [
"<string>"
],
"users": [
{
"id": 123456,
"email": "jean.dupont@example.com"
}
]
}{
"error": "<string>"
}Endpoint
POST /api/contacts/create/:etablissementId?apiKey=xxxxx
Description
Cette route crée des contacts en recherche sans bien lié : locataires ou acquéreurs qu’on veut suivre avant de leur proposer un bien. Pour chaque utilisateur du tableauusers :
- le contact est rattaché à votre groupe comme lead, sans candidature sur un bien ;
- il est ajouté au répertoire de l’agence
etablissementId; - aucun e-mail n’est envoyé au contact ;
- son origine est enregistrée comme « créé par API ».
Paramètres
Path Parameter
| Paramètre | Type | Requis | Description |
|---|---|---|---|
etablissementId | integer | Oui | Identifiant de l’agence, qui doit être de votre groupe |
Query Parameters
| Paramètre | Type | Requis | Description |
|---|---|---|---|
apiKey | string | Oui | Votre clé API |
Corps de la requête
| Champ | Type | Requis | Description |
|---|---|---|---|
users | array | Oui | Liste des contacts à créer (50 maximum) |
Champs utilisateur
| Champ | Type | Description |
|---|---|---|
email | string | Email (obligatoire, doit être valide) |
firstName | string | Prénom |
lastName | string | Nom |
phone | string | Téléphone |
civility | string | Civilité (user.civility.m, user.civility.mme, user.civility.other) |
rentsellType | string | Type de recherche : property.rentsellType.rent (location), .sell (achat) ou .both (les deux) |
birthDate | string | Date de naissance (YYYY-MM-DD) |
nationality | string | Nationalité |
situationfamiliale | string | Situation familiale (mêmes valeurs que pour la création de candidatures) |
groupe | string | Groupe (mêmes valeurs que pour la création de candidatures) |
optin | string | ”1” si le contact accepte d’être recontacté |
Exemple de requête
{
"users": [
{
"email": "jean.dupont@example.com",
"civility": "user.civility.m",
"firstName": "Jean",
"lastName": "Dupont",
"phone": "0612345678",
"rentsellType": "property.rentsellType.rent",
"optin": "1"
}
]
}
Réponse
{
"status": "ok",
"errors": [],
"users": [{ "id": 123456, "email": "jean.dupont@example.com" }]
}
errors liste les contacts refusés (email ou rentsellType invalide). users donne l’identifiant Flatbay de chaque contact créé ou retrouvé.Path Parameters
Identifiant de l'agence à laquelle rattacher les contacts Identifiant d'un établissement
Available options:
1, 3, 4, 5, 6, 7, 8, 9, 10 Example:
1
Query Parameters
Mot de passe pour l'accès sécurisé
Example:
"api_key_here"
Body
application/json
Liste des contacts à créer
Liste des contacts à créer (50 maximum)
Required array length:
1 - 50 elementsShow child attributes
Show child attributes

