Settings API

All Settings routes need a Ration bearer token and act only on the authenticated user. Paths are relative to <code>/apis/v1</code>.

01

Headers

Authorization: Bearer <ration_access_token>
Content-Type: application/json

Use the /settings/... routes in new integrations. The older /app/settings/... aliases remain only for compatibility and are not part of this reference.

02

Read the current profile

GET /settings/profile returns the current user object.

Response fieldTypeDescription
idstringAuthenticated user’s identifier.
usernamestringUser’s sign-in address.
tenant_idstringTenant containing the account.
namestringDisplay name, when set.
languagestringPreferred language, when set.
tags, metaDataarray / objectProfile metadata, when present.

Treat unlisted fields as extensible. Check that one is present before you depend on it.

03

Update the current profile

PUT /settings/profile returns the updated user object.

{
  "user": {
    "name": "Ada Okafor",
    "language": "en"
  }
}
Request fieldTypeRequiredDescription
userobjectYesProfile fields to change.
user.namestringNoDisplay name.
user.languagestringNoLanguage preference.
user.tagsarrayNoProfile tags.
user.encryptMessagesbooleanNoRequest message encryption preference.
user.encryptForwardedbooleanNoRequest forwarding-encryption preference.
user.pubKeystringNoPublic key material.
user.metaDataobjectNoApplication metadata.
user.fromWhitelistarrayNoAllowed sender addresses.

Fields outside this allowlist are ignored, including account identity, tenant, quota and password fields.

04

Deactivate the current account

DELETE /settings/profile returns 200 with the string Account deactivated when it succeeds.

This acts on the whole account. Ask the user to confirm explicitly before you send it.

05

General preferences

MethodPathRequest fieldsResponse
GET/settings/general-preferencesNone{ "success": true, "preferences": Preferences }
PUT/settings/general-preferencesA partial preferences object, or the same fields at the top level.{ "success": true, "preferences": Preferences }

06

The Preferences object

Preferences always contains these fields. A blank string means no preference has been chosen.

{
  "preferences": {
    "country": "Nigeria",
    "language": "en",
    "date_format": "DD/MM/YYYY",
    "time_format": "HH:mm"
  }
}
FieldTypeDescription
continentstringGeographic region.
countrystringCountry selection.
languagestringPreferred locale/language.
date_formatstringDate format preference. dateFormat is accepted as an input alias.
time_formatstringTime format preference. timeFormat is accepted as an input alias.

07

Notification preferences

Send only the notification settings that should change. Ration keeps the user’s other settings and returns the effective, merged preference map.

{
  "preferences": {
    "mail": { "enabled": true },
    "chat": { "enabled": false }
  }
}
MethodPathRequestResponse
GET/settings/notificationsNone{ "success": true, "preferences": object, "known_modules": string[], "known_types": string[] }
PUT/settings/notificationsA partial preferences object, either inside preferences or at the top level.{ "success": true, "preferences": object }

Build your preference editor from known_modules and known_types in the read response, rather than hard-coding a list.

08

Mail signatures

A Signature has id, name, signature_text, signature_html, priority and inserted_at fields. priority: true marks the default signature.

MethodPathRequest fieldsResponse
GET/settings/signaturesNone{ "results": [Signature] }
POST/settings/signatures{ "signature": { "name", "signature_text", "signature_html", "priority" } }Created signature object.
GET/settings/signatures/:idNoneSignature
PUT/settings/signatures/:id{ "signature": { "name", "signature_text", "signature_html", "priority" } }Updated signature object.
PUT/settings/signatures/:id/defaultNoneUpdated signature object.
DELETE/settings/signatures/:idNone"Signature Deleted"

Ration always sets the tenant and owner identifiers from the authenticated user. Supplying them in a request can’t move or take over a signature.

09

Read security state

GET /settings/security returns:

{
  "status": "success",
  "security": {
    "enable2fa": true
  }
}

security can include other account-security fields. Treat it as a read-only, extensible object.

10

Change the sign-in password

PUT /settings/password

  • The new password must be at least 12 characters and include lowercase, uppercase, and a number or supported symbol.
  • With 2FA enabled, a current authentication code is required.
  • Success returns 200 Successful. The client should then clear locally stored credentials and ask the user to sign in again.
Request fieldTypeRequiredDescription
existingPasswordstringYesCurrent password.
passwordstringYesNew password.
otp or tokenstring, or { "token": string }When 2FA is enabledCurrent TOTP code.

11

Two-factor authentication (TOTP)

Two-factor routes sit in the /auth namespace because they act on session authentication. They are still protected routes.

MethodPathRequestSuccess response
POST/auth/initiate-2faNone{ "status": "success", "otp_uri": "otpauth://…", "message": "…" }
POST/auth/enable-2fa{ "otp": "123456" } or { "otp": { "token": "123456" } }{ "status": "success", "backup_codes": string[], "redirect_to": "…" }
POST/auth/verify-2faSame token shape as enable.{ "status": "success", "token": "…" }
POST/auth/disable-2faNone{ "status": "success", "message": "2FA successfully disabled" }

otp_uri is a setup secret. Show it only as a QR code or pass it straight to a trusted authenticator-app hand-off. Never write it to logs, analytics, telemetry or persistent client storage.

12

Authenticator apps and backup codes

  • Ration has been tested with 2FAS and uses standard TOTP, so Google Authenticator, Microsoft Authenticator, Authy, 1Password, Bitwarden and similar TOTP apps work too.
  • Enabling 2FA returns backup codes and requires a fresh sign-in. Store the backup codes securely, apart from the password.
  • The historic spelling POST /auth/initate-2fa still works for older clients. New integrations must use /auth/initiate-2fa.

13

Application-specific passwords

Once 2FA is on, IMAP, POP3 and SMTP clients must sign in with an application-specific password, not the main account password. Create one per mail client or device, show and store it only when you create it, and delete it when that client no longer needs access.

MethodPathRequestResponse
GET/settings/application-passwordsNoneApplication-password list. The secret value is not returned.
POST/settings/application-passwordsApplicationPasswordRequestCreated application-password record, including the generated secret when applicable.
DELETE/settings/application-passwords/:asp_idNoneDeletion result.

14

ApplicationPasswordRequest fields

FieldTypeRequiredDescription
descriptionstringRecommendedRecognisable client/device label. name is accepted as an alias.
scopesstring[]RecommendedMail-client permissions: imap, pop3, smtp, or the all-except-master scope provided by the service. scope is accepted as a one-value alias.
passwordstringNoOptional client-chosen 16-letter password. It must contain exactly 16 ASCII letters; omit it to generate a password.
addressstringNoAddress to associate with the credential, when supported.
ttlintegerNoCredential lifetime, when supported.
generateMobileconfigbooleanNoRequest a client configuration payload, when supported.

An application-specific password is a credential: handle it like a password. Don’t log the create response, and don’t send the password through chat or email.

15

Errors

StatusMeaning
401Missing or invalid bearer token.
403Current user is not permitted to complete the security or application-password operation.
404Signature or application password does not exist for the current user.
422Invalid signature ID, invalid application-password request, weak password, or missing/invalid TOTP token.
500An unexpected service error while processing a profile or signature action.
Next guideGetting started with Ration →

Last reviewed 27 November 2026.

Still stuck?

Chat with our support team. Tell us what you were doing and what you saw, and a person will pick it up. You can also email support@ration.works.

Buying or moving to Ration?

For plans, migration or an on-premise deployment, talk to our sales team.