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.

Basis-URL https://feavi.com/api/v1
Format application/json
Auth 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)
);
Ersetze 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
Den Query-Parameter nur zum Ausprobieren im Browser nutzen, nicht in Produktionscode — Keys tauchen sonst in Server-Logs auf.

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.

StatusBedeutung
401Kein Key mitgeschickt, oder Key ungültig / deaktiviert / abgelaufen
403Zugriff 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:

ParameterTypStandardBeschreibung
limitinteger50Einträge pro Seite (max. 200)
offsetinteger0Überspringe die ersten N Einträge
order_bystringcreated_atSortierfeld (ressourcenabhängig)
order_dirASC / DESCDESCSortierrichtung

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

CodeBedeutung
200OK — Anfrage erfolgreich
201Created — Eintrag wurde erstellt; id in Antwort
204No Content — OPTIONS-Preflight (CORS)
400Bad Request — Pflichtfeld fehlt oder ungültiger Wert
401Unauthorized — API-Key fehlt oder ungültig
403Forbidden — Kein Zugriff auf diese Ressource
404Not Found — Ressource existiert nicht (oder gehört anderem Team)
405Method Not Allowed — HTTP-Methode für diesen Pfad nicht erlaubt
500Server Error — Interner Fehler

Kontakte

Kunden, Leads und alle anderen Kontakte. Basis-URL: https://feavi.com/api/v1/contacts

GET/contactsKontaktliste mit Filtern
ParameterTypBeschreibung
searchstringoptionalFreitext-Suche in Name, E-Mail, Firma, Telefon
statusstringoptionalneu · kontaktiert · qualifiziert · kunde · inaktiv
assigned_tointegeroptionalUser-ID des zugewiesenen Mitarbeiters
citystringoptionalStadt (Teilsuche)
companystringoptionalFirmenname (Teilsuche)
order_bystringoptionalcreated_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_..."
GET/contacts/{id}Einzelnen Kontakt + Deals + Aktivitäten

Gibt 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": [ ... ]
}
POST/contactsNeuen Kontakt erstellen
FeldTypBeschreibung
first_namestringoptionalVorname
last_namestringoptionalNachname
emailstringoptionalE-Mail-Adresse
phonestringoptionalTelefon
companystringoptionalFirmenname
owner_namestringoptionalName des Inhabers / Entscheiders
statusstringoptionalStandard: neu
sourcestringoptionalHerkunft (z.B. Website, Messe)
assigned_tointegeroptionalUser-ID des Betreuers
notesstringoptionalInterne Notiz
websitestringoptionalWebsite-URL
addressstringoptionalStraße & Hausnummer
citystringoptionalStadt
zipstringoptionalPostleitzahl
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 }
PUT/contacts/{id}Kontakt aktualisieren

Schicke 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"}'
DELETE/contacts/{id}Kontakt löschen
Löscht den Kontakt dauerhaft inkl. aller Aktivitäten, Tags und Custom Fields. Diese Aktion kann nicht rückgängig gemacht werden.
curl -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

GET/dealsDeal-Liste mit Filtern
ParameterTypBeschreibung
statusstringoptionalopen (Standard) · won · lost · all
pipeline_idintegeroptionalFiltere nach Pipeline
stage_idintegeroptionalFiltere nach Stufe
contact_idintegeroptionalAlle Deals eines Kontakts
assigned_tointegeroptionalDeals eines Mitarbeiters
value_minfloatoptionalMindestwert in €
value_maxfloatoptionalMaximalwert in €
curl "https://feavi.com/api/v1/deals?pipeline_id=1&status=open&value_min=5000" \
     -H "X-API-Key: feavi_..."
POST/dealsNeuen Deal erstellen
FeldTypBeschreibung
titlestringPflichtDeal-Titel
pipeline_idintegerPflichtID der Pipeline
stage_idintegerPflichtID der Stage (muss zur Pipeline gehören)
valuefloatoptionalDeal-Wert in € (Standard: 0)
contact_idintegeroptionalVerknüpfter Kontakt
assigned_tointegeroptionalZugewiesener 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
     }'
PUT/deals/{id}Deal bearbeiten (Stage verschieben, Wert ändern etc.)
FeldTypBeschreibung
titlestringDeal-Titel
valuefloatWert in €
stage_idintegerStage (muss zur Pipeline des Deals gehören)
contact_idintegerKontakt-Verknüpfung
assigned_tointegerZugewiesener 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}'
POST/deals/{id}/wonDeal als gewonnen markieren
curl -X POST "https://feavi.com/api/v1/deals/7/won" \
     -H "X-API-Key: feavi_..."
POST/deals/{id}/lostDeal als verloren markieren
curl -X POST "https://feavi.com/api/v1/deals/7/lost" \
     -H "X-API-Key: feavi_..."
