# account.createTheme

Create a theme

## 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.createTheme({
        slug: 'random string here',
        title: 'random string here',
        document: new Api.InputDocument({...}),
        settings: new Api.InputThemeSettings({...}),
        }));
    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.Theme = await client.invoke(new Api.account.createTheme({
        slug: 'random string here',
        title: 'random string here',
        document: new Api.InputDocument({...}),
        settings: new Api.InputThemeSettings({...}),
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}
{% endtabs %}

## TL schema

```
theme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme;
---functions---
account.createTheme#8432c21f flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
```

## 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) |
|   **slug**   | [string](https://core.telegram.org/type/string)                                                                                                        | Unique theme ID                                                                                         |
|   **title**  | [string](https://core.telegram.org/type/string)                                                                                                        | Theme name                                                                                              |
| **document** | [flags](https://core.telegram.org/mtproto/TL-combinators#conditional-fields).2?[InputDocument](https://core.telegram.org/type/InputDocument)           | Theme file                                                                                              |
| **settings** | [flags](https://core.telegram.org/mtproto/TL-combinators#conditional-fields).3?[InputThemeSettings](https://core.telegram.org/type/InputThemeSettings) | Theme settings                                                                                          |

## Result

[Theme](https://core.telegram.org/type/Theme)

## Possible errors

| Code | Type | Description |
| :--: | ---- | ----------- |

## Can bots use this methd ?

### yes

## Related pages
