Einstellungen
Die Settings API ermöglicht die Verwaltung von Profil-, Sicherheits- und allgemeinen Benutzereinstellungen.
Endpunkte
Allgemein
| Methode | Endpunkt | Beschreibung |
|---|
GET | /api/v1/settings/general | Allgemeine Einstellungen |
PUT | /api/v1/settings/general | Einstellungen aktualisieren |
Profil
| Methode | Endpunkt | Beschreibung |
|---|
GET | /api/v1/settings/profile | Profil abrufen |
PUT | /api/v1/settings/profile | Profil aktualisieren |
POST | /api/v1/settings/profile/avatar | Avatar hochladen |
DELETE | /api/v1/settings/profile/avatar | Avatar entfernen |
Sicherheit
| Methode | Endpunkt | Beschreibung |
|---|
GET | /api/v1/settings/security | Sicherheitsübersicht |
PUT | /api/v1/settings/security | Sicherheitsoptionen ändern |
PUT | /api/v1/settings/security/password | Passwort ändern |
GET | /api/v1/settings/security/sessions | Aktive Sessions |
DELETE | /api/v1/settings/security/sessions | Sessions beenden |
Allgemeine Einstellungen
Abrufen
GET /api/v1/settings/general
{
"success": true,
"data": {
"locale": "de",
"timezone": "Europe/Berlin",
"dateFormat": "DD.MM.YYYY",
"timeFormat": "24h",
"notifications": {
"email": true,
"browser": true,
"marketing": false
}
}
}
Aktualisieren
PUT /api/v1/settings/general
{
"locale": "en",
"timezone": "Europe/London",
"notifications": {
"marketing": true
}
}
Profil
Abrufen
GET /api/v1/settings/profile
{
"success": true,
"data": {
"name": "Max Mustermann",
"email": "max@example.com",
"avatar": "https://cdn.codefluss.com/avatars/user_abc123.jpg",
"bio": "Webentwickler und Designer",
"company": "Meine Firma GmbH",
"website": "https://max-mustermann.de",
"social": {
"twitter": "@maxmustermann",
"linkedin": "in/maxmustermann"
}
}
}
Avatar hochladen
POST /api/v1/settings/profile/avatar
curl -X POST "https://api.codefluss.com/v1/settings/profile/avatar" \
-H "Authorization: Bearer cf_live_abc123..." \
-F "file=@/path/to/avatar.jpg"
Anforderungen:
- Format: JPEG, PNG, WebP
- Max. Größe: 5 MB
- Empfohlene Größe: 400x400px
Sicherheit
Übersicht
GET /api/v1/settings/security
{
"success": true,
"data": {
"passwordLastChanged": "2026-01-01T10:00:00Z",
"twoFactorEnabled": false,
"activeSessions": 3,
"loginHistory": [
{
"date": "2026-01-23T08:00:00Z",
"ip": "192.168.1.1",
"device": "Chrome on macOS",
"location": "Frankfurt, DE"
}
]
}
}
Passwort ändern
PUT /api/v1/settings/security/password
{
"currentPassword": "altes_passwort",
"newPassword": "neues_sicheres_passwort",
"confirmPassword": "neues_sicheres_passwort"
}
Aktive Sessions
GET /api/v1/settings/security/sessions
{
"success": true,
"data": [
{
"id": "sess_abc123",
"device": "Chrome on macOS",
"ip": "192.168.1.1",
"location": "Frankfurt, DE",
"lastActive": "2026-01-23T10:00:00Z",
"current": true
},
{
"id": "sess_def456",
"device": "Mobile App (iOS)",
"ip": "192.168.1.2",
"location": "Frankfurt, DE",
"lastActive": "2026-01-22T18:00:00Z",
"current": false
}
]
}
Session beenden
DELETE /api/v1/settings/security/sessions
{
"sessionId": "sess_def456"
}
Oder alle anderen Sessions beenden:
Fehler
| Code | Beschreibung |
|---|
400 | Ungültige Daten (z.B. Passwort zu schwach) |
401 | Nicht authentifiziert |
403 | Falsches aktuelles Passwort |
Nächste Schritte