pub struct MeApi { /* private fields */ }Expand description
The calling identity: profile, tenants, head agent
Implementations§
Source§impl MeApi
impl MeApi
Sourcepub async fn delete(&self) -> Result<DeleteMeResponse>
pub async fn delete(&self) -> Result<DeleteMeResponse>
Delete your own account
Self-serve account deletion — the App Store 5.1.1(v) requirement, and the only path to it in
the mobile clients. Any authenticated member deletes their OWN account: the user record and
the email-membership index in every tenant the address belongs to, their api keys (the
per-tenant row AND the global hash, so live sessions die at once), and data tagged with them
as data subject, erased through the same sweep as /data-subject/erasure.
Every refusal is checked across ALL memberships BEFORE anything is deleted, so a half-delete cannot happen.
WRITE SEMANTICS: replaces nothing — it removes. A second call answers 404: after a successful delete there is no record to delete, which is the honest answer rather than a silent success.
DELETE /api/v1/me
Sourcepub async fn export_my_account(
&self,
params: &ExportMyAccountParams,
) -> Result<AccountExport>
pub async fn export_my_account( &self, params: &ExportMyAccountParams, ) -> Result<AccountExport>
Export everything in this account
Chats, projects, memories and the account record. format=zip (the default) answers a zip
attachment; format=json answers the same bundle as one document, which is easier to pipe
and which a browser will show rather than download.
Check complete: when a size ceiling is hit the export still succeeds and omitted names
what was left out. A truncated export that does not say so is the failure this field exists
to prevent.
GET /api/v1/me/export
Sourcepub async fn get_my_preferences(&self) -> Result<UserPreferences>
pub async fn get_my_preferences(&self) -> Result<UserPreferences>
Read personal instructions
Requires a credential bound to a person: an API key that carries no user identity is refused with 403, because personal instructions belong to the account holder rather than the key.
GET /api/v1/me/preferences
Sourcepub async fn patch(&self, body: &PatchMeRequest) -> Result<PatchMeResponse>
pub async fn patch(&self, body: &PatchMeRequest) -> Result<PatchMeResponse>
Set or clear your avatar
The one field a person may change about themselves here: avatar_url. It must name a file
this tenant owns — /api/v1/files/\<file_id\>/content, absolute or relative — whose
mime_type is image/*; null clears it. The change is written to the caller’s user row
in every tenant they belong to (updated_rows says how many). Anything else in the body is
ignored; a body without avatar_url is 400. WRITE SEMANTICS: replaces — avatar_url is the
whole writable surface and must be present; there is nothing to merge.
PATCH /api/v1/me
Sourcepub async fn switch_tenant(
&self,
body: &SwitchTenantRequest,
) -> Result<SwitchTenantResponse>
pub async fn switch_tenant( &self, body: &SwitchTenantRequest, ) -> Result<SwitchTenantResponse>
Switch the active workspace
Requires a user session (JWT). An API key is refused with 403, because a key is bound to
the tenant it was created in — create a key inside the target tenant instead. This endpoint
used to answer {"switched": true} for api-key callers and change nothing, which is why the
refusal is now explicit and documented.
The answer carries the target context; the client re-issues a key through the normal post-login flow.
POST /api/v1/me/tenants/switch
Sourcepub async fn update_my_preferences(
&self,
body: &UpdateMyPreferencesRequest,
) -> Result<UserPreferences>
pub async fn update_my_preferences( &self, body: &UpdateMyPreferencesRequest, ) -> Result<UserPreferences>
Write personal instructions
Both fields are optional; what is sent is merged onto the stored record. Same person-bound credential rule as the read.
PUT /api/v1/me/preferences