post__settings_user

POST /settings/user

Update User Settings (Full Replacement)

Update the current user's settings with a complete replacement. This endpoint replaces all existing settings with the provided settings object. The user must be authenticated.

Request Body Schema

Name
Type
Required
Restrictions
Description

» settings

object

true

none

Complete settings object to replace existing settings

TypeScript Client Library

// Using the Flashback TypeScript client
import { FlashbackClient } from '@flashback/client';

const client = new FlashbackClient({
  accessToken: 'your-access-token'
});

// Update user settings with full replacement
try {
  const result = await client.settings.user.update({
    settings: {
      theme: 'dark',
      notifications: {
        email: true,
        push: false
      },
      timezone: 'UTC',
      language: 'en'
    }
  });
  console.log('Settings updated:', result);
} catch (error) {
  console.error('Failed to update settings:', error);
}

Code Samples

# You can also use wget
curl -X POST https://backend.flashback.tech/settings/user \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "settings": {
      "theme": "dark",
      "notifications": {
        "email": true,
        "push": false
      },
      "timezone": "UTC",
      "language": "en"
    }
  }'

Example responses

200 Response

{
  "success": true,
  "message": "User settings updated successfully"
}

400 Response

{
  "success": false,
  "message": "Failed to update user settings"
}

500 Response

{
  "success": false,
  "message": "Internal server error",
  "error": "Database connection failed"
}

Responses

Status
Meaning
Description
Schema

200

User settings updated successfully

Inline

400

Failed to update user settings

Inline

500

Internal server error

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Indicates if the request was successful

» message

string

true

none

Success message describing the operation

Status Code 400

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Always false for error responses

» message

string

true

none

Error message describing the issue

Status Code 500

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Always false for error responses

» message

string

true

none

Error message describing the issue

» error

string

false

none

Additional error details if available

DTOs

UpdateSettingsRequest

export interface UpdateSettingsRequest {
  // Using Record<string, any> for maximum flexibility - settings can contain any JSON-serializable data
  settings: Record<string, any>;
}

SettingsErrorResponse

export interface SettingsErrorResponse {
  success: false;
  message: string;
  error?: string;
}

Last updated

Was this helpful?