Integration Resource

Integrations represent a connection between a service and a guild. This may include third-party services such as Twitch or YouTube, Discord-housed integrations such as bots, or internal integrations such as role subscriptions.

Integration Object

Integration Structure
FieldTypeDescription
id 1snowflakeThe ID of the integration
namestringThe name of the integration
typestringThe type of integration
enabledbooleanWhether this integration is enabled
accountintegration account objectIntegration account information
syncing? 2booleanWhether this integration is syncing
role_id? 2snowflakeRole ID that this integration uses for subscribers
enable_emoticons? 2booleanWhether emoticons should be synced for this integration (Twitch only)
expire_behavior? 2integerThe behavior of expiring subscribers
expire_grace_period? 2integerThe grace period before expiring subscribers (one of 1, 3, 7, 14, 30, in days)
synced_at? 2ISO8601 timestampWhen this integration was last synced
subscriber_count? 2integerHow many subscribers this integration has
revoked? 2booleanWhether this integration has been revoked
application? 3integration application objectThe integrated OAuth2 application
scopes? 3array[string]The scopes the application has been authorized with
role_connections_metadata 3 4array[application role connection metadata object]The metadata that the application has set for role connections
user? 5partial user objectThe user that added this integration

1 This field may also be the literal string "twitch-partners" to represent the Twitch Partners integration.

2 Only provided for Twitch and YouTube integrations.

3 Only provided for Discord application integrations.

4 Only included when fetched from Get Guild Integrations with include_role_connections_metadata set to true.

5 Only included for integrations when fetched through the Get Guild Integrations endpoint. Some older or internally-created integrations may not have an attached user.

Integration Type
ValueName
twitchTwitch integration
youtubeYouTube integration
discordDiscord application integration
guild_subscriptionInternal role subscription integration
Integration Expire Behavior
ValueNameDescription
0REMOVE_ROLERemove the subscriber role from the user on expiration
1KICKRemove the user from the guild on expiration
Integration Account Structure
FieldTypeDescription
idstringThe ID of the account
namestringThe name of the account

Integration Application Object

Integration Application Structure
FieldTypeDescription
idsnowflakeThe ID of the application
namestringThe name of the application
descriptionstringThe description of the application
icon?stringThe application's icon hash
cover_image?stringThe application's default rich presence invite cover image hash
splash?stringThe application's splash hash
type?integerThe type of the application, if any
primary_sku_id?snowflakeThe ID of the application's primary SKU (game, application subscription, etc.)
bot?partial user objectThe bot attached to this application
deeplink_uri??stringThe URL used for deep linking during OAuth2 authorization on mobile devices
third_party_skus?array[application SKU object]The third party SKUs of the application's game
role_connections_verification_url? 1?stringThe role connection verification entry point of the integration; when configured, this will render the application as a verification method in guild role verification configuration
is_verifiedbooleanWhether the application is verified
is_discoverablebooleanWhether the application is discoverable in the application directory
is_monetizedbooleanWhether the application has monetization enabled

1 Only present when fetched from the Get Guild Integrations endpoint with include_role_connections_metadata set to true.

Integration Guild Object

Integration Guild Structure
FieldTypeDescription
idsnowflakeThe ID of the guild
namestringTThe name of the guild (2-100 characters)
icon?stringThe guild's icon hash

GIF Object

GIF Structure
FieldTypeDescription
idstringThe ID of the GIF
title (deprecated)stringThe title of the GIF
urlstringThe provider source URL of the GIF
srcstringThe media URL of the GIF in the requested format
gif_srcstringThe media URL of the GIF in GIF format
previewstringA preview image of the GIF
widthintegerWidth of image
heightintegerHeight of image
GIF Media Format
ValueDescription
mp4MP4 video
tinymp4MP4 video in a smaller size
nanomp4MP4 video in a very small size
loopedmp4MP4 video that loops (same as mp4)
webmWebM video
tinywebmWebM video in a smaller size
nanowebmWebM video in a very small size
gifGIF image
mediumgifGIF image in a medium size
tinygifGIF image in a smaller size
nanogifGIF image in a very small size
Example GIF
{
"id": "12409989992265318124",
"title": "",
"url": "https://tenor.com/view/tasha-steelz-gif-25509948",
"src": "https://media.tenor.com/rDkkJaMgfuwAAAP4/tasha-steelz.webm",
"gif_src": "https://media.tenor.com/rDkkJaMgfuwAAAAC/tasha-steelz.gif",
"width": 150,
"height": 84,
"preview": "https://media.tenor.com/rDkkJaMgfuwAAAAD/tasha-steelz.png"
}

Endpoints

Get Guild Integrations

GET/guilds/{guild.id}/integrations

Returns a list of integration objects for the guild. Requires the MANAGE_GUILD permission.

Query String Parameters
FieldTypeDescription
has_commands?booleanWhether to only include Discord application integrations with registered commands (default false)
include_role_connections_metadata?booleanWhether to include integration role connection metadata (default false)

{/ TODO: Figure out whether all of these do actually support audit reasons /}

Enable Guild Integration

POST/guilds/{guild.id}/integrations

Enables an integration for the guild. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires Guild Integrations Update and Integration Create Gateway events.

JSON Parameters
FieldTypeDescription
typestringThe type of integration to enable
idsnowflakeThe ID of the integration to enable

Sync Guild Integration

POST/guilds/{guild.id}/integrations/{integration.id}/sync

Syncs an integration for the guild. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires Guild Integrations Update and Integration Update Gateway events.

Modify Guild Integration

PATCH/guilds/{guild.id}/integrations/{integration.id}

