Skip to content

Account (my) API

The account API exposes the per-user /me/* endpoints. Every endpoint is scoped to the calling user and requires an authenticated admin session.

Server faults. A failed database read on any /me/* endpoint answers 503 { "error": "temporarily unavailable; retry later" } (retry). A failed write — or any other server fault — answers 500 { "error": "internal error", "request_id": "…" } unless nothing was written (then the same 503): the cause is logged under that request id and the database's error text is never returned. See Storage faults.

While impersonating ("View as User"), the personal /me/* endpoints are refused with 403 impersonation_forbidden — PII keywords, the data export, personal tokens, device tokens, and DELETE /me / /me/erase are not readable or actionable act-as. GET /me/roles, GET /me/groups and GET /me/admins remain available (role/access context for support). GET /admin/auth/me masks the target's personal fields (email masked, name/instructions omitted). See Admin impersonation.


Listing personal PII keywords

GET /admin/v1/me/pii-keywords

Returns the calling user's personal PII keyword blacklist as an array (empty when none are set). Each row carries the keyword and its match flags. Returns 401 when unauthenticated, 503 (retryable) when the list cannot be read.


Adding a personal PII keyword

POST /admin/v1/me/pii-keywords

Field Type Required Default
keyword string yes —
case_sensitive boolean no false
whole_word boolean no false

The keyword is the text to mask. It is trimmed of surrounding ASCII whitespace and stored as typed. It may contain an internal ASCII space (e.g. Project X), any visible ASCII punctuation (O'Brien, +49 89 1234, a,b/c) and visible letters or symbols of any script. This is a deliberately looser contract than the bulk endpoint below, because a name or phrase often needs a space or an apostrophe. It is safe because every keyword is matched as literal text, never as a regular expression or pattern: a keyword .* masks only the two characters .*, and secret|password masks only that exact string. A keyword stored before this validation existed is matched the same way.

Rejected — 400, nothing is stored. The checks run in this order, and the first failure answers with its code:

Input code
The body is not valid JSON, or not valid UTF-8 malformed_body
The body is valid JSON but not an object (an array, a string, a number, null) malformed_body
case_sensitive or whole_word has a value other than those listed below invalid_flag
No body, or no keyword field keyword_required
keyword is null, a number, a boolean, an array or an object keyword_not_string
keyword is empty or only whitespace empty
keyword is longer than 200 bytes after trimming too_long
keyword contains a control character (U+0000–U+001F, including tab and line breaks, or U+007F) control_chars
keyword contains an invisible / zero-width / bidirectional / format / non-ASCII-space codepoint — for example a zero-width space (U+200B), soft hyphen (U+00AD), byte-order mark (U+FEFF), right-to-left override (U+202E), line/paragraph separator (U+2028/U+2029), no-break space (U+00A0) or a variation selector unicode_forbidden

An absent keyword (keyword_required) and a keyword that is present with the wrong type (keyword_not_string) are separate answers. An invisible codepoint is rejected because it is invisible in the input but turns the keyword into a match text that never fires against real text. Zero-width joiners (U+200C/U+200D) and emoji variation selectors (U+FE0F) are rejected on both this and the bulk path, so this endpoint does not accept a keyword that depends on an intra-word joiner or a VS16 emoji sequence. The bulk endpoint additionally rejects ASCII spaces and most punctuation.

Match flags. case_sensitive and whole_word accept true / false, the integers 1 / 0 and the strings "1" / "0". A missing flag or null means false. Numbers are compared by value, so 1.0 counts as 1. Any other value (for example "yes", 2 or an object) is rejected with 400, code invalid_flag, before the keyword or the list is checked. The bulk and file-upload endpoints below use the same flag rules. Posting a keyword that is already on the list updates that entry's flags to the values sent, so omitting a flag resets it to false.

The response is 201 Created with the stored row (case_sensitive and whole_word echoed back as 0 or 1). Other answers:

  • 429, code cap, when the per-user limit (200 keywords) is reached;
  • 401 when unauthenticated;
  • 503 (retryable) when the existing list cannot be read;
  • 500 when the insert fails.

The human-readable error text is informational. Branch on code.


Adding a list of personal PII keywords (bulk)

POST /admin/v1/me/pii-keywords/batch

Adds several keywords at once from a pasted list (one word per line) to the caller's own blacklist. Tenant-admin only: the caller needs the permission TENANT_SETTINGS_MANAGE (by default held by the admin and tenant_admin roles); without it the answer is 403, an unauthenticated caller gets 401. This is a product restriction on the bulk affordance, not a privacy boundary: the single-word POST above remains available to every user. This paste endpoint takes text only (no file), so it carries no malware byte-vector and is not antivirus-scanned; the sibling file-upload endpoint below accepts a .txt file and is scanned when malware scanning is enabled (see below).

Field Type Required Default
text string yes —
case_sensitive boolean no false
whole_word boolean no false

text is split into lines (\n, \r\n, or \r); blank lines are ignored; each remaining line is trimmed of surrounding ASCII whitespace and validated as a strict bare word. The case_sensitive / whole_word flags apply to every word in the batch and follow the same rules as on the single endpoint above: true/false, 1/0 or "1"/"0", with missing or null meaning false. Any other value is rejected with 400, code invalid_flag, before the list is read.

Accepted — a bare word of Unicode letters/digits of any script (e.g. Müller, 北京, José) plus the punctuation @ . - _. Examples: ProjectAtlas, jane.doe@acme.com, Anne-Marie, user_name.

Rejected — the whole batch is refused and nothing is stored when:

  • a match flag has an unsupported value (400, code invalid_flag);
  • there is no request body, or text is missing/not a string (400, code invalid_body);
  • text exceeds the size ceiling (400, code too_large);
  • text is not valid UTF-8 (400, code bad_utf8);
  • there are no non-blank lines (400, code empty);
  • there are more than 20 lines (400, code too_many, with max: 20);
  • any line is not a bare word (400, code invalid_words, with an invalid array of { line, reason }). The array lists every refused line and the whole list is refused: nothing is stored, including the valid lines. A line is rejected when it is too long (> 200 bytes, reason too_long), contains an internal ASCII space (reason space), contains a control character — C0 including tab and NUL, or DEL (reason control_chars), contains any other ASCII character outside letters, digits and @ . - _ such as a regex or shell metacharacter (reason metachar; the first offending character, left to right, decides the reason), contains Unicode whitespace, a zero-width/bidi/format character, or a character from the Unicode General Punctuation, Supplemental Punctuation or CJK Symbols and Punctuation blocks such as an em dash — or … (reason unicode_forbidden; other visible non-ASCII characters, e.g. € or an emoji, count as part of a word), or contains no letter or digit at all (reason no_word_char, e.g. ... / @);
  • adding the new words would exceed the per-user limit of 200 keywords (429, code cap).

On success the response is 201 Created with { "added": [ …stored rows… ], "count": N }. Words already on the caller's list (or duplicated within the paste) are skipped — they do not create duplicates and their existing match flags are left unchanged; a batch in which every word already exists returns 200 OK with { "added": [], "count": 0 }. The insert is atomic: a storage fault (500) rolls the whole batch back rather than leaving a partial list. If the existing list cannot be read, nothing is inserted and the answer is 503 (retryable).


Uploading a list of personal PII keywords (file)

POST /admin/v1/me/pii-keywords/upload

The file counterpart of the bulk paste above: upload a plain-text (.txt) list of keywords, one per line. Same tenant-admin-only gate (403/401) and the same per-line bare-word validation, dedup, 200-nothing-added / 201-created / 429-cap / 500-rollback semantics as the paste endpoint (a single shared pipeline — the two paths can never drift). The difference is the input: an uploaded file carries a malware byte-vector a paste cannot, so the raw bytes are type-checked always and antivirus-scanned when malware scanning is enabled before they are parsed.

Field Type Required Default
data string yes — (the file bytes, base64-encoded)
filename string no list.txt
case_sensitive boolean no false
whole_word boolean no false

The uploaded bytes are untrusted and validated at the trust boundary, in this order — each step fails closed, nothing is stored until all pass:

  1. Shape/size — a match flag with an unsupported value is rejected first (400, code invalid_flag, before any decoding or scanning); data must be a string (absent, null or a non-string is 400, code invalid_body); an empty file — data is "" or decodes to no bytes — is 400 (empty); data that is not valid base64 is 400 (bad_base64); a file over the small list ceiling is 400 (too_large).
  2. Malware scan (only when enabled) — malware scanning is opt-in per gateway and off by default (a gateway enables it with av_scan.enabled in its config). A personal keyword list has no single gateway, so it is scanned when your tenant has malware scanning enabled on any of its gateways; otherwise this step is skipped and the list is parsed normally. When it applies, the raw bytes are streamed to a self-hosted ClamAV daemon (clamd). An infected verdict is rejected with 422, code malware_detected ("This file was blocked by malware scanning."; the signature is logged operator-side only, never returned). If clamd is unreachable/errors, the upload is rejected, not accepted unscanned: 503, code scan_unavailable, with a short Retry-After. The virus scanner itself is configured for your deployment by Myra and is consulted only when a gateway/tenant has opted in. The enablement read is fail-closed too: if it cannot be determined whether scanning applies (your tenant's gateway list is unreadable, or one of its gateway configs will not decode) the upload is refused with 503, code scan_unavailable (+ Retry-After), never accepted unscanned. An account with no tenant at all (a platform admin's normal shape, or a tenantless user — the rule is role-independent) owns no gateway, so no gateway can have opted in — that caller's list is knowably not scanned and uploads normally; a tenant id that is present but empty is a malformed account and refuses (503).
  3. Type allow-list — the file's real type is verified from its magic bytes; it must be text/plain. A file whose bytes are a PDF/image/Office document (even if named .txt) is rejected 415, code not_text.
  4. Bulk validation — the text is then split, validated, deduped, capped and inserted exactly as the paste endpoint above (same 400/429/201/200/500/503 outcomes and codes).

Deleting a personal PII keyword

DELETE /admin/v1/me/pii-keywords/<ID>

Deletes the keyword by id, scoped to the caller's own rows. The response is 204 No Content. Returns 401 when unauthenticated, 500 on a storage failure.


Listing personal tokens

GET /admin/v1/me/tokens

Returns 200 with the personal authentication tokens of the calling user. The token value is never returned by the list endpoint; only metadata. scopes is returned as an array and rate_limit as an object or null. Each row also carries spent_usd_micro, the token's spend in the current budget period in micro-USD (0 when nothing was spent); the field is absent when the spend could not be read, which means "unknown", not 0. A failed read of the list answers 503.

The list does not include the short-lived session tokens the web app creates on its own for Chat, voice, the Playground, an agent's Try it tab and the workflow assistant: tokens whose label is exactly playground and that carry an expiry. They need no management from you and are still valid until they expire. A token labelled playground without an expiry is listed like any other token. A session token can still be revoked by its ID with DELETE /admin/v1/me/tokens/<ID>; administrators see them in GET /admin/v1/users/{id}/tokens.


Creating a personal token

POST /admin/v1/me/tokens

Step-up-gated, after the label, gateway, self-mint and lifetime checks and right before the token is created, so a refused request spends no step-up token: the body may carry the optional step_up_token (a verified step-up token). For a caller on password and second-factor sign-in, the server answers 403 step_up_required without it and the SPA asks for the second factor, then sends the request once more with the token. Other callers (SSO, Google, Microsoft, demo) need not send it and the field is ignored.

Field Type Required Default
gateway_id string yes —
label string no —
scopes array no ["inference"]
expires_at unix seconds no unset (token never expires)
budget_usd number no unset (no cap)
rate_limit { requests, window_sec } no unset — validated like every other token route: only those two keys, each a whole number ≥ 1; anything else is HTTP 400 (see Users & Tokens)

Who may mint. Only chat-capable roles — member, ki_manager, tenant_admin, and admin — can create a personal token. A viewer (read-only) or the shared demouser identity is refused with HTTP 403 at the endpoint itself, not merely hidden in the UI; the check is enforced server-side before any token is generated. gateway_id must be a gateway of the caller's own workspace — platform administrators included: absent → 400 gateway_id_required, malformed → 400 gateway_id_invalid, unknown, or (for a tenant-scoped caller or any non-administrator account without a workspace) another workspace's gateway → 404 { "error": "not found" } (indistinguishable, see error-codes); a platform administrator naming a gateway outside their own workspace, or having no workspace, → 403 gateway_outside_owner_tenant. See A token lives in its owner's own workspace. An unauthenticated request returns HTTP 401.

expires_at must be a whole unix timestamp in seconds that is in the future and within 100 years. A value that is non-numeric (for example an ISO-8601 date string), fractional, in the past, or implausibly far in the future (such as a milliseconds timestamp) is rejected with HTTP 400 — never applied. Leaving it unset makes the token non-expiring (the recommended default — a token that never lapses cannot die silently). When an expiry is set, the owner is warned in-app (expiring_tokens on GET /admin/auth/me) and by email 7 days before it lapses; a gateway service token (no user owner) warns the tenant-admins instead — see Agents → Proactive token pre-expiry warning.

The response is 201 { "id": "<TOKEN_ID>", "token": "myra_<HEX64>", "gateway_id": "<GATEWAY_ID>" }. Minting is refused while impersonating. A transient database fault with nothing stored answers 503 { "error": "temporarily unavailable; retry later" } with a Retry-After header (mint again); any other storage fault is the sanitised 500 with a request_id. An invalid label, scopes, rate_limit, budget_usd or expires_at answers 400 with code: "invalid_field" and field naming the key. See Typed codes on feedback, memories, preferences and profile routes for the other refusal codes of these routes. The token value is shown once; the gateway never returns it again.


Revoking a personal token

DELETE /admin/v1/me/tokens/<ID>

Returns 200 { "ok": true } on success and 403 { "error": "forbidden", "code": "token_not_accessible" } when the token does not belong to the caller (including a token that is already revoked). 404 { "error": "token not found", "code": "token_not_found" } is possible only when the token is revoked concurrently. If the caller's token list cannot be read the answer is 503. Revocation invalidates the cached auth lookup and deletes the row immediately.


Connect-OX handshake (mint a token for the Open-Xchange plugin)

POST /admin/v1/me/connect/ox

The zero-config token handout behind the Open-Xchange "Connect" button. The plugin opens the authenticated SPA page /connect/ox?origin=<exact OX origin>&nonce=<opaque> in a popup; the signed-in user picks a gateway + model and confirms, and this endpoint mints an inference-scoped token for the plugin to call the gateway with. It is a thin wrapper over Creating a personal token that removes every dangerous knob — the client can only supply a gateway, a model hint, and the origin.

Field Type Required Accepted / Rejected
origin string yes The exact browser Origin of the calling OX site. Must be a canonical https origin (https://host[:port], lowercase scheme+host, no :443, no path/query/fragment/userinfo, ASCII host ≤ 200 chars) AND an exact member of the platform allow-list connect_ox_allowed_origins (see Settings). Absent, malformed, or not-listed → HTTP 403 origin_not_allowed. Membership is exact set-equality — a substring or prefix of an allowed origin is refused.
gateway_id string yes A gateway of the caller's own workspace (platform administrators included — the same gate as /me/tokens, see A token lives in its owner's own workspace). Absent / null → HTTP 400 gateway_id_required; non-string / empty / over 36 bytes → HTTP 400 gateway_id_invalid; unknown, another workspace's gateway, or (non-administrator) an account without a workspace → 404 (indistinguishable); a platform administrator outside their own workspace → 403 gateway_outside_owner_tenant. The consent page offers only the caller's own workspace's gateways.
model string yes A model-name hint echoed back to the plugin (slug shape ^[A-Za-z0-9._-]+$). Absent/non-string/bad-shape → HTTP 400 bad_model. It is not an authorization boundary — the minted token is gateway-scoped inference and any model the gateway serves is callable regardless of this value.

A missing request body answers 400 invalid body. The origin check runs first, before gateway_id and model. The endpoint ignores any other body field. In particular a smuggled scopes (e.g. [], which elsewhere means unrestricted) is never read — the scope is forced to ["inference"]. The token is also minted with a forced rate-limit (60 requests / 60 s, a leak cap) and no expiry. A caller is capped at 20 live Connect tokens (labelled OX Connect · <origin> · <date>, self-revocable in Profile → Tokens); the 21st request is refused with HTTP 409 too_many_connect_tokens — existing tokens are never auto-revoked. If the existing tokens cannot be counted (a database fault) the mint is refused with 503 { "error": "temporarily unavailable; retry later" } — the cap never fails open.

Who may mint. Same as /me/tokens: member, ki_manager, tenant_admin, admin. A viewer or demouser → HTTP 403; unauthenticated → HTTP 401; minting while impersonating is blocked. Each successful mint writes one token.minted audit_log row (route connect_ox, actor, gateway, origin — never the token). When the tenant has switched off self_mint_tokens the route answers HTTP 403 self_mint_disabled; the token expires after the tenant's token_max_lifetime_days, or does not expire when the tenant has no cap (see Token lifetime policy).

Response 201 { "tenant": "<slug>", "gateway": "<slug>", "model": "<hint>", "token": "myra_<HEX64>" }. A transient database fault with nothing stored answers 503 { "error": "temporarily unavailable; retry later" } with a Retry-After header (mint again); any other storage fault is the sanitised 500 with a request_id. The token is shown once, hashed at rest, and never logged. The SPA hands it to the opener via postMessage to the exact origin only (never "*"); see Authentication → Connect-OX popup.


Registering a device push token

POST /admin/v1/me/device-token

Field Type Required Default
token string yes —
platform string no ios

The endpoint is upsert: posting again with the same token updates the row. The response is 200 { "ok": true }. Refused while impersonating. The iOS and Android apps post their token after each sign-in and each signed-in start (Android: once notifications are allowed); a browser never registers one. Disabling the account, an email change (by an admin or SCIM), a SCIM deprovision, deleting or moving the user, and deleting the workspace together with its users remove all of the user's registrations, together with the device sign-ins; after the next sign-in the app registers again.

Accepted: token is 1–200 bytes of A-Z a-z 0-9 : _ - (APNs hex and FCM id:APA91b… tokens both fit); platform is exactly ios or android, or absent (= ios).

Rejected (400, nothing stored): token absent, null or "" → { "error": "token required", "code": "token_required" }; token present but not a string, longer than 200 bytes or with any other character → { "error": "invalid token", "code": "invalid_token" }; platform present but anything else — null, "web", "IOS", a number → { "error": "platform must be ios or android", "code": "invalid_platform" } (an absent platform and a malformed one never share an outcome).

Android app: the app's web page asks the native shell for the token through window.Android and gets the answer by a callback it names itself. getDeviceToken(cb) calls cb(token) with the token string, or cb(null) when there is none; requestNotificationPermission(cb) calls cb(true) or cb(false). cb must be __myraOnPushToken_<digits> for getDeviceToken and __myraOnNotifPerm_<digits> for requestNotificationPermission (digits only, at most 16); any other name, including the other method's name, is ignored without a reply. A reply is delivered only to the page that asked: if that page was replaced (a navigation or reload) or is no longer one of the app's own pages when the answer is ready, the reply is dropped and no callback runs. The reply travels on the asking page's own message channel, so it cannot reach a newer page even if that page has just replaced the asker. Internally the reply reaches the shell's own script as {"cb":<name>,"v":<value>}, and anything else on that channel is ignored. Each request gets at most one reply. A permission request made while the permission prompt is already open shows no second prompt and receives the same result as the first; up to 8 requests can wait at once, and any further request is answered false at once.

iOS app: the same request/reply contract, through window.webkit.messageHandlers.getDeviceToken.postMessage("__myraOnPushToken_<digits>") (digits only, at most 16; any other name or body is ignored without a reply). The shell answers by calling window[cb](token) with the APNs token string, or window[cb](null) when registration failed. The token is never pushed into a page unasked, and a request is answered only if it comes from the app's own top-level page on the app host (not a subframe, not another origin). A reply is delivered only to the page that asked: if that page was replaced (a navigation or reload) or is no longer one of the app's own pages when the answer is ready, the reply is dropped. When the token has not arrived yet, up to 8 requests wait for it and the 9th is answered null at once. Older app builds without the getDeviceToken handler still push the token (window.__myraApnsToken and the myra:apns-token event); the web app falls back to that when the handler is absent.


Unregistering a device push token

DELETE /admin/v1/me/device-token

Field Type Required
token string yes

The endpoint deletes a single device-token row matched by the token value and scoped to the authenticated caller — a user can only delete their own device token, never one registered by another user. The response is 200 { "ok": true }; a missing, null or empty token answers 400 { "error": "token required", "code": "token_required" } and a non-string token 400 invalid_token. The character set is not enforced on delete, so a token stored earlier can always be removed. A server fault answers 500 { "error": "internal error", "request_id": "…" } (the cause is logged, never returned).


Updating your profile

PATCH /admin/auth/me

Updates the calling user's own profile. While impersonating ("View as User") the endpoint answers 409 { "error": "not available while viewing as user" } and writes nothing. Every field is optional; only the keys present in the body are written, and the endpoint is scoped to the authenticated session user (a user can never patch another account). Each field is validated at the trust boundary — a value of the wrong type is rejected with 400 and nothing is written.

Field Accepted Rejected → 400
name non-empty string, trimmed, up to 255 characters (the account's identity name — distinct from preferred_name below) non-string (code invalid_name), trimmed-empty or with nothing visible (code name_required), over 255 characters, or not valid UTF-8 — unlike every other field on this endpoint, name has no clear semantics: it cannot be set to null/empty via this route
locale "en" | "de" | null any other value, including a non-string or a subtag such as "de-DE" → 400 { "error": "unsupported locale" } (no code)
preferred_name string up to 64 characters (trimmed of ASCII whitespace; empty → cleared) | null any non-string (number, boolean, object, array), over 64 characters, or not valid UTF-8 → 400 (nothing written)
work_category one of "Product Management", "Engineering", "HR", "Finance", "Marketing", "Sales", "Operations", "Data Science", "Design", "Legal", "Other" (trimmed; empty → cleared) | null any non-string (code invalid_work_category, formerly work_category_invalid), or any value not in the set → 400 { "error": "unsupported work_category" }
model_instructions string up to 5000 characters (trimmed; empty → cleared) | null any non-string, over 5000 characters, or not valid UTF-8 → 400 (nothing written)
default_model string up to 128 characters (the user's soft default chat model) | "" or null (both clear it → SQL NULL) any non-string (number, boolean, object, array), over 128 characters, or not valid UTF-8 → 400 (nothing written)
currency exactly "USD" or "EUR" (the display-currency preference) | null (clears it → SQL NULL, resolving to the EUR default) any other string, or any non-string (number, boolean, object, array) → 400 (nothing written)
dictation_language exactly one of "en", "de", "fr", "es", "it", "nl", "pl", "pt" (lowercase ISO 639-1 — the fixed dictation language) | null (clears it → SQL NULL = Automatic) any other string (including "", "EN", "en-US", "english"), or any non-string (number, boolean, object, array) → 400 with code: "invalid_dictation_language" (formerly dictation_language_invalid) (nothing written)
answer_units exactly "metric" or "imperial" (the unit system for answers) | null (clears it → SQL NULL = not set) any other string (including "", "Metric", " metric"), or any non-string (number, boolean, object, array) → 400 with code: "invalid_answer_units" (formerly answer_units_invalid) (nothing written)
answer_address_form exactly "sie" (formal) or "du" (informal) — the form of address in German answers | null (clears it) any other string (including "", "Sie", " du"), or any non-string → 400 with code: "invalid_answer_address_form" (formerly answer_address_form_invalid) (nothing written)
answer_region exactly one of "DE", "AT", "CH", "LI", "LU", "BE", "NL", "FR", "IT", "ES", "PT", "PL", "GB", "IE", "US" (uppercase ISO 3166-1 alpha-2) | null (clears it) any other string (including "", "de", "DEU", " DE"), or any non-string → 400 with code: "invalid_answer_region" (formerly answer_region_invalid) (nothing written)
chat_width exactly "standard" (900 px message column, the default) or "wide" (up to 90% of the chat area, at most 1600 px) any other string (including "", "Wide", " wide"), JSON null, or any non-string (number, boolean, object, array) → 400 with code: "invalid_chat_width" (formerly chat_width_invalid) (nothing written)
composer_enter_sends JSON boolean (true = Enter sends, false = Enter inserts a newline) any non-boolean (string, number, null)
onboarding_completed JSON boolean (true marks the first-run walkthrough done for this user) any non-boolean (string, number, null)
personalisation_tooltip_seen / style_conflict_note_dismissed true (one-shot UI flags; the server stores the current time) any other value is ignored — no write, no error
budget_alert_dismissed_sig a 32-character lowercase-hex string (the budget_alerts_sig value from GET /admin/auth/me) — dismisses the budget-alert banner for the current alert set any other shape (wrong length, non-hex, non-string) is ignored — no write, no error
favorite_models a JSON array of strings (each a "<provider> <model>" favorite key, at most 200 bytes), at most 500 entries, and at most 65,535 bytes once encoded as a JSON array (the storage column's size) — replaces the caller's favorite-model set wholesale. An empty array [] or null clears it not an array (object, string, number), any non-string element, a key over 200 bytes or not valid UTF-8, more than 500 entries, or an encoded set over 65,535 bytes → 400 (nothing written); a request body over 64 KiB is refused earlier with 413, see the PATCH /admin/auth/me body-size paragraph below

Length limits count characters. The limits on name, preferred_name, model_instructions and default_model are in characters (Unicode code points), not bytes — the unit the database columns use. A 64-character preferred_name in Persian, Greek or Chinese is accepted even though it is two or three times as many bytes. (The app's name and preferred_name input fields count UTF-16 units, so they are never looser than the API: an emoji outside the Basic Multilingual Plane counts twice there. The model_instructions field counts characters — code points, an emoji is 1 — like the API; the API's 400 stays the final check.) A wrong-type value (a number, boolean, object or array where a string is expected) is rejected with 400 and code invalid_<field> — it is never read as "clear"; only null or an empty string clears. A value that is not valid UTF-8 (a stray continuation byte, a truncated or overlong sequence, an encoded surrogate) is rejected with 400 and code invalid_<field>; it is never counted. A too-long value answers 400 with code <field>_too_long and the message <field> is too long (maximum <N> characters). favorite_models keys are model identifiers and are bounded in bytes. The same name rule (string, valid UTF-8, at most 255 characters) applies when an administrator invites or edits a user — see Users & tokens.

The request body of PATCH /admin/auth/me may be up to 64 KiB (other /admin/auth/ endpoints take 16 KiB), enough for a full 5000-character model_instructions of multi-byte text. A larger body is refused with 413 before any field is checked.

The budget-alert dismissal (budget_alert_dismissed_sig) records which alert set the user acknowledged, so the banner re-appears automatically when the set changes (a budget crosses into a higher tier, a different entity breaches, or a new budget period begins). It is a UI preference and, like the two one-shot flags, is not recorded in the Art. 16 rectification audit. A blocked (at/over 100 %) budget alert cannot be dismissed — except a member or department limit alert (scopes user, team; see below).

Member and department limit alerts (budget_alerts scopes user and team). For admins and tenant admins of the tenant only, GET /admin/auth/me returns one alert per live, enabled member (scope: "user", entity_id = the user id, label = the user's name, else e-mail, else id) whose spend this period is at least 80 % of the cap that applies to them, and one per department (scope: "team", entity_id = the department id, label = its name) at 80 % of its pooled budget_usd. The member cap is resolved exactly as the per-user budget guard enforces it (person → group → department → tenant default, the same period key); the department uses its budget_period and the same spend ledger as the department guard. tier is approaching (≥ 80 %, under the cap), reached (= the cap, requests refused) or exceeded (over it). A frozen cap (0), no cap, a trial workspace, a disabled or deleted member and a member of another workspace produce no alert. A malformed stored cap or spend (what the guard refuses as CONFIGURATION_ERROR) produces no alert and is logged — it is never shown as a made-up tier. A read fault omits that scope only. Both scopes are part of budget_alerts_sig; unlike the other scopes, a blocked member/department alert does not prevent dismissing the banner. While an operator impersonates, a user alert's label is the user id.

Seats alert (budget_alerts scope seats). GET /admin/auth/me returns, for admins and tenant admins of the tenant only, at most one alert with scope: "seats" and tier: "approaching" (non-blocking, dismissible). kind: "refused" carries count (total refused identities, live within the last 7 days) and refused[] (up to 50 entries of external_id, email, last_refused_at, newest first, unix seconds); kind: "usage" carries seat_used and seat_cap and appears at 95 % or more of the effective seat limit while no identity is listed. Members, other tenants' admins and an impersonating operator never receive refused[] (only the count). A read fault omits the alert. A new refusal changes the alert signature, so a dismissed alert re-appears.

composer_enter_sends controls the chat composer's Enter key for this user only: true (the default for every account) sends on Enter with Shift+Enter for a newline; false inverts it (Enter inserts a newline, Cmd/Ctrl+Enter sends). It is stored as a 0|1 column and returned by GET /admin/auth/me. As a UI preference it is not recorded in the Art. 16 rectification audit (see below).

onboarding_completed records whether the caller has finished (or skipped) the one-time first-run onboarding walkthrough. It is stored as a 0|1 column (existing accounts were backfilled to 1; a genuinely-new account starts at 0) and returned by GET /admin/auth/me. The SPA sets it to true when the user finishes or skips the walkthrough. Like the other UI flags it is scoped strictly to the session user — the identity comes from the session, never a body-supplied user id — and is not recorded in the Art. 16 rectification audit.

currency is the user's display-currency preference — "USD" or "EUR", returned by GET /admin/auth/me. It controls only how monetary figures (gateway/tenant/token budgets, spend, cost analytics) are displayed across the app; amounts are always stored and enforced in USD, and the SPA converts to the selected currency at the display boundary using the daily reference rate. When unset (NULL) the app defaults to EUR (Myra is EU-focused). It is fully independent of locale (the UI language) — a separate column and a separate selector under Settings › Preferences. As a UI preference it is scoped strictly to the session user and is not recorded in the Art. 16 rectification audit.

dictation_language is the user's fixed dictation language, returned by GET /admin/auth/me (absent when unset). When set, POST /admin/v1/chat/transcribe sends that language to the speech-to-text service on every attempt; when unset (NULL, Automatic — the default) the first attempt auto-detects the spoken language and only a retry after an empty result uses the request's language hint. The stored value is read from the session's own account, never from the request, and is re-checked against the allowlist when used (an unknown stored value counts as Automatic). As a UI preference it is scoped strictly to the session user and is not recorded in the Art. 16 rectification audit.

answer_units, answer_address_form and answer_region are the user's answer preferences, returned by GET /admin/auth/me (each absent when unset) and included in the personal data export. Only null clears one; an empty string is malformed and rejected with 400, never read as "clear", and an omitted key leaves the stored value unchanged. When one field in a request is invalid the whole request is rejected and nothing is written. The values come from fixed lists, so no free text is stored; they are used to personalise answers (units, German form of address, regional conventions). As UI preferences they are scoped strictly to the session user and are not recorded in the Art. 16 rectification audit.

chat_width is the user's reading width of the chat messages — "standard" (the default for every account) or "wide" — returned by GET /admin/auth/me and included in the personal data export. There is no third state: null is rejected rather than read as a reset. Only the web app reads it; the gateway never changes a response because of it. As a UI preference it is not recorded in the Art. 16 rectification audit.

limits (read-only, part of the GET /admin/auth/me payload) tells the web app the size limits it checks before it sends. It holds chat_upload_wire_bytes (the largest chat file upload body, in bytes), chat_upload_max_bytes (the largest raw chat file, in bytes; currently 110000000 — the web app falls back to this value when the field is absent or malformed), app_feedback_wire_bytes (the largest app-feedback body, in bytes), input_file_max_bytes (the largest raw file the code interpreter loads per file, in bytes; currently 8388608; the web app shows it in the private-chat data-file notice and shows a notice without a number when the field is absent or malformed), ghost_input_files_max_bytes (the most data, decoded, a private chat sends in the x-aig-ghost-files field of one turn, files already kept in the chat included, in bytes; currently 5000000), ghost_input_files_max_count (the most files a private chat sends in that field of one turn; currently 8), message_wire_bytes (the largest chat message write body, in bytes; 16 MiB, see Conversations), project_instructions_max_chars (the longest project instructions text, counted in characters — Unicode code points, not bytes; currently 40000) and agent_instructions_max_chars (the same for agent instructions; currently 40000, enforced on POST/PATCH …/agents as 400 instructions_too_long, see Agents). The web app reads the two ghost_input_files_* limits together: it attaches data files to a private-chat turn only while both are present and well-formed and the gateway can run code on the file (no PII masking), refuses an over-limit attach with a message naming the limit, blocks the send (text and files go back to the composer, with a message naming the files and the limit) when a data file staged before the chat became private is over the limit on such a gateway, and otherwise keeps the text-preview behaviour. The web app counts the project instructions against project_instructions_max_chars as you type and refuses an over-limit save with a message naming the excess; it has no built-in fallback, so when the field is absent it shows the count only. The gateway enforces the same limit on POST/PATCH /admin/v1/projects regardless (400 instructions_too_long, see Projects).

tenant_slug (read-only — part of the account payload that GET /admin/auth/me, the PATCH /admin/auth/me response and the one-time-code sign-in return; it cannot be set) is the identifier of the caller's own workspace: the slug the inference URL (/v1/<tenant>/<gateway>/…) and the gateway pickers use. It is returned for every account that belongs to a workspace, platform administrators included, and the web app shows it as Organisation on the profile page. It is absent for an account without a workspace and when the workspace could not be read (GET /admin/auth/me never fails because of it). It is not the white-label product name (brand_product_name). While impersonating it is omitted, like the other personal fields — a self-service workspace's identifier is derived from its owner's email address (see Admin impersonation).

tenant_block_message and tenant_ai_policy_url (read-only — part of the GET /admin/auth/me account payload) carry the workspace's block message and AI-policy link so the web app can show them in the policy-block bubble of a content-policy block (see Tenant block notice). Each is omitted when the workspace has not set it, when the account has no workspace, or when the stored value no longer passes the PATCH validation (it is re-checked on every read; the gateway logs a warning naming only the workspace). They are never settable here.

favorite_models is the user's set of favorite models — each key is a "<provider> <model>" pair (a model served by more than one provider is favorited per provider). The model selector pins favorites to the top of the list under a Favorites heading. The client sends the entire desired set on every change (it is not an incremental add/remove); the server validates the array shape, per-key length, and count at the trust boundary and stores it verbatim as a JSON array (empty or null clears it). GET /admin/auth/me always returns favorite_models as an array ([] when none; a stored value that is malformed or predates this field decodes to []). Like the other UI preferences it is not recorded in the Art. 16 rectification audit.

permissions is the caller's effective permission set — an array of permission-key strings (e.g. "USERS_MANAGE", "GATEWAYS_MANAGE"), sorted, [] for a role with none. It is the union of the permissions the caller's platform role confers and any tenant-defined custom roles assigned to them (dynamic RBAC). It is advisory only — the SPA uses it to show/hide nav entries and actions; it is never the authorization boundary. Every protected request is re-checked server-side against the same effective set, so a client that forges or replays a permission it does not hold is still rejected (403). Read-only; not settable via PATCH.

assignable_roles is the set of roles the caller may assign when creating a user — an array of role names derived from the same role-assignment matrix the server enforces on POST /tenants/{id}/users (sorted alphabetically, as the server emits them; a tenant_admin: finance, ki_manager, member, viewer; a platform admin: every role (admin, demouser, finance, ki_manager, member, tenant_admin, viewer); a member, viewer or any role that cannot assign: []). It is independent of permissions: a member whose custom role holds USERS_MANAGE sees the user roster but has assignable_roles: [], so the SPA hides the New User / Invite entry points and the create request would be refused 403 anyway. Advisory only — the server re-checks every create and role change. Read-only; not settable via PATCH.

Response semantics. On success the endpoint returns 200 with the same full account payload as GET /admin/auth/me. Three non-success cases matter to clients: the profile change and its Art. 16 audit entry are one transaction, so a transient database fault (or a refused write) returns 503 { "error": "temporarily unavailable" } with nothing stored and no saved key — retry; a transient fault on the re-read after the change committed returns 503 { "error": "profile saved; account refresh failed — reload to see your changes", "saved": true } — the change and its audit entry are stored: reload, do not re-submit (a re-submit writes a second audit row); a failure after the statements were sent returns 500 { "error": "update failed" } with nothing stored either (neither a half-applied profile nor an audit row without its change exists); and the account is re-read from the live row before anything is written: a session whose account has been deleted or disabled mid-session returns 401, clears the session cookie and writes nothing, mirroring GET /admin/auth/me, and an account whose live role is demouser, or that has no system role at all, gets 403. The session cookie is never cleared on a 503. The 500 text is fixed; the cause is logged, never returned.

name is the account's identity name shown throughout the app (nav, the account popover, "My Account"), distinct from preferred_name (a personalization-only field the model's system prompt uses — see above). Unlike every other field on this endpoint, submitting name always records a user.self_rectified audit entry, even when the value is unchanged — this endpoint does not diff against the prior value (see the Rectification logging section below). It is stored and returned via GET/PATCH /admin/auth/me's name key; an admin can also rename a different user via PATCH /admin/v1/users/{id} (a distinct, permission-gated endpoint — not covered here).

My access (roles & group membership)

GET /admin/v1/me/roles

Returns the calling user's own tenant custom-role grants ONLY (origin='user', scoped to their own tenant) — perms_store.list_user_custom_roles for the caller's own id. The caller's base system role (origin='system') is deliberately excluded: it is already reported by GET /admin/auth/me (role) and drives the "My access" page's platform-role card, so echoing it here made a user with no custom roles appear to hold their base role as a custom grant. Every returned row therefore has origin='user'. Session-authenticated only; no elevated permission required (self-access to your own grants needs none), and the route accepts no uid/user_id parameter — there is nothing for a client to point at another user's data. 200 with a (possibly empty) JSON array of { id, name, origin, description, perm_keys }; perm_keys is the array of permission keys the role grants (the same keys GET /admin/auth/me reports in permissions; perm_keys are sorted, and platform-level keys are never returned, so a role holding only such keys returns [], like a role without permissions). The My access page uses it only to attribute a right to the custom role that holds it — the rights themselves come from the permissions of GET /admin/auth/me, the set the server enforces. A database fault returns 503 { "error": "temporarily unavailable; retry later" } (retry).

GET /admin/v1/me/groups

Returns the calling user's own group/project memberships ({ group_id, name, source, joined_at }), same self-scoping and no-uid-param guarantee as above. 200 with a (possibly empty) JSON array. A database fault returns 503 { "error": "temporarily unavailable; retry later" } (retry).

GET /admin/v1/me/admins

Returns the display names of the people who administer the caller's own tenant (live tenant admins and system admins), for "ask your admin" hints (the chat's Who is my department admin? on a team_budget_exceeded refusal reads it as its fallback: when GET /admin/v1/limit-requests/route routes to nobody (kind: "fallback") or answers 409 no_department, 404 not_found or 403 impersonation_forbidden, the workspace administrators are the answer; any other route failure (another status or code) or a malformed route body is a failed read, never this list). 200 with a JSON array of { name }, oldest account first, at most 10; accounts without a display name are left out, and the array is empty when the caller has no tenant. Nothing else is returned: no email, id or role. Session-authenticated; 401 without a session; a database fault returns 503 { "error": "temporarily unavailable; retry later" } (retry). The client treats a body that is not a JSON array as a failed read ("could not be loaded"), never as "no administrator"; array entries without a non-blank string name are skipped.

These endpoints back the My access page (a role/permission explainer for the caller's own account) — they never expose another user's grants or memberships, by construction (the identifier is read from the authenticated session, never the request).

Exporting your data (DSGVO Art. 15)

GET /admin/v1/me/export

Returns a machine-readable JSON copy of the calling user's own data under the right of access (GDPR Art. 15). Every section is scoped to the caller and rebuilt from a fixed allowlist, so no secret, no other user's data, and no internal field can appear. The response carries schema_version: 2 and export_kind: "dsgvo_art15_self_service", and contains:

Section Contents
user The caller's profile: id, email, name, role, locale, preferred_name, work_category, model_instructions, default_model, currency, dictation_language, answer_units, answer_address_form, answer_region, chat_width, created_at, reactivation_opted_out_at, least_privilege_digest_enabled (boolean), and invited_by (the inviter's name, only while the inviter is a live member of the same tenant). Unset fields are omitted. No password/hash.
reactivation_events The lifecycle e-mails sent to the caller: sequence, step, anchor_at, sent_at, outcome, attempts, reactivated_at.
least_privilege_digests The weekly least-privilege digest mails sent to the caller: week_start, claimed_at, outcome, finished_at.
signup_intents The caller's own registration record(s) captured at self-serve signup, keyed by their email: name, the optional company / phone / job title Sales fields, the accepted terms version and timestamp, locale, plan and creation time, and the campaign source captured with the registration (utm_source, utm_medium, utm_campaign, utm_term, utm_content, click_id_type, referrer_host, click_id — the click-ID value) and the signup country (country, a two-letter code; a field that was not captured is omitted, like every other empty field of the record). Never the signup one-time-code hash, the Stripe checkout-session/price ids, the voucher code, or the capture IP. Empty ([]) for accounts not created via self-serve signup.
conversations The caller's conversations, each with its messages (the message bodies).
messages_in_shared_conversations The messages the caller wrote in other people's conversations (a shared conversation they co-drove, a Teams/Slack channel thread): id, conversation_id, content, created_at. The answers there belong to that conversation's owner and are not included.
attachments_added The files the caller added to their messages in other people's conversations — metadata only: id, conversation_id, message_id, filename, mime_type, size_bytes, created_at. The file bytes are not included; the caller can download each one with GET /admin/v1/attachments/<id> while they can still read that conversation and the message is not deleted (see Conversations → Attachments). Files in the caller's own conversations are part of conversations.
memories, pii_keywords, agents, projects The caller's own memories, personal PII keywords, agents (including their conversation starters and safety constraints), and owned projects.
statistics Aggregate usage attributable to the caller (including their personal tokens; service/gateway-token traffic carries no user and is not counted): request_count, input_tokens, output_tokens, cost_usd, blocked_count, first_request_at/last_request_at (omitted when there are no requests), a per-model breakdown by_model, and an explanatory note.
request_logs Recent request metadata: id, ts, provider, model, status, cached, input_tokens, output_tokens, cost_usd, latency_ms, token_label, blocked and the fixed-category blocked_by. No free-form fields. Capped at the most recent 5000 rows; request_logs_truncated is true when older rows exist.
agent_schedules The caller's agent schedules (no scheduler lease/claim internals).
knowledge_files The caller's uploaded knowledge files, including the extracted text (extracted_text).
device_families The caller's own active device sessions: id, gateway, label, status, timestamps. Never a token or hash.
mcp_oauth_grants The caller's own MCP proxy OAuth grants, active and revoked: id, agent_id, client_id, status, created_at, revoked_at, absolute_expires_at. Never a token or hash.
chat_feedback The caller's own conversation ratings: id, conversation_id, rating, comment, the browser diagnostic stored with the rating (client_context, an object; the key is omitted when the stored value is missing or cannot be decoded), images (the screenshots attached to the rating: id, mime, size_bytes and created_at only, never the image bytes; download an image via GET /admin/v1/conversations/<conversation_id>/feedback/images) and created_at / updated_at. Capped at the most recent 1000 rows.
app_feedback The caller's own in-app feedback: id, type, summary, description, url, status, category, auto_response, responded_at, the browser diagnostic stored with the entry (client_context, an object; the key is omitted when the stored value is missing or cannot be decoded), roadmap (the product team's answer to a feature request, when there is one; the same shape as in My feedback), images (the screenshots: id, mime, size_bytes and created_at only, never the image bytes; download an image via GET /admin/v1/my-feedback/<id>/images, see Feedback) and created_at. Entries you wrote come first, automatic app diagnostics last. Capped at 1000 rows: your written feedback first, then the newest automatic diagnostics; app_feedback_truncated is true when more exist. Internal triage signals (sentiment, severity, confidence, dedupe cluster, linked ticket, response channel) are never exported.
client_errors The caller's own browser crash reports: the error message, the (query-scrubbed) route, the captured IP, the browser diagnostic (client_context), and the timestamp. Anonymous reports (no session) have no user and are not included. Capped at the most recent 1000 rows.

Empty sections are encoded as [] (never {}).

Streaming and memory. The response is streamed as compact JSON (no pretty-printing, no Content-Length), with the same schema as before. The server reads your data in byte-bounded pages, so the memory one export needs is bounded and does not grow with the size of your account; knowledge-file texts are never truncated. Clients should save the body as-is rather than parse it into an object tree first.

Limits. Per account and per server node: one export at a time, and at most 30 exports per hour.

  • A second export while one is running is refused with 429 { "error": "...", "code": "export_in_progress" } and Retry-After: 30.
  • The 31st export within an hour is refused with 429 { "error": "...", "code": "export_rate_limited" } and Retry-After: 3600.

Failures. A storage failure before any data has been sent fails the export with 503 { "error": "temporarily unavailable; retry later" } (retry); an internal server error before any data has been sent answers 500 { "error": "internal error", "request_id": "…" } instead (not a storage fault; retrying will not help, report the request id). Once streaming has begun the status line (200) is already sent, so a fault then cuts the connection: the download is incomplete and its JSON does not parse. Treat such a file as failed and retry; a partial copy is never presented as complete. A very large export over a slow link can also hit the web app's roughly 8-minute download deadline; the download is then reported as failed.

Deliberately excluded (documented on the manifest's omitted field): the request bodies (prompt/response) of non-chat traffic (raw API, playground, agent runs) — because request_log.user_id records the token creator, and a shared token can attribute other people's rows to one user, so dumping those bodies would leak foreign content; your own chat message bodies are included under conversations. Screenshots of your chat ratings and of your app feedback are listed as metadata only (see chat_feedback and app_feedback above). Also excluded: the original binary blobs of uploaded files (available via the per-file download) and the one store with no per-user dimension, which cannot be attributed to you: gateway playground traces (removed by the trace retention sweep).

Also excluded from this self-service copy: your turn replay records — raw copies of your recent chat, API, playground and agent turns (the messages as sent, before masking, plus the turn's tool calls and results), kept for model evaluation for the tenant's replay retention (30 days by default), including turns of conversations you have since deleted. They are erased immediately on erasure (Art. 17); a copy can be requested from the operator.

Responses:

  • 200 OK — the JSON manifest (streamed).
  • 429 — export_in_progress or export_rate_limited (see above), with Retry-After.
  • 503 { "error": "temporarily unavailable; retry later" } — storage failure before any data was sent, or the server could not check the hourly export limit (the export is then refused, never run unbounded); retry.
  • 500 — an internal server error before any data was sent (not retryable).
  • 403 { "error": "data export is not available for the shared demo account", "code": "demo_read_only" } — the shared demo account (or an account without a system role) is not an individual data subject and cannot export.
  • 403 { "error": "impersonation_forbidden", "code": "impersonation_forbidden" } — while viewing as another user.
  • 401 unauthenticated.

Least-privilege digest preference

GET /admin/v1/me/least-privilege-digest and PUT /admin/v1/me/least-privilege-digest

The calling user's own opt-out for the weekly least-privilege digest e-mail. Session-authenticated only; the route takes no user identifier, so it can only ever read or change the caller's own preference. It is blocked while impersonating (the preference belongs to the real user).

GET returns 200 { "enabled": true }. true (the default) means the weekly mail is wanted; false means the user has opted out.

PUT accepts exactly one shape:

{ "enabled": false }

enabled must be a JSON boolean. It is never coerced: the string "false", a number or null are rejected. On success the response is 200 { "enabled": <new value> }. The call is idempotent; an audit entry (user.least_privilege_digest_opted_out or user.least_privilege_digest_opted_in) is written only when the stored value actually changes; it is recorded as a self-service action (actor_type = "user", the caller as actor), in the same transaction as the change.

Rejections (nothing is written on any of them):

Status code When
400 body_required no request body
400 body_not_object the body is not a JSON object (array, string, number, ...)
400 unknown_field the object contains any key other than enabled
400 enabled_not_boolean enabled is absent or not a boolean ("false", 0, null, ...)
401 unauthenticated no valid session
404 not_found GET only: the account no longer exists
503 - transient database fault; retry

This opt-out is independent of the general lifecycle-mail opt-out (reactivation_opted_out_at); the digest is suppressed when either is set.


Deleting the calling account

DELETE /admin/v1/me

Performs a soft delete on the calling user (sets deleted_at) and answers 200 { "ok": true }. Every session on every device ends immediately and permanently, and the account's /v1 API tokens are revoked, by stamping the per-user revocation floor (sessions_valid_after; see Authentication). The account can be restored only by an administrator via POST /admin/v1/users/<ID>/restore — and a restore does not revive the old sessions or tokens: the user signs in afresh and mints new tokens. Protected accounts (such as App Store reviewer accounts) silently no-op.

The delete runs as one transaction. A deadlock with a concurrent write (or another immediate serialization abort the database asks the client to restart) is retried by the server (up to 4 attempts; the whole delete re-runs from scratch). Only a conflict that persists through every attempt, or no database connection, answers 503 { "error": "temporarily unavailable; retry later" } — nothing changed, the account is still active, retrying is safe. Any other server fault answers 500 { "error": "internal error", "request_id": "…" }; the cause is logged under that request id and never returned.

Erasing the calling account (DSGVO Art. 17)

DELETE /admin/v1/me/erase

Step-up-gated: the optional JSON body { "step_up_token": "…" } carries a verified step-up token; for a caller on password and second-factor sign-in, without it the server answers 403 step_up_required and nothing is erased; other callers need not send it and the field is ignored. The check comes after the demo-account and protected-account 403s and the body checks, and before the erasure. A token is spent even when the erasure then answers 409 or 503, so a retry by such a caller needs a new step-up.

Performs an irreversible hard delete of the calling user under the right to erasure (GDPR Art. 17). Unlike the soft DELETE /admin/v1/me, this cannot be restored: the user row and all personal data are physically removed in a single transaction, and a tamper-evident deletion record (Löschprotokoll) is written to the audit log (action = "user.hard_deleted", counts only, no erased content). The same record is also written, with actor_type = "system", no actor and reason agf4983_prod_test_account_cleanup, when the one-off operator cleanup erases leftover @local.test test accounts.

What is erased: the user's own conversations and messages (incl. attachments), memories, personal PII keywords, presets, slash commands, ratings on answers (conversation feedback), comments the user wrote, content reports the user filed, OAuth links, sessions, device tokens, MCP connector credentials, conversation embeddings/summaries, the user's agents/schedules/connectors, uploaded knowledge documents, turn replay records, saved tool results of failed turns, per-user spend ledger rows, "View as User" sessions (as viewer or as viewed user), and — for a self-serve account — the pre-payment registration record (signup_intent, keyed by email: name, company, phone, job title, capture IP, consent snapshot), deleted by the same email key as the email one-time-code challenge. Messages the user wrote and files they attached in other people's conversations (a shared conversation they co-drove, a Teams/Slack channel thread) are part of that owner's conversation and are kept; only the author link (created_by) is removed (see Data retention). The deletion record counts these scrubs as chat_message_author and chat_attachment_author; the counts also include the rows of the user's own conversations, which are deleted right after in the same transaction. What is anonymized instead of deleted (retained under the billing/usage-integrity legal basis, GDPR Art. 17(3)): request/usage log rows — the user_id and all free-text columns are nulled, numeric usage aggregates are kept (where the optional ClickHouse analytics copy is enabled, this erasure does not reach it (nothing in it is deleted or anonymised): its text expires after 14 days and its other personal fields after 730 days — see ClickHouse analytics sink); the user's audit-log IP addresses are removed; the tool-call arguments in access decisions that name the user are erased (the hash is kept); the user's app feedback entries are kept without user link, text, URL, browser context, summary, automatic response and roadmap note (only the coarse classification stays for statistics); model-error entries lose user id, email, detail, browser context and title; the note on the user's wallet budget requests is removed (the request itself stays); agent review decisions the user made stay (decision and time) with the actor link, note and reason removed, and the review history of the agents the erasure deletes keeps its rows with note and reason removed; knowledge documents the user added to the organisation library stay, without the author link; the user's browser crash reports (client_error_log) have their user_id, IP, tenant linkage, page URL, and browser-context (client_context) nulled; only the bounded error message and stack remain, removed by the 30-day retention sweep. Workflow run outputs (workflow_run.run_state) are retained as tenant operational work-product under a distinct legal basis (GDPR Art. 6(1)(f)) — the run row is kept and the erased user's uuid and email are scrubbed to a tombstone in place, while the run's own submitter input (trigger_input) is nulled on the subject's runs; the storage-limitation ceiling for these retained records is enforced by the workflow-run retention ceiling (an age-based purge of old terminal runs, default 365 days). Stores with no per-user dimension cannot be targeted per user; each is named in the deletion record together with what actually bounds it: gateway playground traces — removed by the trace retention sweep (playground-source traces are retained). Errata: deletion records written before an earlier release list the client error log among these untargetable stores; it since gained a per-user dimension and is now anonymized in place (above). Older records also list the semantic cache: that feature is disabled, nothing writes to it, and its leftover rows have been deleted, so it is no longer listed. Historical records are immutable and keep the old wording.

The user's webhook triggers (agent triggers on other users' agents, and workflow triggers — triggers on the user's own agents go with those agents) are removed in the same transaction, and their already-queued runs are cancelled first, with the payload each was fired with cleared: a queued agent run is marked failed (webhook trigger deleted), a queued webhook-fired workflow run cancelled (webhook_trigger_deleted — per workflow: every queued webhook run of a workflow whose trigger the user created, as the trigger DELETE does). Runs that had already started finish; queued agent runs of other users' triggers and queued runs of other kinds are untouched. The triggers are disabled first, so a webhook fire racing the erasure is never enqueued: it is refused (403) or told to retry (503). The deletion record counts the cancelled runs (agent_run_trigger_cancelled, workflow_run_trigger_cancelled). The erasure also cancels the user's own pending workflow runs first (owner_unavailable, payload cleared; counted as workflow_run_creator_cancelled), so workflow_run_trigger_cancelled counts only the remaining pending webhook runs of workflows whose trigger the user created — not runs the user created on a workflow the user owns.

Responses:

  • 200 OK — { "ok": true, "erased": { ...per-table counts... } }.
  • 400 { "error": "no body is accepted", "code": "invalid_request" } — a JSON object body with any key other than step_up_token; also a body with step_up_token while sign-in with password and second factor is not rolled out (see below).
  • 403 { "error": "step up required", "code": "step_up_required" } — the caller needs a step-up and sent none, or an unusable one. 503 — the sign-in rollout switch is malformed or unreadable; nothing is erased.
  • 400 { "error": "body must be a JSON object", "code": "invalid_body" } — a body that is JSON null, an array or a scalar (see below).
  • 403 — { "error": "account erasure is not available for the shared demo account", "code": "demo_read_only" } for the shared demo account (or an account without a system role); { "error": "This account cannot be erased", "code": "account_not_erasable" } for protected seed/review accounts; { "error": "impersonation_forbidden", "code": "impersonation_forbidden" } while viewing as another user.
  • 409 { "error": "cannot erase the last admin while other users remain — promote another admin first", "code": "last_admin_blocked" } — the caller is the last active admin (admin or tenant_admin) of a tenant that still has other users. A sole admin who is also the only user can erase; a user of a deleted tenant is never blocked.
  • 503 service unavailable — { "error": "temporarily unavailable; retry later" }: the erasure transaction kept conflicting with concurrent database writes after bounded automatic retries (statement-level re-read + full-transaction re-runs), or no database connection could be obtained, or the last-admin check could not read the tenant's administrators, or (while the Salesforce lead sync is on) the server could not determine whether the caller is the workspace registrant. The transaction was fully rolled back — nothing was deleted and the account is intact; re-issuing the same request is safe and converges once the contention subsides. A single transient conflict never surfaces: it is absorbed by the automatic retries.
  • 500 — { "error": "internal error", "request_id": "…" }: any other failure of the erasure (nothing was deleted; the cause is logged under the request id, never returned).
  • 401 unauthenticated.

Shared agents of the leaver are handed over to a successor and paused until that person confirms them — the successor is picked automatically (oldest active ki_manager, otherwise the oldest active tenant_admin or admin; with none, the agent is deleted like a private one). A self-erase accepts no request body except the optional step_up_token while sign-in with password and second factor is rolled out: an absent body or {} erases (for a caller who needs no step-up); any other key is refused with 400 invalid_request, JSON null, an array or a scalar with 400 invalid_body, and undecodable JSON with 400 malformed_body. Nothing is erased in any of these cases. See Erasing a user and handing over their shared agents.

Shared resources owned by the leaver are not destroyed: a shared project is reassigned so the workspace keeps working. A project counts as shared, and is handed to the successor, when it has another member, a grant to a group of the same tenant (even an empty group), an organisation grant (even while organisation sharing is off), or belongs to a department of the same tenant. Only a project with none of these is deleted with the user. Ownership is granted, not just recorded: the successor receives an owner membership row on the project (rewriting the creator alone grants no access), and only when no other effective owner remains. An effective owner is a direct owner or a member of a group holding the owner role, in the project's own tenant; a co-owner who is disabled but not deleted still counts, so no second owner is added. A kept project that is already ownerless gets the successor as owner. This also applies to a kept project the leaver effectively owned without having created it (including one in the trash), and it holds even when the leaver's account was already deleted (soft-deleted) before the erasure. If no successor can be found for such a project, the project is kept (it is not the leaver's to delete) without an owner row, the erasure still completes, the project is not counted in chat_project_owner_granted, and a warning naming the project, its tenant and the leaver is logged; a platform admin can recover the project. When the successor comes from the member fallback, that member is promoted to owner. The number of projects granted is reported as chat_project_owner_granted in the erase counts. The new owner always comes from the project's own tenant, never from the leaver's: the acting admin, if they are a live user of that tenant; otherwise the oldest live tenant_admin, then the oldest live admin of that tenant; otherwise (projects only) the oldest live member of that tenant, or a disabled member of that tenant if no live member exists. Disabled admins are never picked as admin successors. Members of other tenants, including platform admins, are never chosen. With no admin and no direct member, the project is then handed to a user who can reach it through its sharing instead: a member of a group it is granted to, otherwise a member of its department, otherwise (only while organisation sharing is on) a user of the organisation grant; live users before disabled ones, the oldest first, always from the project's own tenant, and never a demo user or the leaver. Only when none of those exists either (no live admin, no direct member and no such grantee in the project's tenant) the project is deleted with the user, even if it was shared only by a grant, together with its knowledge and the project memories of its members; members' conversations and agents are detached from it (their code-interpreter sessions are closed after the erasure commits). The leaver's own uploaded knowledge documents in a surviving project are still erased. Chat bridge connections the leaver created follow the same rule, using the bridge's tenant: they are handed to a live admin of that tenant, and only a bridge with no such admin is removed (its service token is revoked).

Erasing another account (admin)

DELETE /admin/v1/users/<ID>/erase

Tenant-admin-only equivalent of the self-erase above, for fulfilling a data subject's erasure request. Requires tenant-admin authorization; a target in another tenant returns 403 (a 404 is returned only when no user with that id exists at all). Same 403/409/503/500 semantics (protected accounts; last-admin guard; rolled-back conflict; sanitised fault) and the same Löschprotokoll record (with actor_type = "admin").

This route (only) accepts the optional hand-over body (successor_default, successors) described in Erasing a user and handing over their shared agents; a body that is JSON null, an array or a scalar answers 400 invalid_body, and an unknown key, a non-UUID id or a wrong type answers 400 invalid_request; nothing is erased. Full fallback order: per-agent choice > successor_default > oldest active ki_manager > the acting administrator (admin-driven erasure only) > oldest active tenant_admin or admin > none (the agent is deleted like a private one).

Rectification logging (DSGVO Art. 16)

Every correction of a user's own profile (name, locale, preferred name, work category, model instructions) made through the personal profile endpoint is recorded in the audit log of the user's tenant (visible in the tenant's audit API; a tenant-less platform user's entry carries no tenant) as a user.self_rectified event, in the same transaction as the change (the tenant is read under the user row's lock inside that transaction, so a concurrent tenant move cannot file the entry under the old tenant; if the account was erased or deleted mid-request, nothing is written, no entry is created, and the request answers 401). The admin equivalent (PATCH /admin/v1/users/{id} changing email, name, role, or tenant) records a user.rectified event (an admin email change additionally a domains-only user.email_changed event, see Users). In both cases the *rectified event stores only the names of the changed fields plus the actor and timestamp — never the old or new values — so that a subsequent Art. 17 erasure cannot leak personal data through the retained audit trail. One-shot UI flags (e.g. tooltip-seen markers) are not personal-data rectifications and are not logged.

The self path (PATCH /admin/auth/me) logs a field name whenever the client submits a valid value for it — it does not diff against the prior stored value first (unlike the admin path, PATCH /admin/v1/users/{id}, which does diff and only logs fields that actually changed). Re-submitting your own unchanged name therefore still records a user.self_rectified entry: exercising the right to rectification is itself the event being logged, not the value's delta.