Dokumentation ›
Kontakte › Kontakt erstellen
POST
Kontakt erstellen
POSThttps://app.sendapp.ai/api/contacts
Erstellt (oder aktualisiert per Upsert) einen einzelnen Kontakt. Er muss mindestens eine Telefonnummer ODER eine E-Mail haben. Bestehende Kontakte mit derselben Telefonnummer/E-Mail werden zusammengeführt (Tags kombiniert, Metadaten zusammengeführt).
Antworten:
201 Created mit dem erstellten Kontakt — 403, wenn das Kontaktlimit des Plans erreicht ist — 422, wenn sowohl Telefon als auch E-Mail fehlen.Parameter
apikey
erforderlich
La tua API Key (anche header
X-API-Key).
name
optional
Vollständiger Name, bis zu 255 Zeichen.
phone
erforderlich
Internationales Format (z. B. +393391234567). Erforderlich, wenn die E-Mail fehlt.
email
erforderlich
Gültige E-Mail. Erforderlich, wenn die Telefonnummer fehlt.
tags
optional
Array von Strings oder kommagetrennter String (z. B. "vip,newsletter").
metadata
optional
JSON-Objekt mit benutzerdefinierten Feldern.
Anfrage
curl -X POST 'https://app.sendapp.ai/api/contacts' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Mario Rossi",
"phone": "+393391234567",
"email": "mario@example.com",
"tags": ["newsletter", "vip"],
"metadata": { "source": "landing_page_a" }
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Mario Rossi',
'phone' => '+393391234567',
'email' => 'mario@example.com',
'tags' => ['newsletter', 'vip'],
'metadata' => ['source' => 'landing_page_a'],
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/contacts', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Mario Rossi',
phone: '+393391234567',
email: 'mario@example.com',
tags: ['newsletter', 'vip'],
metadata: { source: 'landing_page_a' }
})
});
console.log(await res.json());Antwort (200 OK)
{
"status": "success",
"contact": {
"id": 4022,
"name": "Giulia Bianchi",
"phone": "393334455667",
"email": "giulia.bianchi@example.com",
"tags": [
"lead"
],
"metadata": [],
"created_at": "2026-07-13 10:00:00",
"updated_at": "2026-07-13 10:00:00"
}
}Fehler
{
"status": "error",
"message": "Contact limit reached. Please upgrade your plan."
}