Aller au contenu

📡 API Overview

Base URL

http://localhost:3000/api

Authentication

Multi-Tenant Zugriff über Header:

X-Tenant-ID: your-tenant-id

Endpoints

Health & Status

Method Endpoint Description
GET /api/health Health Check
GET /api/cache/stats Cache Statistiken
DELETE /api/cache Cache leeren

Contracts

Method Endpoint Description
GET /api/contracts Alle Verträge
GET /api/contracts/:id Einzelner Vertrag
POST /api/contracts Vertrag erstellen
PATCH /api/contracts/:id/status Status ändern

Properties

Method Endpoint Description
GET /api/properties Alle Immobilien
GET /api/properties/:id Einzelne Immobilie
GET /api/properties/:id/units Einheiten
POST /api/properties Immobilie erstellen

Integrations

Method Endpoint Description
GET /api/integrations/sevdesk/test sevDesk Test
GET /api/integrations/sevdesk/invoices Rechnungen
GET /api/integrations/evcc/state evcc Status
GET /api/integrations/evcc/loadpoints Ladepunkte

Response Format

{
  "id": "clx123...",
  "name": "Example",
  "createdAt": "2024-12-30T10:00:00Z"
}

Cache Headers

X-Cache: HIT | MISS
X-Cache-Age: 45
X-Cache-TTL: 600

Error Format

{
  "error": "Error message",
  "code": "ERROR_CODE"
}

HTTP Status Codes

Code Description
200 OK
201 Created
400 Bad Request
404 Not Found
500 Server Error
503 Service Unavailable (Integration nicht konfiguriert)