# contacts.getSaved

Get all contacts

## 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.contacts.getSaved({
        403: new Api.TAKEOUT_REQUIRED({...}),
        }));
    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.Vector<SavedContact> = await client.invoke(new Api.contacts.getSaved({
        403: new Api.TAKEOUT_REQUIRED({...}),
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}
{% endtabs %}

## TL schema

```
---functions---
contacts.getSaved#82f1e39f = Vector<SavedContact>;
```

## Parameters

| Name | Type              | Description                                    |
| :--: | ----------------- | ---------------------------------------------- |
|  403 | TAKEOUT\_REQUIRED | A takeout session has to be initialized, first |

## Result

[Vector](https://core.telegram.org/type/Vector%20t)[\[SavedContact\](https://core.telegram.org/type/SavedContact)](https://app.gitbook.com/s/-MMkAn4QUh4dOGfc-vjY/working-with-contacts-and-top-peers/\[SavedContact]\(https://core.telegram.org/type/SavedContact\))

## Possible errors

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

## Can bots use this methd ?

### yes

## Related pages
