Directory

A directory in Discord is a special type of channel that contains a list of directory entries, which are guilds and scheduled events that have been added and made discoverable by the community. Any user that can access a directory can view the entries and join the guilds.

Directories are most commonly found in student hubs.

Directory Entry Object

Directory Entry Structure
FieldTypeDescription
typeintegerThe type of directory entry
directory_channel_idsnowflakeThe ID of the directory channel that the entry is in
entity_idsnowflakeThe ID of the guild or scheduled event
created_atstringWhen the entry was created
primary_category_id?integerThe primary category of the entry
description?stringThe description of the entry
author_idsnowflakeThe ID of the user that created the entry
guild? 1directory guild objectThe guild entry
guild_scheduled_event? 1directory guild scheduled event objectThe guild scheduled event entry

1 Not included when fetched from Get Partial Directory Entries.

Directory Guild Structure

This object is a partial guild object with the following additional fields:

FieldTypeDescription
featurable_in_directorybooleanWhether the guild is eligible to be featured in the directory
Directory Guild Scheduled Event Structure

This object is a guild scheduled event object with the following additional fields:

FieldTypeDescription
guildpartial guild objectThe guild that the event is for
user_rsvp?booleanWhether the user has RSVP'd to the event
Directory Entry Type
ValueNameDescription
0GUILDA guild
1GUILD_SCHEDULED_EVENTA scheduled event
Directory Category
ValueNameDescription
0UNCATEGORIZEDUncategorized entry
1SCHOOL_CLUBSchool club or organization
2CLASSClass or subject
3STUDY_SOCIALStudy or social group
4SUBJECT_MAJORFor a subject or major
5MISCMiscellaneous entry

Endpoints

Get Directory Counts

GET/channels/{channel.id}/directory-entries/counts

Returns a mapping of directory categories to their entry count in the given directory channel. Requires the VIEW_CHANNEL permission.

Get Directory Entries

GET/channels/{channel.id}/directory-entries

Returns a list of directory entry objects in the given directory channel. Requires the VIEW_CHANNEL permission.

Query String Parameters
FieldTypeDescription
type?integerThe type of directory entry to filter by
category_id?integerThe primary category to filter by

Get Partial Directory Entries

GET/channels/{channel.id}/directory-entries/list

Returns a list of partial directory entry objects in the given directory channel. Requires the VIEW_CHANNEL permission.

Query String Parameters
FieldTypeDescription
entity_ids?array[snowflake]The IDs of the directory entries to retrieve (max 100)

Search Directory Entries

GET/channels/{channel.id}/directory-entries/search

Returns a list of directory entry objects in the given directory channel that match the query. Requires the VIEW_CHANNEL permission.

Query String Parameters
FieldTypeDescription
querystringThe query to search for (1-100 characters)
type?integerThe type of directory entry to filter by
category_id?integerThe primary category to filter by

Get Directory Entry

GET/channels/{channel.id}/directory-entry/{entity_id}

Returns a directory entry object for the given entity ID in the directory channel. Requires the VIEW_CHANNEL permission.

Create Directory Entry

POST/channels/{channel.id}/directory-entry/{entity_id}

Creates a new directory entry in the given directory channel. Requires the VIEW_CHANNEL permission and the MANAGE_GUILD permission on the entity being added. Returns the new directory entry object on success. Fires a Guild Directory Entry Create Gateway event.

JSON Parameters
FieldTypeDescription
type?integerThe type of directory entry to create (default GUILD)
primary_category_id?integerThe primary category of the entry (default UNCATEGORIZED)
description??stringThe description of the entry (max 200 characters)

Modify Directory Entry

PATCH/channels/{channel.id}/directory-entry/{entity_id}

Modifies an existing directory entry in the given directory channel. Requires the VIEW_CHANNEL permission and the MANAGE_GUILD permission on the entity being modified. Returns the updated directory entry object on success. Fires a Guild Directory Entry Update Gateway event.

JSON Parameters
FieldTypeDescription
primary_category_id?integerThe primary category of the entry
description?stringThe description of the entry (max 200 characters)

Delete Directory Entry

DELETE/channels/{channel.id}/directory-entry/{entity_id}

Deletes a directory entry in the given directory channel. Requires the VIEW_CHANNEL permission and the MANAGE_GUILD permission on the entity being deleted. Returns a 204 empty response on success. Fires a Guild Directory Entry Delete Gateway event.

Get Directory Broadcast Info

GET/guilds/{guild.id}/directory-entries/broadcast

Returns the broadcast information for the given guild and directory entry type. User must be a member of the guild.

Query String Parameters
FieldTypeDescription
typeintegerThe type of directory entry to get broadcast info for
entity_id?integerThe ID of the directory entry to get broadcast info for
Response Body
FieldTypeDescription
can_broadcastbooleanWhether the user can broadcast in any linked directory channels
has_broadcast? 1booleanWhether the entity has been broadcasted in any directory channels

1 Only included when entity_id is provided.