Get an API key
api.auth

updateProfile()

api.auth.updateProfile(updates) → Promise<{ ok, user }>

Changes the account's writable profile fields. Only the fields you send are touched.

PUT /api/auth/profilefreepartial update
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

Parameters

nomstring

Family name.

prenomstring

Given name.

genrestring

As the account declares it.

telstring

Phone number.

adressestring

Street address.

villestring

City.

Six fields, and nothing else is writable here. The email, password, and balance are not public SDK operations.

It is a partial update

Send one field and one field changes. There is no need to read the profile first, and no risk of writing back a stale copy of the rest.

await api.auth.updateProfile({ ville: "Tunis" });
// everything else is exactly as it was
api.auth.update_profile({"ville": "Tunis"})
# everything else is exactly as it was

Empty values are dropped, not applied

A field that arrives empty is removed from the update before it is applied. So sending "" does not clear a field — it changes nothing, and the call still answers ok. There is no way to blank a profile field through this method.

await api.auth.updateProfile({ ville: "" });
// { ok: true, … } — and "ville" is unchanged

await api.auth.updateProfile({ tel: null });
// the same: nothing is cleared
api.auth.update_profile({"ville": ""})
# {"ok": True, ...} — and "ville" is unchanged

api.auth.update_profile({"tel": None})
# the same: nothing is cleared
A form that submits blanks will not do what the form says

An untouched input posts an empty string, and an empty string is ignored here. Send only the fields the user actually edited, or the page will report a change that did not happen.

// Build the patch from what changed, not from the whole form
const patch = {};
for (const [field, value] of Object.entries(form)) {
  if (value !== "" && value !== original[field]) patch[field] = value;
}

if (Object.keys(patch).length) await api.auth.updateProfile(patch);
# Build the patch from what changed, not from the whole form
patch = {field: value for field, value in form.items()
         if value != "" and value != original.get(field)}

if patch:
    api.auth.update_profile(patch)

Password changes stay in account settings

An API key can update profile metadata, so it must never be able to replace the account credential. Passing password is rejected locally by the SDK and by the API with password_change_private. Use the signed-in account settings instead.

Returns

The account as the server now holds it, with the password stripped. This is the full record, wider than the four fields getUser() narrows it to — read it to confirm a change landed, not as a contract to depend on.

const { ok, user } = await api.auth.updateProfile({ ville: "Tunis" });

ok;            // true
user.ville;    // "Tunis" — confirmation
// Everything else on `user` is the account record. Treat it as informational.
answer = api.auth.update_profile({"ville": "Tunis"})

answer["ok"]              # True
answer["user"]["ville"]   # "Tunis" — confirmation
# Everything else on "user" is the account record. Treat it as informational.

Errors

CodeStatusWhen
unauthorized401No valid session or key on the call.
password_change_private403The request attempted to change a password through the public SDK.
user_not_found404The session points at an account that no longer exists.

One thing worth thinking about first

These are personal details, and they are the account holder's. A program that writes them should be doing it because someone asked it to, with a value they gave — not copying them across from somewhere else because it happened to have them.