> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/admin/admin/profile.md).

# Profile

The Profile screen of Admin — your users' name, email and phone — and how to change them from code today.

**Where:** Admin → **Profile** · `/profile`

On **Profile** a signed-in user sees their contact information and can change it: **First name**, **Last name**, **Email** and **Phone**, then **Save changes** (or **Discard**). The values are the user's Membership profile — the same ones you see in Cloud on the user's **User** tab ([Edit a user](/codemash/cloud/membership/users/edit.md)).

{% hint style="warning" %}
The Profile screen cannot load yet: it shows *Could not load your profile. Please retry.* The portal asks for the user by the number the sign-in returns (`2`) instead of the login id (`usr_…`). An end user also has no right to change their own profile today (`membership:update` is missing from the **Authenticated** role). Change the profile from your backend or from Cloud, as below.
{% endhint %}

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9d1a883670cc32c3f98c22185d3a32dc7c41b9ff%2Fprofile-1.png?alt=media" alt="Profile: Your contact information. Could not load your profile. Please retry."><figcaption><p>Profile today.</p></figcaption></figure>

## Before you start

* The user can sign in to Admin — [Sign in](/codemash/admin/admin/sign-in.md).
* For the code way: a client signed in as a project user with the right to update users (for example your own account, or a service user with such a role — see [Roles](/codemash/cloud/membership/roles.md)).

## Steps

The code way, from your backend ([client setup](/codemash/sdks/javascript-typescript.md)):

1. Read the user by the login id (`usr_…`) — the `cm_auth_id` claim of the user's token, or the **Login id** in Cloud.
2. Send the whole `userGeneralInfo` back with the fields you change:

   | Field                       | Required | What it does                                                                                           | Example                    |
   | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | -------------------------- |
   | `firstName`, `lastName`     | no       | The name.                                                                                              | `Maria`, `Jensen`          |
   | `primaryEmail`              | no       | The contact email.                                                                                     | `maria.jensen@example.com` |
   | `phone`                     | no       | The contact phone.                                                                                     | `+4520123456`              |
   | `blockAllMarketingMessages` | yes      | Keep the value you read — see [Messaging preferences](/codemash/admin/admin/messaging-preferences.md). | `false`                    |

## Result

`getUser` returns the new values, and Cloud shows them on the user's **User** tab.

## Change or remove it later

* **In Cloud** — **Membership → Users →** the user → **User** tab ([Edit a user](/codemash/cloud/membership/users/edit.md)).
* **Delete the user** — [Delete a user](/codemash/cloud/membership/users/delete.md).

## Do it from code

```ts
const id = 'usr_5T95TFbNwjJsxj4wJBnXgn';
const { user } = await norbix.api.membership.getUser({ id });
await norbix.api.membership.updateUser({
  id,
  userGeneralInfo: { ...user.generalInfo, phone: '+4520123456' },
});
// getUser again → generalInfo.phone = '+4520123456'
```

```sh
norbix api membership user get --id usr_5T95TFbNwjJsxj4wJBnXgn
```

API: [Get User](/codemash/api-reference/membership/users/get-user.md) · [Update User](/codemash/api-reference/membership/users/update-user.md)
