> ## Documentation Index
> Fetch the complete documentation index at: https://discord-platform-username.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Application Resource

> Reference for Discord application objects and management endpoints.

export const Route = ({method, children}) => {
  return <div className="MDXRoute">
      <span className={"verb" + " " + method.toLowerCase()}>{method}</span>
      <span className="url">{children}</span>
    </div>;
};

export const ManualAnchor = ({id}) => {
  return <div className="MDXManualAnchor" id={id}></div>;
};

[Applications](/developers/quick-start/overview-of-apps) (or "apps") are containers for developer platform features, and can be installed to Discord servers and/or user accounts.

### Application Object

<ManualAnchor id="application-object-application-structure" />

###### Application Structure

| Field                                    | Type                                                                                                                                        | Description                                                                                                                                                                                                                                      |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id                                       | snowflake                                                                                                                                   | ID of the app                                                                                                                                                                                                                                    |
| name                                     | string                                                                                                                                      | Name of the app                                                                                                                                                                                                                                  |
| icon                                     | ?string                                                                                                                                     | [Icon hash](/developers/reference#image-formatting) of the app                                                                                                                                                                                   |
| description                              | string                                                                                                                                      | Description of the app                                                                                                                                                                                                                           |
| rpc\_origins?                            | array of strings                                                                                                                            | List of RPC origin URLs, if RPC is enabled                                                                                                                                                                                                       |
| bot\_public                              | boolean                                                                                                                                     | When `false`, only the app owner can add the app to guilds                                                                                                                                                                                       |
| bot\_require\_code\_grant                | boolean                                                                                                                                     | When `true`, the app's bot will only join upon completion of the full OAuth2 code grant flow                                                                                                                                                     |
| bot?                                     | partial [user](/developers/resources/user#user-object) object                                                                               | Partial user object for the bot user associated with the app                                                                                                                                                                                     |
| terms\_of\_service\_url?                 | string                                                                                                                                      | URL of the app's Terms of Service                                                                                                                                                                                                                |
| privacy\_policy\_url?                    | string                                                                                                                                      | URL of the app's Privacy Policy                                                                                                                                                                                                                  |
| owner?                                   | partial [user](/developers/resources/user#user-object) object                                                                               | Partial user object for the owner of the app                                                                                                                                                                                                     |
| verify\_key                              | string                                                                                                                                      | Hex encoded key for verification in interactions and the GameSDK's [GetTicket](https://github.com/discord/discord-api-docs/blob/legacy-gamesdk/docs/game_sdk/Applications.md#getticket)                                                          |
| team                                     | ?[team](/developers/topics/teams#data-models-team-object) object                                                                            | If the app belongs to a team, this will be a list of the members of that team                                                                                                                                                                    |
| guild\_id?                               | snowflake                                                                                                                                   | Guild associated with the app. For example, a developer support server.                                                                                                                                                                          |
| guild?                                   | partial [guild](/developers/resources/guild#guild-object) object                                                                            | Partial object of the associated guild                                                                                                                                                                                                           |
| primary\_sku\_id?                        | snowflake                                                                                                                                   | If this app is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists                                                                                                                                    |
| slug?                                    | string                                                                                                                                      | If this app is a game sold on Discord, this field will be the URL slug that links to the store page                                                                                                                                              |
| cover\_image?                            | string                                                                                                                                      | App's default rich presence invite [cover image hash](/developers/reference#image-formatting)                                                                                                                                                    |
| flags?                                   | integer                                                                                                                                     | App's public [flags](/developers/resources/application#application-object-application-flags)                                                                                                                                                     |
| approximate\_guild\_count?               | integer                                                                                                                                     | Approximate count of guilds the app has been added to                                                                                                                                                                                            |
| approximate\_user\_install\_count?       | integer                                                                                                                                     | Approximate count of users that have installed the app (authorized with `application.commands` as a scope)                                                                                                                                       |
| approximate\_user\_authorization\_count? | integer                                                                                                                                     | Approximate count of users that have OAuth2 authorizations for the app                                                                                                                                                                           |
| redirect\_uris?                          | array of strings                                                                                                                            | Array of redirect URIs for the app                                                                                                                                                                                                               |
| interactions\_endpoint\_url?             | ?string                                                                                                                                     | [Interactions endpoint URL](/developers/interactions/receiving-and-responding#receiving-an-interaction) for the app                                                                                                                              |
| role\_connections\_verification\_url?    | ?string                                                                                                                                     | Role connection verification URL for the app                                                                                                                                                                                                     |
| event\_webhooks\_url?                    | ?string                                                                                                                                     | [Event webhooks URL](/developers/events/webhook-events#preparing-for-events) for the app to receive webhook events                                                                                                                               |
| event\_webhooks\_status?                 | [application event webhook status](/developers/resources/application#application-object-application-event-webhook-status)                   | If [webhook events](/developers/events/webhook-events) are enabled for the app. `1` (default) means disabled, `2` means enabled, and `3` means disabled by Discord                                                                               |
| event\_webhooks\_types?                  | array of strings                                                                                                                            | List of [Webhook event types](/developers/events/webhook-events#event-types) the app subscribes to                                                                                                                                               |
| tags?                                    | array of strings                                                                                                                            | List of tags describing the content and functionality of the app. Max of 5 tags.                                                                                                                                                                 |
| install\_params?                         | [install params](/developers/resources/application#install-params-object) object                                                            | Settings for the app's default in-app authorization link, if enabled                                                                                                                                                                             |
| integration\_types\_config?              | dictionary with keys of [application integration types](/developers/resources/application#application-object-application-integration-types) | Default scopes and permissions for each supported installation context. Value for each key is an [integration type configuration object](/developers/resources/application#application-object-application-integration-type-configuration-object) |
| custom\_install\_url?                    | string                                                                                                                                      | Default custom authorization URL for the app, if enabled                                                                                                                                                                                         |

<ManualAnchor id="application-object-example-application-object" />

###### Example Application Object

```json theme={null}
{
  "bot_public": true,
  "bot_require_code_grant": false,
  "cover_image": "31deabb7e45b6c8ecfef77d2f99c81a5",
  "description": "Test",
  "guild_id": "290926798626357260",
  "icon": null,
  "id": "172150183260323840",
  "integration_types_config": {
    "0": {
      "oauth2_install_params": {
        "scopes": [
          "applications.commands",
          "bot"
        ],
        "permissions": "2048"
      }
    },
    "1": {
      "oauth2_install_params": {
        "scopes": [
          "applications.commands"
        ],
        "permissions": "0"
      }
    }
  },
  "name": "Baba O-Riley",
  "interactions_endpoint_url": null,
  "role_connections_verification_url": null,
  "event_webhooks_url": null,
  "event_webhooks_status": 1,
  "owner": {
    "avatar": null,
    "discriminator": "1738",
    "flags": 1024,
    "id": "172150183260323840",
    "username": "i own a bot"
  },
  "primary_sku_id": "172150183260323840",
  "slug": "test",
  "team": {
    "icon": "dd9b7dcfdf5351b9c3de0fe167bacbe1",
    "id": "531992624043786253",
    "members": [
      {
        "membership_state": 2,
        "permissions": ["*"],
        "team_id": "531992624043786253",
        "user": {
          "avatar": "d9e261cd35999608eb7e3de1fae3688b",
          "discriminator": "0001",
          "id": "511972282709709995",
          "username": "Mr Owner"
        }
      }
    ]
  },
  "verify_key": "1e0a356058d627ca38a5c8c9648818061d49e49bd9da9e3ab17d98ad4d6bg2u8"
}
```

<ManualAnchor id="application-object-application-integration-types" />

###### Application Integration Types

Where an app can be installed, also called its supported [installation contexts](/developers/resources/application#installation-context).

| Type            | ID | Description                   |
| --------------- | -- | ----------------------------- |
| `GUILD_INSTALL` | 0  | App is installable to servers |
| `USER_INSTALL`  | 1  | App is installable to users   |

<ManualAnchor id="application-object-application-integration-type-configuration-object" />

###### Application Integration Type Configuration Object

| Field                    | Type                                                                             | Description                                                                      |
| ------------------------ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| oauth2\_install\_params? | [install params object](/developers/resources/application#install-params-object) | Install params for each installation context's default in-app authorization link |

<ManualAnchor id="application-object-application-event-webhook-status" />

###### Application Event Webhook Status

Status indicating whether event webhooks are enabled or disabled for an application.

| Name                  | Value | Description                                                       |
| --------------------- | ----- | ----------------------------------------------------------------- |
| `DISABLED`            | `1`   | Webhook events are disabled by developer                          |
| `ENABLED`             | `2`   | Webhook events are enabled by developer                           |
| `DISABLED_BY_DISCORD` | `3`   | Webhook events are disabled by Discord, usually due to inactivity |

<ManualAnchor id="application-object-application-flags" />

###### Application Flags

| Value     | Name                                               | Description                                                                                                                                                                                                                                                         |
| --------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `1 << 6`  | APPLICATION\_AUTO\_MODERATION\_RULE\_CREATE\_BADGE | Indicates if an app uses the [Auto Moderation API](/developers/resources/auto-moderation)                                                                                                                                                                           |
| `1 << 12` | GATEWAY\_PRESENCE                                  | Intent required for bots in **100 or more servers** to receive [`presence_update` events](/developers/events/gateway-events#presence-update)                                                                                                                        |
| `1 << 13` | GATEWAY\_PRESENCE\_LIMITED                         | Intent required for bots in under 100 servers to receive [`presence_update` events](/developers/events/gateway-events#presence-update), found on the **Bot** page in your app's settings                                                                            |
| `1 << 14` | GATEWAY\_GUILD\_MEMBERS                            | Intent required for bots in **100 or more servers** to receive member-related events like `guild_member_add`. See the list of member-related events [under `GUILD_MEMBERS`](/developers/events/gateway#list-of-intents)                                             |
| `1 << 15` | GATEWAY\_GUILD\_MEMBERS\_LIMITED                   | Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found on the **Bot** page in your app's settings. See the list of member-related events [under `GUILD_MEMBERS`](/developers/events/gateway#list-of-intents) |
| `1 << 16` | VERIFICATION\_PENDING\_GUILD\_LIMIT                | Indicates unusual growth of an app that prevents verification                                                                                                                                                                                                       |
| `1 << 17` | EMBEDDED                                           | Indicates if an app is embedded within the Discord client (currently unavailable publicly)                                                                                                                                                                          |
| `1 << 18` | GATEWAY\_MESSAGE\_CONTENT                          | Intent required for bots in **100 or more servers** to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)                                                                                                                   |
| `1 << 19` | GATEWAY\_MESSAGE\_CONTENT\_LIMITED                 | Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055), found on the **Bot** page in your app's settings                                                                       |
| `1 << 23` | APPLICATION\_COMMAND\_BADGE                        | Indicates if an app has registered global [application commands](/developers/interactions/application-commands)                                                                                                                                                     |

### Install Params Object

<ManualAnchor id="install-params-object-install-params-structure" />

###### Install Params Structure

| Field       | Type             | Description                                                                                                  |
| ----------- | ---------------- | ------------------------------------------------------------------------------------------------------------ |
| scopes      | array of strings | [Scopes](/developers/topics/oauth2#shared-resources-oauth2-scopes) to add the application to the server with |
| permissions | string           | [Permissions](/developers/topics/permissions) to request for the bot role                                    |

## Installation Context

An app's installation context defines how it's installed: to a server, to a user, or both.

The installation context affects how your app can be seen and used within Discord. For example, apps installed only to a user can't take actions in a server, and apps installed only to a server can't be accessed within a user's DMs.

#### Server Context

Apps installed in a server context (server-installed apps) must be authorized by a server member with the [`MANAGE_GUILD`](/developers/topics/permissions#permissions-bitwise-permission-flags) permission. Server-installed apps are *visible* to all members of the server, but other factors (like [command permissions](/developers/interactions/application-commands#permissions)) determine where and when specific members can interact with the app.

During installation, server-installed apps are authorized with a specific set of [OAuth2 scopes](/developers/topics/oauth2#shared-resources-oauth2-scopes) and [bot user permissions](/developers/topics/permissions) that determine what resources and data the app can access in that server.

#### User Context

Apps installed in a user context (user-installed apps) are visible *only* to the authorizing user, and therefore don't require any server-specific permissions.

Apps that support the user installation context are visible across all of an authorizing user's servers, DMs, and GDMs, but are forced to respect the user's permissions in the surface where the app is being used. For example, if a user invokes a command for a user-installed app from a server's channel where they don't have permission to send messages, the app won't be able to [respond to an interaction](/developers/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type) with a non-ephemeral message. Details about how the installation context of a command affects interactions is in the [interaction context](/developers/interactions/application-commands#interaction-contexts) documentation.

### Setting Supported Installation Contexts

By default, newly-created apps only support installation to guilds.

You can update which installation contexts your app supports in your [app's settings](https://discord.com/developers/applications). On the [**Installation** page](https://discord.com/developers/applications/select/installation) under the **Installation Contexts** section, you can select the installation contexts your app supports.

<Info>
  If you update your app to support a new installation context, you will need to update your existing [commands](/developers/interactions/application-commands#contexts) if you want them to be supported in the new context. Details are in the [Application Command](/developers/interactions/application-commands#contexts) documentation.
</Info>

## Install Links

Install links provide an easy way for users to install your app in Discord. If you have an install link configured, an "Add App" button will appear in your app's profile and App Directory page which will guide the user through your app's installation flow.

### Types of Install Links

There are three options when configuring an install link for your app: "Discord Provided Link", "Custom URL", and "None". If you don't configure an install link (by selecting "None"), the "Add App" button will not appear for your app, and your app will not be eligible for the App Directory.

<Info>
  Note that install links are distinct from OAuth2 flows like the [authorization code grant](/developers/topics/oauth2#authorization-code-grant), which may additionally be required if you need to request user-specific [scopes](/developers/topics/oauth2#shared-resources-oauth2-scopes) like `identify` or `role_connections.write`.
</Info>

#### Discord Provided Link

The default Discord Provided Link is a short link that guides users through the installation flow with your app's [configured installation contexts](/developers/resources/application#setting-supported-installation-contexts). If your app has both **User Install** and **Guild Install** enabled, the user can choose which way to install your app.

Discord Provided Links don't have scopes or bot user permissions defined in the URL. For example:

```
https://discord.com/oauth2/authorize?client_id=1234567895647001626
```

Instead, these links will prompt the user for the scopes and bot user permissions configured in your Default Install Settings.

<Info>
  Discord Provided Links are limited to the `application.commands` and `bot` scopes
</Info>

#### Custom URL

A Custom URL is an alternative to the Discord Provided Link that gives you more control of where users are directed when they click "Add App" on your app's profile or App Directory page.

A Custom URL doesn't have strict limitations, but is commonly an [OAuth2 `/authorize` URL](/developers/topics/oauth2#shared-resources-oauth2-urls) that has defined scopes, permissions, and an installation context (`integration_type`).

### Configuring an Install Link and Default Install Settings

You can configure your app's install link in your [app's settings](https://discord.com/developers/applications). On the [**Installation** page](https://discord.com/developers/applications/select/installation), go to the **Install Link** section, and select which type of install link you want for your app. For most apps, we recommend the Discord Provided Link.

The Default Install Settings will appear on the [**Installation** page](https://discord.com/developers/applications/select/installation) when you have "Discord Provided Link" selected as your install link type.

## Get Current Application

<Route method="GET">/applications/@me</Route>

Returns the [application](/developers/resources/application#application-object) object associated with the requesting bot user.

## Edit Current Application

<Route method="PATCH">/applications/@me</Route>

Edit properties of the app associated with the requesting bot user. Only properties that are passed will be updated. Returns the updated [application](/developers/resources/application#application-object) object on success.

<Note>
  All parameters to this endpoint are optional.
</Note>

<ManualAnchor id="edit-current-application-json-params" />

###### JSON Params

| Field                                | Type                                                                                                                                        | Description                                                                                                                                                                                                                                      |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| custom\_install\_url                 | string                                                                                                                                      | Default custom authorization URL for the app, if enabled                                                                                                                                                                                         |
| description                          | string                                                                                                                                      | Description of the app                                                                                                                                                                                                                           |
| role\_connections\_verification\_url | string                                                                                                                                      | Role connection verification URL for the app                                                                                                                                                                                                     |
| install\_params                      | [install params](/developers/resources/application#install-params-object) object                                                            | Settings for the app's default in-app authorization link, if enabled                                                                                                                                                                             |
| integration\_types\_config           | dictionary with keys of [application integration types](/developers/resources/application#application-object-application-integration-types) | Default scopes and permissions for each supported installation context. Value for each key is an [integration type configuration object](/developers/resources/application#application-object-application-integration-type-configuration-object) |
| flags \*                             | integer                                                                                                                                     | App's public [flags](/developers/resources/application#application-object-application-flags)                                                                                                                                                     |
| icon                                 | ?[image data](/developers/reference#image-data)                                                                                             | Icon for the app                                                                                                                                                                                                                                 |
| cover\_image                         | ?[image data](/developers/reference#image-data)                                                                                             | Default rich presence invite cover image for the app                                                                                                                                                                                             |
| interactions\_endpoint\_url \*\*     | string                                                                                                                                      | [Interactions endpoint URL](/developers/interactions/receiving-and-responding#receiving-an-interaction) for the app                                                                                                                              |
| tags                                 | array of strings                                                                                                                            | List of tags describing the content and functionality of the app (max of 20 characters per tag). Max of 5 tags.                                                                                                                                  |
| event\_webhooks\_url                 | string                                                                                                                                      | [Event webhooks URL](/developers/events/webhook-events#preparing-for-events) for the app to receive webhook events                                                                                                                               |
| event\_webhooks\_status              | [application event webhook status](/developers/resources/application#application-object-application-event-webhook-status)                   | If [webhook events](/developers/events/webhook-events) are enabled for the app. `1` to disable, and `2` to enable                                                                                                                                |
| event\_webhooks\_types               | array of strings                                                                                                                            | List of [Webhook event types](/developers/events/webhook-events#event-types) to subscribe to                                                                                                                                                     |

\* Only limited intent flags (`GATEWAY_PRESENCE_LIMITED`, `GATEWAY_GUILD_MEMBERS_LIMITED`, and `GATEWAY_MESSAGE_CONTENT_LIMITED`) can be updated via the API.

\*\* To update an Interactions endpoint URL via the API, the URL must be valid according to the [Receiving an Interaction](/developers/interactions/receiving-and-responding#receiving-an-interaction) documentation.

## Get Application Activity Instance

<Route method="GET">/applications/[\{application.id}](/developers/resources/application#application-object)/activity-instances/[\{instance\_id}](/developers/resources/application#get-application-activity-instance-activity-instance-object)</Route>

Returns a serialized activity instance, if it exists. Useful for [preventing unwanted activity sessions](/developers/activities/development-guides/multiplayer-experience#preventing-unwanted-activity-sessions).

<ManualAnchor id="get-application-activity-instance-example-activity-instance" />

###### Example Activity Instance

```json theme={null}
{
  "application_id": "1215413995645968394",
  "instance_id": "i-1276580072400224306-gc-912952092627435520-912954213460484116",
  "launch_id": "1276580072400224306",
  "location": {
    "id": "gc-912952092627435520-912954213460484116",
    "kind": "gc",
    "channel_id": "912954213460484116",
    "guild_id": "912952092627435520"
  },
  "users": ["205519959982473217"],
}
```

<ManualAnchor id="get-application-activity-instance-activity-instance-object" />

###### Activity Instance Object

| Field           | Type                                                                                                              | Description                                                                                                           |
| --------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| application\_id | snowflake                                                                                                         | [Application](/developers/resources/application#application-object) ID                                                |
| instance\_id    | string                                                                                                            | Activity [Instance](/developers/activities/development-guides/multiplayer-experience#activity-instance-management) ID |
| launch\_id      | snowflake                                                                                                         | Unique identifier for the launch                                                                                      |
| location        | [Activity Location](/developers/resources/application#get-application-activity-instance-activity-location-object) | Location the instance is running in                                                                                   |
| users           | array of snowflakes, [user](/developers/resources/user#user-object) IDs                                           | IDs of the Users currently connected to the instance                                                                  |

<ManualAnchor id="get-application-activity-instance-activity-location-object" />

###### Activity Location Object

The Activity Location is an object that describes the location in which an activity instance is running.

| Field       | Type                                                                                                                           | Description                                                       |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- |
| id          | string                                                                                                                         | Unique identifier for the location                                |
| kind        | [Activity Location Kind Enum](/developers/resources/application#get-application-activity-instance-activity-location-kind-enum) | Enum describing kind of location                                  |
| channel\_id | snowflake                                                                                                                      | ID of the [Channel](/developers/resources/channel#channel-object) |
| guild\_id?  | ?snowflake                                                                                                                     | ID of the [Guild](/developers/resources/guild#guild-object)       |

<ManualAnchor id="get-application-activity-instance-activity-location-kind-enum" />

###### Activity Location Kind Enum

| Enum | Description                                        |
| ---- | -------------------------------------------------- |
| 'gc' | Location is a Guild Channel                        |
| 'pc' | Location is a Private Channel, such as a DM or GDM |