Modifies the behavior and settings of the integration in the guild. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires Guild Integrations Update and Integration Update Gateway events.

JSON Parameters
FieldTypeDescription
expire_behavior?integerThe behavior of expiring subscribers
expire_grace_period?integerThe grace period before expiring subscribers (one of 1, 3, 7, 14, 30, in days)
enable_emoticons?booleanWhether emoticons should be synced for this integration (Twitch only)

Delete Guild Integration

DELETE/guilds/{guild.id}/integrations/{integration.id}

Removes the given integration ID from the guild. Deletes any associated webhooks and kicks the associated bot (if there is one). Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires Guild Integrations Update, Integration Delete, and optionally Guild Member Remove and Webhooks Update Gateway events.

Migrate Guild Command Scope

POST/guilds/{guild.id}/migrate-command-scope

Migrates all Discord application integrations in the guild to the applications.commands OAuth2 scope. Requires the MANAGE_GUILD permission. Fires a Guild Integrations Update and multiple Integration Update Gateway events.

Response Body
FieldTypeDescription
integration_ids_with_app_commandsarray[snowflake]The IDs of migrated integrations that now have application commands registered

Get Guild Integration Application IDs

GET/users/@me/guilds/integration-application-ids

Returns a mapping of guild IDs to lists of application IDs attached to the integrations in the current user's guilds.

Example Response
{
"81384788765712384": [
"157858575924985856",
"157889000391180288",
"157873248346832897",
"157947794294833152",
"173805066229252096"
],
"1046920999469330512": []
}

Get Channel Integrations

GET/channels/{channel.id}/integrations

Returns a list of integration objects for the private channel.

Delete Channel Integration

DELETE/channels/{channel.id}/integrations/{integration.id}

Removes the given integration ID from the channel. Returns a 204 empty response on success. Fires an Integration Delete Gateway event.

Join Integration Guild

POST/integrations/{integration.id}/join

Joins the user to the given integration ID's guild. Returns a 204 empty response on success. Fires a Guild Create Gateway event.

Search Tenor GIFs

GET/integrations/tenor/search

Returns a list of up to 10 GIFs sourced from Tenor based on the provided query.

Query String Parameters
FieldTypeDescription
qstringThe search query to use
Tenor GIF Structure
FieldTypeDescription
typestringThe type of the GIF (always gif)
urlstringThe provider source URL of the GIF
srcstringThe media URL of the GIF
widthintegerWidth of image
heightintegerHeight of image
Example Response
[
{
"type": "gif",
"url": "https://tenor.com/bQ3Du.gif",
"src": "https://media.tenor.com/RbG_9Eh9KLoAAAAS/alien-alien-reveal.gif",
"width": 100,
"height": 90
}
]
GET/gifs/trending-search

Returns a list of the top trending search terms.

Query String Parameters
FieldTypeDescription
limit? 1integerThe maximum number of search terms to return (1-50, default 5)
locale?stringThe locale to use in search results (default en-US)

1 The limit is only a suggestion; the API may return fewer GIFs.

Get Suggested GIF Search Terms

GET/gifs/suggest

Returns a list of recommended search terms based on the provided query.

Query String Parameters
FieldTypeDescription
qstringThe search query to use
limit? 1integerThe maximum number of search terms to return (1-50, default 20)
locale?stringThe locale to use in search results (default en-US)

1 The limit is only a suggestion; the API may return fewer GIFs.

Search GIFs

GET/gifs/search

Returns a list of GIF objects based on the provided query.

Query String Parameters
FieldTypeDescription
qstringThe search query to use
limit? 1integerThe maximum number of GIFs to return (20-500)
media_format?stringThe media format to use (default mediumgif)
locale?stringThe locale to use in search results (default en-US)

1 The limit is only a suggestion; the API may return fewer GIFs.

GET/gifs/trending

Returns trending GIF categories and their associated preview GIFs.

Query String Parameters
FieldTypeDescription
media_format?stringThe media format to use (default mediumgif)
locale?stringThe locale to use in search results (default en-US)
Response Body
FieldTypeDescription
categoriesarray[GIF category object]The trending GIF categories
gifsarray[GIF object]A trending GIF to use as a placeholder
GIF Category Structure
FieldTypeDescription
namestringThe name of the category
srcstringThe media URL of a preview GIF
Example Response
{
"categories": [
{
"name": "whatever",
"src": "https://media.tenor.com/97c0UK_cAHMAAAAd/whatever-sassy.gif"
}
],
"gifs": [
{
"id": "16750982996130936929",
"title": "",
"url": "https://tenor.com/view/peace-out-peace-sign-peace-ice-age-eddie-gif-16750982996130936929",
"src": "https://media.tenor.com/6HdySNL-OGEAAAAC/peace-out-peace-sign.gif",
"gif_src": "https://media.tenor.com/6HdySNL-OGEAAAAC/peace-out-peace-sign.gif",
"width": 498,
"height": 498,
"preview": "https://media.tenor.com/6HdySNL-OGEAAAAD/peace-out-peace-sign.png"
}
]
}
GET/gifs/trending-gifs

Returns a list of GIF objects that are currently trending.

Query String Parameters
FieldTypeDescription
limit? 1integerThe maximum number of GIFs to return (20-500)
media_format?stringThe media format to use (default mediumgif)
locale?stringThe locale to use in search results (default en-US)

1 The limit is only a suggestion; the API may return fewer GIFs.

Track Selected GIF

POST/gifs/select

Tracks the selection of a GIF by the user. Returns a 204 empty response on success.

JSON Parameters
FieldTypeDescription
idstringThe ID of the selected GIF
qstringThe search query used to find the GIF