Zum Hauptinhalt springen

API Endpunkte

Controla stellt eine RESTful API bereit. Alle Anfragen müssen authentifiziert sein (außer Login/Register).

Basis-URL: /api

Authentifizierung​

Login​

POST /auth/login

Authentifiziert einen Benutzer und gibt einen JWT zurück.

Request Body:

{
"username": "admin",
"password": "password"
}

Response:

{
"token": "eyJhbGciOiJIUzI1NiJ9...",
"type": "Bearer",
"username": "admin",
"roles": ["ROLE_ADMIN"]
}

Aktueller User​

GET /auth/me

Gibt Informationen über den aktuell eingeloggten Benutzer zurück.

Instanzen​

Alle Instanzen abrufen​

GET /instances

Gibt eine Liste aller konfigurierten Instanzen zurück.

Response:

[
{
"id": 1,
"name": "Production",
"baseUrl": "https://n8n.example.com",
"status": "ONLINE",
"version": "1.2.3",
"lastSeenAt": "2023-10-27T10:00:00Z"
}
]

Instanz erstellen​

POST /instances

Fügt eine neue Instanz hinzu.

Request Body:

{
"name": "Staging",
"baseUrl": "https://staging.n8n.example.com",
"apiKey": "n8n_api_..."
}

Instanz Details​

GET /instances/{id}

Instanz Workflows​

GET /instances/{id}/workflows

Ruft die Workflows direkt von der n8n-Instanz ab (Proxy).

Instanz Events​

GET /instances/{id}/events

Ruft gespeicherte Fehler-Events ab.

Alert Settings​

Einstellungen abrufen​

GET /alerts/settings

Einstellungen speichern​

PUT /alerts/settings

Request Body:

{
"emailEnabled": true,
"recipientEmail": "admin@example.com",
"notifyOnOffline": true,
"notifyOnError": true
}