FEAVI REST API v1
Vollständige REST-Schnittstelle für FEAVI CRM. Damit kannst du Kontakte, Deals, Termine, Projekte und Aktivitäten aus externen Tools (Zapier, Make, eigene Apps, Scripts) lesen, erstellen, bearbeiten und löschen.
https://feavi.com/api/v1
application/json
X-API-Key Header
Setup & Erste Schritte
Schritt 1 — Migration ausführen
Ruf die Migration einmalig im Browser auf. Damit wird die Tabelle für API-Keys angelegt.
https://feavi.com/migrate_api_keys.php
Schritt 2 — Ersten API-Key erstellen
Füge direkt in der Datenbank einen initialen Key ein (nur beim allerersten Mal). Danach kannst du über die API weitere Keys erzeugen.
-- In phpMyAdmin oder deinem DB-Tool ausführen: INSERT INTO Sandeck_crm_api_keys (team_id, user_id, name, key_prefix, key_hash) VALUES ( 1, -- deine team_id 1, -- deine user_id 'Mein erster Key', 'feavi_boot', SHA2('feavi_MEIN_GEHEIMER_KEY_HIER', 256) );
feavi_MEIN_GEHEIMER_KEY_HIER durch einen eigenen langen Schlüssel. Merke dir den Klartextwert — er wird nur einmal benötigt.Schritt 3 — Verbindung testen
curl -H "X-API-Key: feavi_MEIN_GEHEIMER_KEY_HIER" \ https://feavi.com/api/v1 # Antwort: { "api": "FEAVI REST API", "version": "v1", "team_id": 1, "resources": [ ... ] }
Schritt 4 — Produktions-Key generieren
curl -X POST https://feavi.com/api/v1/keys \
-H "X-API-Key: feavi_MEIN_GEHEIMER_KEY_HIER" \
-H "Content-Type: application/json" \
-d '{"name": "Zapier Integration"}'
# Antwort — Key nur einmal sichtbar:
{
"success": true,
"id": 2,
"api_key": "feavi_a1b2c3d4e5f6...",
"warning": "Speichere diesen Key – er wird nicht erneut angezeigt!"
}
Authentifizierung
Jede Anfrage muss einen gültigen API-Key mitschicken. Es gibt drei gleichwertige Möglichkeiten:
Option A — X-API-Key Header (empfohlen)
curl https://feavi.com/api/v1/contacts \
-H "X-API-Key: feavi_dein_key_hier"
Option B — Authorization Bearer
curl https://feavi.com/api/v1/contacts \
-H "Authorization: Bearer feavi_dein_key_hier"
Option C — Query-Parameter (nur zum Testen)
https://feavi.com/api/v1/contacts?api_key=feavi_dein_key_hier
Key-Format
Alle Keys beginnen mit feavi_ gefolgt von 40 zufälligen Hex-Zeichen. Jeder Key ist einem Team zugeordnet — du siehst nur Daten deines Teams.
| Status | Bedeutung |
|---|---|
| 401 | Kein Key mitgeschickt, oder Key ungültig / deaktiviert / abgelaufen |
| 403 | Zugriff verweigert (z.B. fremdes Team) |
Antwort-Format
Alle Antworten sind JSON mit UTF-8-Kodierung. Das Basis-Feld success zeigt ob die Anfrage erfolgreich war.
Einzelnes Objekt
{
"success": true,
"data": {
"id": 42,
"first_name": "Max",
"last_name": "Mustermann",
...
}
}
Liste (paginiert)
{
"success": true,
"data": [ /* Array von Objekten */ ],
"meta": {
"total": 247, // Gesamtanzahl (ohne Limit)
"limit": 50, // Aktuelle Seitengroesse
"offset": 0 // Aktueller Startpunkt
}
}
Erstellt (201)
{
"success": true,
"id": 123 // ID des neuen Eintrags
}
Fehler
{
"success": false,
"error": "Kontakt nicht gefunden"
}
Filter & Pagination
Alle Listen-Endpunkte (GET /{resource}) akzeptieren diese Standard-Parameter:
| Parameter | Typ | Standard | Beschreibung |
|---|---|---|---|
| limit | integer | 50 | Einträge pro Seite (max. 200) |
| offset | integer | 0 | Überspringe die ersten N Einträge |
| order_by | string | created_at | Sortierfeld (ressourcenabhängig) |
| order_dir | ASC / DESC | DESC | Sortierrichtung |
Beispiel: Seite 3 mit je 20 Einträgen
https://feavi.com/api/v1/contacts?limit=20&offset=40
Nächste Seite berechnen
// Pseudo-Code offset = 0 limit = 50 while (offset < meta.total) { fetch(`/contacts?limit=${limit}&offset=${offset}`) offset += limit }
HTTP-Statuscodes
| Code | Bedeutung |
|---|---|
| 200 | OK — Anfrage erfolgreich |
| 201 | Created — Eintrag wurde erstellt; id in Antwort |
| 204 | No Content — OPTIONS-Preflight (CORS) |
| 400 | Bad Request — Pflichtfeld fehlt oder ungültiger Wert |
| 401 | Unauthorized — API-Key fehlt oder ungültig |
| 403 | Forbidden — Kein Zugriff auf diese Ressource |
| 404 | Not Found — Ressource existiert nicht (oder gehört anderem Team) |
| 405 | Method Not Allowed — HTTP-Methode für diesen Pfad nicht erlaubt |
| 500 | Server Error — Interner Fehler |
Kontakte
Kunden, Leads und alle anderen Kontakte. Basis-URL: https://feavi.com/api/v1/contacts
/contactsKontaktliste mit Filtern| Parameter | Typ | Beschreibung | |
|---|---|---|---|
| search | string | optional | Freitext-Suche in Name, E-Mail, Firma, Telefon |
| status | string | optional | neu · kontaktiert · qualifiziert · kunde · inaktiv |
| assigned_to | integer | optional | User-ID des zugewiesenen Mitarbeiters |
| city | string | optional | Stadt (Teilsuche) |
| company | string | optional | Firmenname (Teilsuche) |
| order_by | string | optional | created_at · last_name · first_name · company · email |
curl "https://feavi.com/api/v1/contacts?search=Müller&status=kunde&limit=25" \ -H "X-API-Key: feavi_..."
/contacts/{id}Einzelnen Kontakt + Deals + AktivitätenGibt den Kontakt zurück, dazu die letzten 10 Deals und 20 Aktivitäten.
curl "https://feavi.com/api/v1/contacts/42" \ -H "X-API-Key: feavi_..." # Antwort { "success": true, "data": { "id": 42, "first_name": "Max", ... }, "deals": [ ... ], "activities": [ ... ] }
/contactsNeuen Kontakt erstellen| Feld | Typ | Beschreibung | |
|---|---|---|---|
| first_name | string | optional | Vorname |
| last_name | string | optional | Nachname |
| string | optional | E-Mail-Adresse | |
| phone | string | optional | Telefon |
| company | string | optional | Firmenname |
| owner_name | string | optional | Name des Inhabers / Entscheiders |
| status | string | optional | Standard: neu |
| source | string | optional | Herkunft (z.B. Website, Messe) |
| assigned_to | integer | optional | User-ID des Betreuers |
| notes | string | optional | Interne Notiz |
| website | string | optional | Website-URL |
| address | string | optional | Straße & Hausnummer |
| city | string | optional | Stadt |
| zip | string | optional | Postleitzahl |
curl -X POST "https://feavi.com/api/v1/contacts" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{ "first_name": "Anna", "last_name": "Müller", "email": "anna@example.com", "phone": "+49 89 123456", "company": "Muster GmbH", "status": "neu" }' # Antwort 201 { "success": true, "id": 123 }
/contacts/{id}Kontakt aktualisierenSchicke nur die Felder mit, die du ändern möchtest. Alle anderen bleiben unverändert.
curl -X PUT "https://feavi.com/api/v1/contacts/42" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{"status": "kunde", "notes": "Vertrag unterschrieben"}'
/contacts/{id}Kontakt löschencurl -X DELETE "https://feavi.com/api/v1/contacts/42" \ -H "X-API-Key: feavi_..."
Deals
Verkaufschancen in den Sales-Pipelines. Basis-URL: https://feavi.com/api/v1/deals
/dealsDeal-Liste mit Filtern| Parameter | Typ | Beschreibung | |
|---|---|---|---|
| status | string | optional | open (Standard) · won · lost · all |
| pipeline_id | integer | optional | Filtere nach Pipeline |
| stage_id | integer | optional | Filtere nach Stufe |
| contact_id | integer | optional | Alle Deals eines Kontakts |
| assigned_to | integer | optional | Deals eines Mitarbeiters |
| value_min | float | optional | Mindestwert in € |
| value_max | float | optional | Maximalwert in € |
curl "https://feavi.com/api/v1/deals?pipeline_id=1&status=open&value_min=5000" \ -H "X-API-Key: feavi_..."
/dealsNeuen Deal erstellen| Feld | Typ | Beschreibung | |
|---|---|---|---|
| title | string | Pflicht | Deal-Titel |
| pipeline_id | integer | Pflicht | ID der Pipeline |
| stage_id | integer | Pflicht | ID der Stage (muss zur Pipeline gehören) |
| value | float | optional | Deal-Wert in € (Standard: 0) |
| contact_id | integer | optional | Verknüpfter Kontakt |
| assigned_to | integer | optional | Zugewiesener Mitarbeiter |
curl -X POST "https://feavi.com/api/v1/deals" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{ "title": "Enterprise-Paket Muster GmbH", "pipeline_id": 1, "stage_id": 3, "value": 12000, "contact_id": 42 }'
/deals/{id}Deal bearbeiten (Stage verschieben, Wert ändern etc.)| Feld | Typ | Beschreibung |
|---|---|---|
| title | string | Deal-Titel |
| value | float | Wert in € |
| stage_id | integer | Stage (muss zur Pipeline des Deals gehören) |
| contact_id | integer | Kontakt-Verknüpfung |
| assigned_to | integer | Zugewiesener Mitarbeiter |
# Stage verschieben curl -X PUT "https://feavi.com/api/v1/deals/7" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{"stage_id": 5}'
/deals/{id}/wonDeal als gewonnen markierencurl -X POST "https://feavi.com/api/v1/deals/7/won" \ -H "X-API-Key: feavi_..."
/deals/{id}/lostDeal als verloren markierencurl -X POST "https://feavi.com/api/v1/deals/7/lost" \ -H "X-API-Key: feavi_..."
/deals/{id}Deal löschencurl -X DELETE "https://feavi.com/api/v1/deals/7" \ -H "X-API-Key: feavi_..."
Termine
Gebuchte Termine (Appointments). Basis-URL: https://feavi.com/api/v1/appointments
/appointmentsTermine auflisten| Parameter | Typ | Beschreibung | |
|---|---|---|---|
| date_from | date | optional | Startdatum im Format YYYY-MM-DD |
| date_to | date | optional | Enddatum im Format YYYY-MM-DD |
| type_id | integer | optional | Nur bestimmten Termin-Typ |
| staff_id | integer | optional | Termine eines bestimmten Mitarbeiters |
| status | string | optional | active (nicht storniert) · cancelled |
curl "https://feavi.com/api/v1/appointments?date_from=2025-06-01&date_to=2025-06-30&status=active" \ -H "X-API-Key: feavi_..."
/appointmentsTermin manuell buchen| Feld | Typ | Beschreibung | |
|---|---|---|---|
| type_id | integer | Pflicht | Termin-Typ ID |
| start_at | datetime | Pflicht | Startzeit, z.B. 2025-06-15 10:00:00 |
| guest_name | string | Pflicht | Name des Gastes |
| guest_email | string | Pflicht | E-Mail des Gastes |
| staff_user_id | integer | optional | Mitarbeiter-ID |
| guest_phone | string | optional | Telefon des Gastes |
| guest_notes | string | optional | Notizen vom Gast |
curl -X POST "https://feavi.com/api/v1/appointments" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{ "type_id": 1, "staff_user_id": 3, "start_at": "2025-06-15 10:00:00", "guest_name": "Max Mustermann", "guest_email": "max@example.com", "guest_phone": "+49 89 123456" }'
/appointments/{id}Gast-Daten eines Termins aktualisierenNur die Kontaktdaten des Gastes können nachträglich geändert werden (guest_name, guest_email, guest_phone, guest_notes).
/appointments/{id}Termin stornierenSetzt cancelled = 1. Der Termin bleibt in der Datenbank erhalten.
curl -X DELETE "https://feavi.com/api/v1/appointments/5" \ -H "X-API-Key: feavi_..."
Projekte & Aufgaben
Projekt-Management inkl. Aufgaben. Basis-URL: https://feavi.com/api/v1/projects
/projectsProjektliste| Parameter | Typ | Beschreibung | |
|---|---|---|---|
| status | string | optional | planning · active · on_hold · completed · cancelled |
| priority | string | optional | low · medium · high |
| contact_id | integer | optional | Alle Projekte eines Kontakts |
| due_before | date | optional | Fällig bis (inkl.) — Format YYYY-MM-DD |
curl "https://feavi.com/api/v1/projects?status=active&priority=high" \ -H "X-API-Key: feavi_..."
/projects/{id}Einzelnes Projekt inkl. aller Aufgabencurl "https://feavi.com/api/v1/projects/5" \ -H "X-API-Key: feavi_..." # Antwort { "success": true, "data": { "id": 5, "name": "Website-Relaunch", ... }, "tasks": [ { "id": 11, "title": "Design Mockup", "status": "in_progress" }, ... ] }
/projectsNeues Projekt erstellen| Feld | Typ | Beschreibung | |
|---|---|---|---|
| name | string | Pflicht | Projektname |
| description | string | optional | Beschreibung |
| status | string | optional | Standard: active |
| priority | string | optional | Standard: medium |
| color | string | optional | Hex-Farbe, z.B. #6366f1 |
| due_date | date | optional | Fälligkeitsdatum YYYY-MM-DD |
| contact_id | integer | optional | Verknüpfter Kontakt |
/projects/{id}/tasksAufgaben eines Projekts| Parameter | Beschreibung | |
|---|---|---|
| status | optional | todo · in_progress · done |
/projects/{id}/tasksAufgabe erstellen| Feld | Typ | Beschreibung | |
|---|---|---|---|
| title | string | Pflicht | Aufgaben-Titel |
| notes | string | optional | Beschreibung |
| status | string | optional | todo · in_progress · done |
| priority | string | optional | low · medium · high |
| deadline | date | optional | Fälligkeitsdatum YYYY-MM-DD |
| assigned_to | integer | optional | Zugewiesener Mitarbeiter |
curl -X POST "https://feavi.com/api/v1/projects/5/tasks" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{ "title": "Design Mockup erstellen", "priority": "high", "deadline": "2025-06-30", "assigned_to": 2 }'
/projects/{id}/tasks/{task_id}Aufgabe bearbeiten oder Status setzen# Aufgabe als erledigt markieren curl -X PUT "https://feavi.com/api/v1/projects/5/tasks/11" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{"status": "done"}'
/projects/{id}/tasks/{task_id}Aufgabe löschen/projects/{id}Projekt löschenAktivitäten
Anrufe, E-Mails, Meetings, Notizen, Aufgaben — das Aktivitäten-Log. Basis-URL: https://feavi.com/api/v1/activities
/activitiesAktivitätenliste mit Filtern| Parameter | Typ | Beschreibung | |
|---|---|---|---|
| contact_id | integer | optional | Aktivitäten eines Kontakts |
| deal_id | integer | optional | Aktivitäten eines Deals |
| user_id | integer | optional | Aktivitäten eines Mitarbeiters |
| type | string | optional | anruf · email · meeting · notiz · aufgabe |
| date_from | date | optional | Ab Datum YYYY-MM-DD |
| date_to | date | optional | Bis Datum YYYY-MM-DD |
curl "https://feavi.com/api/v1/activities?contact_id=42&type=anruf" \ -H "X-API-Key: feavi_..."
/activitiesAktivität loggen| Feld | Typ | Beschreibung | |
|---|---|---|---|
| type | string | Pflicht | anruf · email · meeting · notiz · aufgabe |
| subject | string | optional | Betreff / Kurzbeschreibung |
| notes | string | optional | Ausführliche Notiz |
| contact_id | integer | optional | Verknüpfter Kontakt |
| deal_id | integer | optional | Verknüpfter Deal |
curl -X POST "https://feavi.com/api/v1/activities" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{ "type": "anruf", "subject": "Erstgespräch geführt", "notes": "Interesse an Paket M. Rückruf in 2 Wochen.", "contact_id": 42, "deal_id": 7 }'
/activities/{id}Aktivität löschencurl -X DELETE "https://feavi.com/api/v1/activities/99" \ -H "X-API-Key: feavi_..."
API-Keys verwalten
Erstelle, liste und deaktiviere API-Keys deines Teams. Basis-URL: https://feavi.com/api/v1/keys
/keysAlle aktiven Keys auflistenGibt alle aktiven Keys des Teams zurück. Der vollständige Key ist nicht enthalten — nur das Präfix und Metadaten.
curl "https://feavi.com/api/v1/keys" \ -H "X-API-Key: feavi_..." # Antwort { "data": [ { "id": 1, "name": "Zapier Integration", "key_prefix": "feavi_a1b2c3", "last_used_at": "2025-05-20 14:30:00", "expires_at": null, "created_at": "2025-01-10 09:00:00" } ] }
/keysNeuen API-Key generieren| Feld | Typ | Beschreibung | |
|---|---|---|---|
| name | string | Pflicht | Beschreibender Name (z.B. "Make.com Webhook") |
| expires_at | date | optional | Ablaufdatum YYYY-MM-DD — leer = unbegrenzt |
curl -X POST "https://feavi.com/api/v1/keys" \ -H "X-API-Key: feavi_..." \ -H "Content-Type: application/json" \ -d '{"name": "Make.com Webhook", "expires_at": "2026-12-31"}' # Antwort 201 { "success": true, "id": 3, "api_key": "feavi_a1b2c3d4e5f6g7h8i9j0...", "warning": "Speichere diesen Key – er wird nicht erneut angezeigt!" }
/keys/{id}API-Key deaktivierenSetzt active = 0. Der Key funktioniert sofort nicht mehr.
curl -X DELETE "https://feavi.com/api/v1/keys/3" \ -H "X-API-Key: feavi_..."
Beispiele aus der Praxis
Zapier / Make.com — Neuer Kontakt aus Webformular
// Webhook-Body von Zapier/Make → FEAVI POST https://feavi.com/api/v1/contacts { "first_name": "{{Vorname}}", "last_name": "{{Nachname}}", "email": "{{E-Mail}}", "company": "{{Firma}}", "source": "Website", "status": "neu" }
JavaScript — Alle offenen Deals laden
const res = await fetch('https://feavi.com/api/v1/deals?status=open&limit=100', { headers: { 'X-API-Key': 'feavi_...' } }); const { data, meta } = await res.json(); console.log(`${meta.total} offene Deals geladen`);
PHP — Kontakt erstellen und Deal anlegen
$key = 'feavi_...'; $api = 'https://feavi.com/api/v1'; // 1. Kontakt anlegen $ch = curl_init("$api/contacts"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["X-API-Key: $key", 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode([ 'first_name' => 'Anna', 'last_name' => 'Müller', 'email' => 'anna@example.com', ]), ]); $result = json_decode(curl_exec($ch), true); $contact_id = $result['id']; // 2. Deal dazu erstellen curl_setopt($ch, CURLOPT_URL, "$api/deals"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ 'title' => 'Neues Angebot Anna Müller', 'pipeline_id' => 1, 'stage_id' => 1, 'value' => 4900, 'contact_id' => $contact_id, ])); $deal = json_decode(curl_exec($ch), true);