Preferences API
The Preferences API allows users to read and update their personal application preferences, including notification settings, AI behavior, view modes, and localization.
Most fields are flat. Two are not: quietHours, which is freeform, and aiCustomInstructions, which is a structured object with its own merge rules — see Custom Instructions.
Custom Instructions
Custom Instructions are account-wide, user-authored preferences that Chao considers on every eligible turn. They are explicit standing instructions — not memory, not agent instructions, and not retrieved knowledge. They apply to every conversation until you change them.
| Field | Type | Default | Description |
|---|---|---|---|
aiCustomInstructionsEnabled | boolean | false | Master switch. When false, no custom-instruction text is added to any prompt, even if values are stored. |
aiCustomInstructions | object | null | null | Structured instruction object, or null when unset. |
aiCustomInstructions.aboutUser | string | null | null | Stable context about you that Chao should keep in mind. |
aiCustomInstructions.responsePreferences | string | null | null | How you want Chao to communicate — length, format, tone, workflow. |
Limits
| Rule | Value |
|---|---|
| Per field | 2,000 characters |
| Both fields combined | 4,000 characters |
| Allowed control characters | newline and tab only |
Characters are counted as Unicode code points, not UTF-16 code units. An emoji such as 😀 counts as one character even though many programming languages report its length as 2. If you are validating input in a client before submitting, count with a code-point-aware method or you will reject text this API accepts.
Values are normalized before the limit is applied: Unicode is converted to NFC, \r\n and \r become \n, and leading and trailing whitespace is trimmed. Interior whitespace, Markdown, code blocks, and non-Latin scripts are preserved exactly as written.
The two fields together may not exceed 4,000 characters.
Update semantics
aiCustomInstructions merges at the subfield level. Omitting a subfield preserves it; sending explicit null clears it.
| Request body | Result |
|---|---|
aiCustomInstructions omitted | Stored value unchanged |
"aiCustomInstructions": null | Both fields cleared |
{"aboutUser": "..."} | aboutUser updated, responsePreferences preserved |
{"aboutUser": null} | aboutUser cleared, responsePreferences preserved |
| Both fields empty or null | Whole object stored as null |
Edits take effect on your next message. There is no cache delay to wait out.
How Chao treats them
Chao follows your Custom Instructions wherever they do not conflict with platform rules and safety policies.
In practice this means instructions like these work as expected:
Call me Alex.Prefer concise answers unless I ask for depth.I am a computer engineer; skip basic programming explanations.Use tables when comparing alternatives.
Instructions that attempt to override platform behavior are ignored for the conflicting part only — the rest of what you wrote still applies. Custom Instructions cannot rename Chao, disable tool approval, or grant capabilities your plan does not include.
Example
curl -X PATCH https://api.chainabit.com/api/v1/preferences \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"aiCustomInstructionsEnabled": true,
"aiCustomInstructions": {
"aboutUser": "I am a computer engineer working mostly in TypeScript.",
"responsePreferences": "Be concise. Use tables for comparisons."
}
}'Turning the feature off without discarding what you wrote:
curl -X PATCH https://api.chainabit.com/api/v1/preferences \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "aiCustomInstructionsEnabled": false }'Privacy
Instruction text is never written to application logs, metrics labels, or analytics events. Instructions are scoped to your account and are never visible to other users.
AI Message Suggestion Preferences
Chainabit also stores two AI-session continuation preferences on the identity profile:
| Field | Type | Default | Description |
|---|---|---|---|
aiMessageSuggestionsEnabled | boolean | true | When true, completed assistant messages may include structured follow-up suggestion cards. |
aiMessageSuggestionCount | integer | 3 | Number of suggestion cards to generate per completed assistant message. Allowed range: 2–4. |
When aiMessageSuggestionsEnabled is false, assistant messages return suggestions: [] and no message.suggestions SSE event is emitted with cards for that message.
Example Patch
curl -X PATCH https://api.chainabit.com/api/v1/preferences \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"aiMessageSuggestionsEnabled": true,
"aiMessageSuggestionCount": 4
}'Base Path
https://api.chainabit.com/api/v1/preferencesAuthentication
All Preferences endpoints require a valid JWT Bearer token.
Set up authentication and the shared environment in Prerequisites.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /preferences | Get user preferences | JWT |
| PATCH | /preferences | Update user preferences | JWT |
| GET | /preferences/settings | List settings, or account defaults for the CLI and Nexus | JWT |
| PATCH | /preferences/settings/{settingId} | Change or clear one setting | JWT |
GET /preferences
Description
Retrieve the current user's full preference object.
Authentication: JWT Bearer token required. Rate limit: 60 requests per minute.
Request
No request body. No path or query parameters.
Response
{
"data": {
"emailNotifications": true,
"pushNotifications": true,
"friendActivityAlerts": true,
"aiCoachingReminders": true,
"countryCode": "TR",
"languageCode": "en",
"discoverableByEmail": false,
"allowAiTraining": false,
"aiMemoryEnabled": true,
"aiMessageSuggestionsEnabled": true,
"aiMessageSuggestionCount": 3,
"aiCustomInstructionsEnabled": true,
"aiCustomInstructions": {
"aboutUser": "I am a computer engineer working mostly in TypeScript.",
"responsePreferences": "Be concise. Use tables for comparisons."
},
"aiPersona": "supportive",
"preferredAiProvider": "google",
"chainViewMode": "snake",
"bitViewMode": "kanban",
"keyboardShortcutsEnabled": true,
"notificationDigestFrequency": "daily",
"notificationFrequencyMode": "balanced",
"quietHours": {},
"timezone": "Europe/Istanbul",
"useLatestSessions": true,
"hideTitles": false,
"updatedAt": "2026-03-17T10:00:00.000Z"
},
"meta": null,
"error": null
}Response Fields
| Field | Type | Description |
|---|---|---|
emailNotifications | boolean | Email notifications enabled |
pushNotifications | boolean | Push notifications enabled |
friendActivityAlerts | boolean | Notifications for friend activity enabled |
aiCoachingReminders | boolean | AI coaching reminder notifications enabled |
countryCode | string | ISO country code (max 2 characters) |
languageCode | string | Display language code (max 10 characters) |
discoverableByEmail | boolean | Whether the account can be found by email lookup |
allowAiTraining | boolean | Whether user content may be used for AI training |
aiMemoryEnabled | boolean | Whether the AI may persist memory across sessions |
aiMessageSuggestionsEnabled | boolean | Follow-up suggestion cards enabled |
aiMessageSuggestionCount | integer | Number of suggestion cards per message (2–4) |
aiCustomInstructionsEnabled | boolean | Whether Custom Instructions are applied to prompts |
aiCustomInstructions | object | null | { aboutUser, responsePreferences }, or null when unset |
aiPersona | string | AI persona; see AiPersona values |
preferredAiProvider | string | google, openai, anthropic, or mistral |
chainViewMode | string | See ChainViewMode values |
bitViewMode | string | See BitViewMode values |
keyboardShortcutsEnabled | boolean | Keyboard shortcuts enabled in the web app |
notificationDigestFrequency | string | realtime, daily, or weekly |
notificationFrequencyMode | string | minimal, balanced, or frequent |
quietHours | object | Freeform quiet-hours configuration |
timezone | string | IANA timezone string (max 64 characters) |
useLatestSessions | boolean | Whether the UI resumes the most recent AI session by default |
hideTitles | boolean | Whether titles are hidden in list views |
updatedAt | string | ISO 8601 timestamp of last update |
Code Examples
curl https://api.chainabit.com/api/v1/preferences \
-H "Authorization: Bearer $TOKEN"PATCH /preferences
Description
Update one or more preference fields. Only the fields included in the request body are updated; all other fields remain unchanged (partial update). The request body is validated with a strict allowlist — any field not in the schema below (for example a legacy theme or nested notifications field) is rejected with 400 Bad Request (property theme should not exist).
Authentication: JWT Bearer token required. Rate limit: 30 requests per minute.
Request
All fields are optional. Only include the fields you want to change.
| Field | Type | Constraints | Description |
|---|---|---|---|
emailNotifications | boolean | — | Enable email notifications |
pushNotifications | boolean | — | Enable push notifications |
friendActivityAlerts | boolean | — | Enable friend activity notifications |
aiCoachingReminders | boolean | — | Enable AI coaching reminder notifications |
countryCode | string | max length 2 | ISO country code |
languageCode | string | max length 10 | Display language code |
discoverableByEmail | boolean | — | Allow lookup of this account by email |
allowAiTraining | boolean | — | Allow user content to be used for AI training |
aiMemoryEnabled | boolean | — | Allow the AI to persist memory across sessions |
aiMessageSuggestionsEnabled | boolean | — | Enable follow-up suggestion cards |
aiMessageSuggestionCount | integer | 2–4 | Number of suggestion cards per message |
aiCustomInstructionsEnabled | boolean | — | Master switch for Custom Instructions |
aiCustomInstructions | object | null | 2,000 characters per field, 4,000 combined | Structured account-wide instructions. Merges at the subfield level; explicit null clears. See Custom Instructions |
aiPersona | string (enum) | see AiPersona values | AI persona |
chainViewMode | string (enum) | see ChainViewMode values | The legacy value sneak is still accepted and silently mapped to snake for backward compatibility with old clients |
bitViewMode | string (enum) | see BitViewMode values | Default task view |
keyboardShortcutsEnabled | boolean | — | Enable keyboard shortcuts |
notificationDigestFrequency | string (enum) | realtime, daily, weekly | Digest email frequency |
notificationFrequencyMode | string (enum) | minimal, balanced, frequent | minimal suppresses normal-priority reminders; frequent sends all |
quietHours | object | freeform | Quiet-hours configuration |
timezone | string | max length 64 | IANA timezone, e.g. Europe/Istanbul |
useLatestSessions | boolean | — | Resume the most recent AI session by default |
AiPersona values
supportive, motivational, analytical, challenger, strategist, stoic, witty, socratic, pragmatist, ruthless
ChainViewMode values
consistency, puzzle, snake, sheet, voxel
BitViewMode values
matrix, kanban, calendar, gantt, tree, singularity
Response
{
"data": {
"emailNotifications": true,
"pushNotifications": true,
"friendActivityAlerts": true,
"aiCoachingReminders": false,
"countryCode": "TR",
"languageCode": "en",
"discoverableByEmail": false,
"allowAiTraining": false,
"aiMemoryEnabled": true,
"aiMessageSuggestionsEnabled": true,
"aiMessageSuggestionCount": 3,
"aiPersona": "analytical",
"preferredAiProvider": "google",
"chainViewMode": "snake",
"bitViewMode": "kanban",
"keyboardShortcutsEnabled": true,
"notificationDigestFrequency": "weekly",
"notificationFrequencyMode": "minimal",
"quietHours": {},
"timezone": "Europe/Istanbul",
"useLatestSessions": true,
"hideTitles": false,
"updatedAt": "2026-03-17T11:00:00.000Z"
},
"meta": null,
"error": null
}Response Fields
Returns the full updated preferences object. See GET /preferences for the complete field reference.
Code Examples
curl -X PATCH https://api.chainabit.com/api/v1/preferences \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"aiCoachingReminders": false,
"aiPersona": "analytical",
"notificationDigestFrequency": "weekly",
"notificationFrequencyMode": "minimal"
}'Settings catalog and account defaults
The settings catalog lists individual settings with their current value, so a client can read or change one setting without sending the whole preferences object. It also carries the account defaults for the Chainabit CLI and Nexus: values you set once for your account and that each device reads when it starts.
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /preferences/settings | List settings, or the account defaults of one or both products | JWT |
| PATCH | /preferences/settings/{settingId} | Change or clear one setting | JWT |
GET /preferences/settings
Request
| Query parameter | Description |
|---|---|
namespace | Optional. cli, nexus or both (cli,nexus, or repeat the parameter). Without it the response lists the ordinary settings, exactly as it always has. With it the response lists the account defaults of those products instead of the ordinary settings. Any other value returns 400 Bad Request with setting_namespace_invalid. |
Response
{
"data": [
{
"id": "cli.defaults.permissionMode",
"scope": "subject",
"value": "plan",
"source": "explicit",
"kind": "enum",
"allowed": ["plan", "approval", "auto"],
"mutationClass": "ordinary",
"reversible": true,
"clearable": true,
"canRestore": true,
"editable": true
},
{
"id": "cli.defaults.model",
"scope": "subject",
"value": null,
"source": "not_materialized",
"kind": "string",
"allowed": null,
"mutationClass": "ordinary",
"reversible": true,
"clearable": true,
"canRestore": true,
"editable": true
}
]
}| Field | Type | Description |
|---|---|---|
id | string | The setting's identifier, used in the PATCH path. |
scope | string | Whose setting it is. Account defaults belong to the signed-in person (subject). |
value | any | The current value. null means no value is set: for an account default, devices keep their own value. |
source | string | explicit when a value is stored, not_materialized when none is. |
kind | string | boolean, string, number or enum. |
allowed | array | null | The complete set of accepted values for an enum, otherwise null. |
mutationClass | string | ordinary, or regulated for settings that govern how your data is used or disclosed. |
reversible | boolean | Whether a change can be undone. |
clearable | boolean | Whether PATCH with {"value": null} clears it. |
canRestore | boolean | Whether a cleared value can fall back to its default. |
editable | boolean | Whether this credential may change it. A credential that can only read account defaults sees false. |
The response carries a weak ETag. Send it back as If-None-Match and an unchanged catalog answers 304 Not Modified without a body.
Account defaults
| Setting | Values | Meaning |
|---|---|---|
cli.defaults.permissionMode | plan, approval, auto | Permission mode of new CLI conversations. |
cli.defaults.model | a model identifier | The model Chao answers with; when not set, Chao chooses. |
cli.defaults.reasoning | basic, thinking, pro | How much Chao thinks before answering. |
cli.defaults.conversationSync | local, mirror | Where new conversations are kept; mirror also keeps them on web and mobile. |
cli.terminal.showSuggestions, cli.terminal.showTips, cli.terminal.feedbackQuestions, cli.terminal.reducedMotion | boolean | Terminal behavior. |
cli.terminal.color | auto, never | Colour in the terminal. |
cli.terminal.toolToggleKey | ctrl+o, ctrl+t | The key that opens and closes a tool card's details. |
nexus.agents.defaultAutonomy | plan, plan_collect, approval, auto | Autonomy of new Nexus agents. Existing agents keep theirs. |
nexus.updates.autoDownload | boolean | Whether Nexus downloads updates in the background. |
An account default is a default, never a command. A value set on the device itself wins. A device decides for itself whether a value loosens its own safety: Auto approve for the CLI, Mirror sync and Auto for new Nexus agents wait for the person's approval on each device, while Plan and Ask apply as soon as they arrive. No account default can loosen a device's safety boundaries or give consent on your behalf. Account defaults are not available to Chao or to MCP clients, and they can only be written from a signed-in interactive session.
PATCH /preferences/settings/
Request
| Header | Description |
|---|---|
Idempotency-Key | Required. A unique key per change, such as a UUID v4. Without it the request fails with 428 and missing_idempotency_key. Replaying the same key with the same body returns the original response; the same key with a different body returns 409 and idempotency_key_reused_with_different_payload. See Use idempotency keys. |
| Body field | Type | Description |
|---|---|---|
value | any | The new value, valid for the setting's kind and allowed set. null clears the value where clearable is true. |
Response
{ "data": { "applied": true } }| Status | Code | Meaning |
|---|---|---|
400 | setting_mutation_refused | The value is not valid for the setting (details.outcome is INVALID). |
403 | setting_mutation_refused | This credential may not change the setting. |
404 | setting_not_supported | No such setting. |
409 | idempotency_key_reused_with_different_payload | The key was already used for a different request. |
428 | missing_idempotency_key | The Idempotency-Key header is missing. |
Code Examples
# Read the account defaults of the CLI
curl https://api.chainabit.com/api/v1/preferences/settings?namespace=cli \
-H "Authorization: Bearer $TOKEN"# Set the default permission mode for new CLI conversations
curl -X PATCH https://api.chainabit.com/api/v1/preferences/settings/cli.defaults.permissionMode \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"value": "plan"}'# Clear it again
curl -X PATCH https://api.chainabit.com/api/v1/preferences/settings/cli.defaults.permissionMode \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"value": null}'You can also manage account defaults in the web app at chainabit.com/dev. See CLI configuration and Nexus account defaults.
Notes
- Partial Updates: The
PATCHendpoint only updates the fields included in the request body; all other fields are left unchanged. Flat fields are set directly on the preferences record.aiCustomInstructionsis the one field that merges: omitting a subfield preserves its stored value, and sending explicitnullclears it. See Update semantics. - Strict Validation: The request body is validated against an allowlist. Sending any field that isn't part of the request schema on this page (for example a legacy
themefield or a nestednotificationsobject) returns400 Bad Requestwith a message likeproperty theme should not exist. This is intended behavior, not a bug — always check this page for the current field list rather than relying on older integration code. - Defaults: New users receive a default preference set. The GET endpoint always returns the full preference object.
chainViewModeLegacy Alias: The old valuesneakis still accepted onPATCHand is silently mapped tosnakefor backward compatibility with older clients;GETalways returns the current value (snake).preferredAiProviderEntitlement Gating: Which providers you can select depends on your plan. If your plan does not include the requested provider, the stored preference is left unchanged rather than returning an error.- Validation: Invalid values (e.g., an unsupported enum value, an out-of-range
aiMessageSuggestionCount, or acountryCode/languageCode/timezonethat exceeds its max length) return400 Bad Requestwith a validation error. - Custom Instruction Validation: Instruction text that exceeds 2,000 characters in a field, exceeds 4,000 combined, or contains control characters other than newline and tab returns
400 Bad Request. BecausePATCHis validated as a whole, a rejected instruction field also rejects every other field in the same request — validate instruction length client-side before submitting rather than relying on the round trip. - Side Effects: Changing
timezoneaffects how scheduled chain reminders are calculated. Changes take effect on the next scheduled event.