# account.updateProfile

Updates user profile.

## Example

{% tabs %}
{% tab title="Javascript" %}
```javascript
const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.account.updateProfile({
        firstName: 'random string here',
        lastName: 'random string here',
        about: 'random string here',
        }));
    console.log(result); // prints the result
})();
```
{% endtab %}

{% tab title="TypeScript" %}
```typescript
import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result: Api.Returns User object containing the updated current user profile. = await client.invoke(new Api.account.updateProfile({
        firstName: 'random string here',
        lastName: 'random string here',
        about: 'random string here',
        }));
    console.log(result); // prints the result
})();
```
{% endtab %}
{% endtabs %}

## TL schema

```
userEmpty#200250ba id:int = User;
user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
---functions---
account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;
```

## Parameters

|       Name      | Type                                                                                                                           | Description                                                                                             |
| :-------------: | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
|    **flags**    | [#](https://core.telegram.org/type/%23)                                                                                        | Flags, see [TL conditional fields](https://core.telegram.org/mtproto/TL-combinators#conditional-fields) |
| **first\_name** | [flags](https://core.telegram.org/mtproto/TL-combinators#conditional-fields).0?[string](https://core.telegram.org/type/string) | New user first name                                                                                     |
|  **last\_name** | [flags](https://core.telegram.org/mtproto/TL-combinators#conditional-fields).1?[string](https://core.telegram.org/type/string) | New user last name                                                                                      |
|    **about**    | [flags](https://core.telegram.org/mtproto/TL-combinators#conditional-fields).2?[string](https://core.telegram.org/type/string) | New bio                                                                                                 |

## Result

Returns [User](https://core.telegram.org/type/User) object containing the updated current user profile.

## Possible errors

| Code | Type               | Description               |
| :--: | ------------------ | ------------------------- |
|  400 | ABOUT\_TOO\_LONG   | About string too long     |
|  400 | FIRSTNAME\_INVALID | The first name is invalid |

## Can bots use this methd ?

### yes

## Related pages
