<metaproperty="description"content="Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.">
<metaproperty="og:title"content="Folders">
<metaproperty="og:image"content="">
<metaproperty="og:description"content="Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.">
<p>Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.<br>
In the API, folders are called "dialog filters"; in the UI, they are typically represented as tabs. </p>
<li><ahref="/method/messages.getDialogFilters">messages.getDialogFilters</a> to fetch a list of previously configured folders.</li>
<li><ahref="/method/messages.getSuggestedDialogFilters">messages.getSuggestedDialogFilters</a> to fetch a list of suggested folder combinations.</li>
<li><ahref="/method/help.getAppConfig">help.getAppConfig</a> to fetch app-specific configuration parameters. </li>
</ul>
<p>The boolean under the <code>dialog_filters_tooltip</code> JSON key in the result of <ahref="/method/help.getAppConfig">help.getAppConfig</a> can be used to determine whether a folder tooltip should be presented to the user right away.<br>
The UI should then show a list of suggested folder combinations. </p>
<p>Once configuration is finished, apps call <ahref="/method/messages.updateDialogFilter">messages.updateDialogFilter</a> to create or update existing folders.<br>
As per the <ahref="/constructor/dialogFilter">dialogFilter</a> constructor, folders have multiple flags that can be combined to determine which chats should be included in (or excluded from) the folder.<br>
Folders can also have unlimited pinned chats, as determined by the <code>pinned_peers</code> field.</p>
<p>To reorder existing folders, <ahref="/method/messages.updateDialogFiltersOrder">messages.updateDialogFiltersOrder</a> should be used with the IDs of the various dialog filters.</p>
<p>To delete folders, use <ahref="/method/messages.updateDialogFilter">messages.updateDialogFilter</a> without populating the <code>filter</code> flag field. </p>
<p>Clients can receive <ahref="/constructor/updateDialogFilter">updateDialogFilter</a>, <ahref="/constructor/updateDialogFilterOrder">updateDialogFilterOrder</a> updates with new filter information, generated by other clients when modifying folder info.<br>
Clients can also receive <ahref="/constructor/updateDialogFilters">updateDialogFilters</a>, in which case folder info should be refetched manually using <ahref="/method/messages.getDialogFilters">messages.getDialogFilters</a>.</p>
<p>API peer folders are typically used only by <ahref="https://telegram.org/blog/archive-and-new-design">archived chats</a>, and are really handy for distinguishing groups of peers, since most peer-related constructors (updates, chat info) will contain the <code>folder_id</code> assigned the the specified chat. </p>
<p>In Telegram apps, API peer folders are used only to implement the chat archive, identified by <code>folder_id</code><code>1</code>; all other peers are in <code>folder_id</code><code>0</code> by default; no other <code>folder_id</code> is allowed at the moment.</p>
<ul>
<li><ahref="/method/folders.editPeerFolders">folders.editPeerFolders</a> can be used to add and remove peers from peer folders.</li>
<li><ahref="/method/folders.deleteFolder">folders.deleteFolder</a> can be used to delete peer folders, moving all peers previously present in that folder to the default <code>0</code> folder.</li>
</ul>
<p>Both methods return an <ahref="/constructor/updates">updates</a> constructor, containing a single <ahref="/constructor/updateFolderPeers">updateFolderPeers</a> with the new <code>folder_id</code> of moved peers.<br>
Clients can also receive <ahref="/constructor/updateFolderPeers">updateFolderPeers</a> as a normal <ahref="/api/updates">update</a>, generated by other clients when modifying peer folders.</p></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.