Skip to content

Settings API ​

The Settings API manages system configuration, feature flags, and organizational settings.

Overview ​

ProcedureTypeAuthDescription
settings.getAllQueryYesGet all settings
settings.getByCategoryQueryYesGet settings by category
settings.updateMutationAdminUpdate settings
settings.resetMutationAdminReset to defaults
settings.getPublicQueryNoGet public settings
settings.getFeatureFlagsQueryNoGet feature flags

Settings Categories ​

CategoryDescription
generalGeneral application settings
emailEmail/SMTP configuration
notificationsNotification preferences
mapMap display settings
retentionData retention policies
securitySecurity settings

Procedures ​

settings.getAll ​

Get all settings grouped by category.

Type: Query Auth Required: Yes

Response ​

typescript
{
  general: {
    language: string;
    theme: string;
    siteName: string;
    timezone: string;
    dateFormat: string;
    timeFormat: string;
    maintenanceMode: boolean;
    logo: string | null;
    favicon: string | null;
  };
  email: {
    smtpServer: string;
    smtpPort: number;
    smtpUser: string;
    smtpPassword: string;
    smtpSecure: boolean;
    emailFrom: string;
    emailFooter: string;
  };
  notifications: {
    emailNotifications: boolean;
    pushNotifications: boolean;
    smsNotifications: boolean;
  };
  map: {
    defaultZoom: number;
    defaultLat: number;
    defaultLng: number;
    mapboxToken: string;
  };
  retention: {
    eventRetentionDays: number;
    logRetentionDays: number;
  };
  security: {
    sessionTimeout: number;
    maxLoginAttempts: number;
    lockoutDuration: number;
    mfaEnabled: boolean;
  };
}

Example ​

bash
curl -X GET "https://api.itms.solutions/trpc/settings.getAll" \
  -H "Authorization: Bearer YOUR_TOKEN"

settings.getByCategory ​

Get settings for a specific category.

Type: Query Auth Required: Yes

Input ​

typescript
{
  category: "general" | "email" | "notifications" | "map" | "retention" | "security";
}

settings.update ​

Update settings (admin only).

Type: Mutation Auth Required: Admin

Input ​

typescript
{
  general?: {
    language?: string;
    theme?: string;
    siteName?: string;
    timezone?: string;
    dateFormat?: string;
    timeFormat?: string;
    maintenanceMode?: boolean;
    logo?: string;
    favicon?: string;
  };
  email?: {
    smtpServer?: string;
    smtpPort?: number;
    smtpUser?: string;
    smtpPassword?: string;
    smtpSecure?: boolean;
    emailFrom?: string;
    emailFooter?: string;
  };
  notifications?: {
    emailNotifications?: boolean;
    pushNotifications?: boolean;
    smsNotifications?: boolean;
  };
  map?: {
    defaultZoom?: number;
    defaultLat?: number;
    defaultLng?: number;
    mapboxToken?: string;
  };
  retention?: {
    eventRetentionDays?: number;
    logRetentionDays?: number;
  };
}

Response ​

typescript
{
  success: boolean;
}

Example ​

bash
curl -X POST "https://api.itms.solutions/trpc/settings.update" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "json": {
      "general": {
        "siteName": "My Traffic System",
        "timezone": "Europe/London"
      }
    }
  }'

settings.reset ​

Reset settings to defaults (admin only).

Type: Mutation Auth Required: Admin

Input ​

typescript
{
  category?: "general" | "email" | "notifications" | "map" | "retention" | "security";
  // If not specified, resets all settings
}

settings.getPublic ​

Get public settings for frontend configuration. No authentication required.

Type: Query Auth Required: No

Response ​

typescript
{
  siteName: string;
  language: string;
  theme: string;
  timezone: string;
  dateFormat: string;
  timeFormat: string;
  maintenanceMode: boolean;
  logo: string | null;
  favicon: string | null;
  defaultZoom: number;
  defaultLat: number;
  defaultLng: number;
}

Example ​

bash
curl -X GET "https://api.itms.solutions/trpc/settings.getPublic"

settings.getFeatureFlags ​

Get feature flags for the application.

Type: Query Auth Required: No

Response ​

typescript
{
  dashboard: { enabled: boolean; description: string };
  sensors: { enabled: boolean; description: string };
  reports: { enabled: boolean; description: string };
  analytics: { enabled: boolean; description: string };
  incidents: { enabled: boolean; description: string };
  traffic: { enabled: boolean; description: string };
  locations: { enabled: boolean; description: string };
  users: { enabled: boolean; description: string };
  settings: { enabled: boolean; description: string };
  realtime: { enabled: boolean; description: string };
}

Default Values ​

General Settings ​

SettingDefaultDescription
languageenUI language
themelightColor theme
siteNameSmart City TVMSApplication name
timezoneAsia/AlmatyDefault timezone
dateFormatDD/MM/YYYYDate format
timeFormat24hTime format
maintenanceModefalseMaintenance mode

Email Settings ​

SettingDefaultDescription
smtpPort587SMTP port
smtpSecuretrueUse TLS
emailFromnoreply@itms.solutionsSender email

Map Settings ​

SettingDefaultDescription
defaultZoom12Default map zoom
defaultLat43.238949Default latitude (Almaty)
defaultLng76.945465Default longitude

Retention Settings ​

SettingDefaultDescription
eventRetentionDays90Days to keep events
logRetentionDays30Days to keep logs

Security Settings ​

SettingDefaultDescription
sessionTimeout24Session timeout (hours)
maxLoginAttempts5Max failed logins
lockoutDuration30Lockout duration (minutes)
mfaEnabledfalseMulti-factor auth

SCS Smart City - Traffic, Gateway, Camera, and NVR Platform