Einstellungen

Einstellungen

Die Settings API ermöglicht die Verwaltung von Profil-, Sicherheits- und allgemeinen Benutzereinstellungen.

Endpunkte

Allgemein

MethodeEndpunktBeschreibung
GET/api/v1/settings/generalAllgemeine Einstellungen
PUT/api/v1/settings/generalEinstellungen aktualisieren

Profil

MethodeEndpunktBeschreibung
GET/api/v1/settings/profileProfil abrufen
PUT/api/v1/settings/profileProfil aktualisieren
POST/api/v1/settings/profile/avatarAvatar hochladen
DELETE/api/v1/settings/profile/avatarAvatar entfernen

Sicherheit

MethodeEndpunktBeschreibung
GET/api/v1/settings/securitySicherheitsübersicht
PUT/api/v1/settings/securitySicherheitsoptionen ändern
PUT/api/v1/settings/security/passwordPasswort ändern
GET/api/v1/settings/security/sessionsAktive Sessions
DELETE/api/v1/settings/security/sessionsSessions 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 Content-Type: multipart/form-data
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:

{ "allOther": true }

Fehler

CodeBeschreibung
400Ungültige Daten (z.B. Passwort zu schwach)
401Nicht authentifiziert
403Falsches aktuelles Passwort

Nächste Schritte