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
| Field | Type | Description |
|---|---|---|
| type | integer | The type of directory entry |
| directory_channel_id | snowflake | The ID of the directory channel that the entry is in |
| entity_id | snowflake | The ID of the guild or scheduled event |
| created_at | string | When the entry was created |
| primary_category_id? | integer | The primary category of the entry |
| description | ?string | The description of the entry |
| author_id | snowflake | The ID of the user that created the entry |
| guild? 1 | directory guild object | The guild entry |
| guild_scheduled_event? 1 | directory guild scheduled event object | The 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:
| Field | Type | Description |
|---|---|---|
| featurable_in_directory | boolean | Whether 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:
| Field | Type | Description |
|---|---|---|
| guild | partial guild object | The guild that the event is for |
| user_rsvp? | boolean | Whether the user has RSVP'd to the event |
Directory Entry Type
| Value | Name | Description |
|---|---|---|
| 0 | GUILD | A guild |
| 1 | GUILD_SCHEDULED_EVENT | A scheduled event |
Directory Category
| Value | Name | Description |
|---|---|---|
| 0 | UNCATEGORIZED | Uncategorized entry |
| 1 | SCHOOL_CLUB | School club or organization |
| 2 | CLASS | Class or subject |
| 3 | STUDY_SOCIAL | Study or social group |
| 5 | MISC | Miscellaneous entry |
Endpoints
Get Directory Counts
GET/channels/{channel.id}/directory-entries/countsReturns 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-entriesReturns a list of directory entry objects in the given directory channel. Requires the VIEW_CHANNEL permission.
Query String Parameters
| Field | Type | Description |
|---|---|---|
| type? | integer | The type of directory entry to filter by |
| category_id? | integer | The primary category to filter by |
Get Partial Directory Entries
GET/channels/{channel.id}/directory-entries/listReturns a list of partial directory entry objects in the given directory channel. Requires the VIEW_CHANNEL permission.
Query String Parameters
| Field | Type | Description |
|---|---|---|
| entity_ids? | array[snowflake] | The IDs of the directory entries to retrieve (max 100) |
Search Directory Entries
GET/channels/{channel.id}/directory-entries/searchReturns a list of directory entry objects in the given directory channel that match the query. Requires the VIEW_CHANNEL permission.
Query String Parameters
| Field | Type | Description |
|---|---|---|
| query | string | The query to search for (1-100 characters) |
| type? | integer | The type of directory entry to filter by |
| category_id? | integer | The 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
| Field | Type | Description |
|---|---|---|
| type? | integer | The type of directory entry to create (default GUILD) |
| primary_category_id? | integer | The primary category of the entry (default UNCATEGORIZED) |
| description? | ?string | The 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
| Field | Type | Description |
|---|---|---|
| primary_category_id? | integer | The primary category of the entry |
| description? | string | The 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/broadcastReturns the broadcast information for the given guild and directory entry type. User must be a member of the guild.
Query String Parameters
| Field | Type | Description |
|---|---|---|
| type | integer | The type of directory entry to get broadcast info for |
| entity_id? | integer | The ID of the directory entry to get broadcast info for |
Response Body
| Field | Type | Description |
|---|---|---|
| can_broadcast | boolean | Whether the user can broadcast in any linked directory channels |
| has_broadcast? 1 | boolean | Whether the entity has been broadcasted in any directory channels |
1 Only included when entity_id is provided.