Skip to navigation

Update the current user

View as Markdown

Updates the caller’s own profile. Writable: name, language and locale, plus email while the account is unconfirmed (email_confirmed: false).

Every field is optional; omitted fields are left untouched, so a client can PATCH a single key. name may be set to null to clear it.

Changing email of an unconfirmed account invalidates the confirmation link sent earlier and mails a new one to the new address. At most 5 confirmation e-mails go to one account in 24 hours, the sign-up e-mail and in-app resends included; past that limit the address still changes but no link is sent until the oldest one is a day old. On a confirmed account email is ignored.

Not writable here by design: password (see /auth/password/reset and /auth/password/update) and avatar (an attachment, which needs a multipart endpoint).

Authentication

AuthorizationBearer

JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.

OR
AuthorizationBearer

Lucanto API key. Two prefixes:

  • lct_pat_<random><checksum> — personal access token (owner: User)
  • lct_live_<random><checksum> — workspace token, live data

Issue keys at /settings/api_keys (personal) or /:workspace_id/settings/api_keys (workspace). Plaintext token is shown once and never again.

Request

This endpoint expects an object.
namestring or nullOptional

The user’s display name. Send null to clear it.

emailstringOptionalformat: "email"

A corrected e-mail address. Writable only while the account is unconfirmed (email_confirmed: false) and ignored afterwards. A change invalidates the earlier confirmation link and mails a new one to the new address, at most one per 30 seconds and at most 5 confirmation e-mails per account in 24 hours. When either limit refuses, the address is still saved but no link is sent; ask for one again later. An address another account already uses is a 422.

languageenumOptional

Preferred UI language. Sets the language of the app and of the e-mails Lucanto sends to this user. PDF documents and customer e-mails follow the document’s own pdf_language (sk, cs, en, ro, uk, de, fr); a document without one uses the workspace’s country language. cz is a deprecated alias of cs: still accepted on input, never returned.

localestringOptionalformat: "^[a-z]{2}-[A-Z]{2}$"

Regional format for dates and amounts, a supported language-region tag such as en-GB.

Response

OK
idlong
Internal user ID. Stable across token rotations.
emailstringformat: "email"

The user’s primary email address (used as the login identifier).

languageenum

The user’s preferred UI language. Sets the language of the app and of the e-mails Lucanto sends to this user. PDF documents and customer e-mails follow the document’s own pdf_language (sk, cs, en, ro, uk, de, fr); a document without one uses the workspace’s country language.

localestring

Regional format for dates and amounts, a language-region tag such as en-GB. Independent of language.

connected_providerslist of strings

List of OAuth providers connected to this user. Empty array if the user registered with email/password and never connected any provider.

password_setboolean

true if the user has set a password (either at registration or after the fact). false only for users who registered via OAuth and have never set a password — they can’t use the password reset flow without first setting one.

email_confirmedboolean

true once the account’s e-mail has been confirmed (the link in the confirmation e-mail, or a Google/Apple sign-in with a verified address). An unconfirmed account can use the app; a client should show a reminder and may offer POST /auth/confirmation/resend.

email_deliverableboolean

false when the confirmation e-mail or a reminder bounced or was marked as spam at the CURRENT address — resending will not help; the user must correct email (PATCH /user, unconfirmed accounts only). true otherwise.

created_atdatetime
updated_atdatetime
namestring or nullOptional
The user's display name. Nil for users who registered via OAuth and have not yet completed their profile.
avatar_urlstring or nullOptionalformat: "uri"

Signed URL for the user’s avatar image (ActiveStorage blob URL). null when no avatar is attached. URLs are time-limited — re-fetch the user record to get a fresh URL.

Errors

401
Unauthorized Error
403
Forbidden Error
422
Unprocessable Entity Error
429
Too Many Requests Error