01
Headers
Authorization: Bearer <ration_access_token>
Content-Type: application/jsonUse 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 field | Type | Description |
|---|---|---|
id | string | Authenticated user’s identifier. |
username | string | User’s sign-in address. |
tenant_id | string | Tenant containing the account. |
name | string | Display name, when set. |
language | string | Preferred language, when set. |
tags, metaData | array / object | Profile 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 field | Type | Required | Description |
|---|---|---|---|
user | object | Yes | Profile fields to change. |
user.name | string | No | Display name. |
user.language | string | No | Language preference. |
user.tags | array | No | Profile tags. |
user.encryptMessages | boolean | No | Request message encryption preference. |
user.encryptForwarded | boolean | No | Request forwarding-encryption preference. |
user.pubKey | string | No | Public key material. |
user.metaData | object | No | Application metadata. |
user.fromWhitelist | array | No | Allowed 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
| Method | Path | Request fields | Response |
|---|---|---|---|
GET | /settings/general-preferences | None | { "success": true, "preferences": Preferences } |
PUT | /settings/general-preferences | A 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"
}
}| Field | Type | Description |
|---|---|---|
continent | string | Geographic region. |
country | string | Country selection. |
language | string | Preferred locale/language. |
date_format | string | Date format preference. dateFormat is accepted as an input alias. |
time_format | string | Time 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 }
}
}| Method | Path | Request | Response |
|---|---|---|---|
GET | /settings/notifications | None | { "success": true, "preferences": object, "known_modules": string[], "known_types": string[] } |
PUT | /settings/notifications | A 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.
| Method | Path | Request fields | Response |
|---|---|---|---|
GET | /settings/signatures | None | { "results": [Signature] } |
POST | /settings/signatures | { "signature": { "name", "signature_text", "signature_html", "priority" } } | Created signature object. |
GET | /settings/signatures/:id | None | Signature |
PUT | /settings/signatures/:id | { "signature": { "name", "signature_text", "signature_html", "priority" } } | Updated signature object. |
PUT | /settings/signatures/:id/default | None | Updated signature object. |
DELETE | /settings/signatures/:id | None | "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 field | Type | Required | Description |
|---|---|---|---|
existingPassword | string | Yes | Current password. |
password | string | Yes | New password. |
otp or token | string, or { "token": string } | When 2FA is enabled | Current 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.
| Method | Path | Request | Success response |
|---|---|---|---|
POST | /auth/initiate-2fa | None | { "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-2fa | Same token shape as enable. | { "status": "success", "token": "…" } |
POST | /auth/disable-2fa | None | { "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-2fastill 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.
| Method | Path | Request | Response |
|---|---|---|---|
GET | /settings/application-passwords | None | Application-password list. The secret value is not returned. |
POST | /settings/application-passwords | ApplicationPasswordRequest | Created application-password record, including the generated secret when applicable. |
DELETE | /settings/application-passwords/:asp_id | None | Deletion result. |
14
ApplicationPasswordRequest fields
| Field | Type | Required | Description |
|---|---|---|---|
description | string | Recommended | Recognisable client/device label. name is accepted as an alias. |
scopes | string[] | Recommended | Mail-client permissions: imap, pop3, smtp, or the all-except-master scope provided by the service. scope is accepted as a one-value alias. |
password | string | No | Optional client-chosen 16-letter password. It must contain exactly 16 ASCII letters; omit it to generate a password. |
address | string | No | Address to associate with the credential, when supported. |
ttl | integer | No | Credential lifetime, when supported. |
generateMobileconfig | boolean | No | Request 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
| Status | Meaning |
|---|---|
401 | Missing or invalid bearer token. |
403 | Current user is not permitted to complete the security or application-password operation. |
404 | Signature or application password does not exist for the current user. |
422 | Invalid signature ID, invalid application-password request, weak password, or missing/invalid TOTP token. |
500 | An unexpected service error while processing a profile or signature action. |
Last reviewed 27 November 2026.