# account.resetAuthorization

Log out an active [authorized session](https://core.telegram.org/api/auth) by its hash

## 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.resetAuthorization({
        hash: 5596079,
        }));
    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.Bool = await client.invoke(new Api.account.resetAuthorization({
        hash: 5596079,
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}
{% endtabs %}

## TL schema

```
boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
account.resetAuthorization#df77f3bc hash:long = Bool;
```

## Parameters

|   Name   | Type                                        | Description  |
| :------: | ------------------------------------------- | ------------ |
| **hash** | [long](https://core.telegram.org/type/long) | Session hash |

## Result

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

## Possible errors

| Code | Type                                   | Description                                                                                               |
| :--: | -------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|  406 | FRESH\_RESET\_AUTHORISATION\_FORBIDDEN | You can't logout other sessions if less than 24 hours have passed since you logged on the current session |
|  400 | HASH\_INVALID                          | The provided hash is invalid                                                                              |

## Can bots use this methd ?

### yes

## Related pages

### [User Authorization](https://core.telegram.org/api/auth)

How to register a user's phone to start using the API.