DELETE/deals/{id}Deal löschen
Löscht den Deal und alle zugehörigen Aktivitäten dauerhaft.
curl -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

GET/appointmentsTermine auflisten
ParameterTypBeschreibung
date_fromdateoptionalStartdatum im Format YYYY-MM-DD
date_todateoptionalEnddatum im Format YYYY-MM-DD
type_idintegeroptionalNur bestimmten Termin-Typ
staff_idintegeroptionalTermine eines bestimmten Mitarbeiters
statusstringoptionalactive (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_..."
POST/appointmentsTermin manuell buchen
FeldTypBeschreibung
type_idintegerPflichtTermin-Typ ID
start_atdatetimePflichtStartzeit, z.B. 2025-06-15 10:00:00
guest_namestringPflichtName des Gastes
guest_emailstringPflichtE-Mail des Gastes
staff_user_idintegeroptionalMitarbeiter-ID
guest_phonestringoptionalTelefon des Gastes
guest_notesstringoptionalNotizen 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"
     }'
PUT/appointments/{id}Gast-Daten eines Termins aktualisieren

Nur die Kontaktdaten des Gastes können nachträglich geändert werden (guest_name, guest_email, guest_phone, guest_notes).

DELETE/appointments/{id}Termin stornieren

Setzt 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

GET/projectsProjektliste
ParameterTypBeschreibung
statusstringoptionalplanning · active · on_hold · completed · cancelled
prioritystringoptionallow · medium · high
contact_idintegeroptionalAlle Projekte eines Kontakts
due_beforedateoptionalFällig bis (inkl.) — Format YYYY-MM-DD
curl "https://feavi.com/api/v1/projects?status=active&priority=high" \
     -H "X-API-Key: feavi_..."
GET/projects/{id}Einzelnes Projekt inkl. aller Aufgaben
curl "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" }, ... ]
}
POST/projectsNeues Projekt erstellen
FeldTypBeschreibung
namestringPflichtProjektname
descriptionstringoptionalBeschreibung
statusstringoptionalStandard: active
prioritystringoptionalStandard: medium
colorstringoptionalHex-Farbe, z.B. #6366f1
due_datedateoptionalFälligkeitsdatum YYYY-MM-DD
contact_idintegeroptionalVerknüpfter Kontakt
GET/projects/{id}/tasksAufgaben eines Projekts
ParameterBeschreibung
statusoptionaltodo · in_progress · done
POST/projects/{id}/tasksAufgabe erstellen
FeldTypBeschreibung
titlestringPflichtAufgaben-Titel
notesstringoptionalBeschreibung
statusstringoptionaltodo · in_progress · done
prioritystringoptionallow · medium · high
deadlinedateoptionalFälligkeitsdatum YYYY-MM-DD
assigned_tointegeroptionalZugewiesener 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
     }'
PUT/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"}'
DELETE/projects/{id}/tasks/{task_id}Aufgabe löschen
DELETE/projects/{id}Projekt löschen
Löscht das Projekt inkl. aller Aufgaben und Kommentare dauerhaft.

Aktivitäten

Anrufe, E-Mails, Meetings, Notizen, Aufgaben — das Aktivitäten-Log. Basis-URL: https://feavi.com/api/v1/activities

GET/activitiesAktivitätenliste mit Filtern
ParameterTypBeschreibung
contact_idintegeroptionalAktivitäten eines Kontakts
deal_idintegeroptionalAktivitäten eines Deals
user_idintegeroptionalAktivitäten eines Mitarbeiters
typestringoptionalanruf · email · meeting · notiz · aufgabe
date_fromdateoptionalAb Datum YYYY-MM-DD
date_todateoptionalBis Datum YYYY-MM-DD
curl "https://feavi.com/api/v1/activities?contact_id=42&type=anruf" \
     -H "X-API-Key: feavi_..."
POST/activitiesAktivität loggen
FeldTypBeschreibung
typestringPflichtanruf · email · meeting · notiz · aufgabe
subjectstringoptionalBetreff / Kurzbeschreibung
notesstringoptionalAusführliche Notiz
contact_idintegeroptionalVerknüpfter Kontakt
deal_idintegeroptionalVerknü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
     }'
DELETE/activities/{id}Aktivität löschen
curl -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

GET/keysAlle aktiven Keys auflisten

Gibt 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"
    }
  ]
}
POST/keysNeuen API-Key generieren
FeldTypBeschreibung
namestringPflichtBeschreibender Name (z.B. "Make.com Webhook")
expires_atdateoptionalAblaufdatum YYYY-MM-DD — leer = unbegrenzt
Der vollständige Key wird nur einmal zurückgegeben. Sofort sicher speichern!
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!"
}
DELETE/keys/{id}API-Key deaktivieren

Setzt 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);
FEAVI REST API v1 · Sandeck Media Fragen? → info@sandeck-media.de