Skip to main content

Portal & Authorization

Creating an application

Before you can access any of the API endpoints, you need to create your app in our developer portal and obtain its API Token.

Please follow these steps to create an application:

  1. To access the developer portal, please visit the Dashboard.
  2. On the guild selection page, scroll all way down to the bottom and click Developer Portal.
  3. Click the blue New app button.
  4. Please enter your application's name and add a URL to your app's hosted logo. Both should be easily recognizable to your users to simplify subsequent authorization processes.
  5. Please select if the app should be private. Private apps can only be added to guilds by the owner of the app.
  6. Hit Save.

Congratulations, you created your first app in our system! An API token has been generated for you, and you can reveal or copy it by clicking the respective buttons in your app box.

Authorizing your app

To allow your application to access any data, it must, in any case, be authorized by each guild you want to access. If you want to perform actions on behalf of users, you need their authorization as well.

Let's have a look at both cases.

Authorizing an app on a guild

To access a guild and its users' data, it's required that the guild's administrators opt into that access. You can request this consent by forwarding a guild administrator to an Authorization Page, which looks very much like a simplified OAuth page.

To generate a link to this page for your app, please follow these steps:

  1. Click the button Create authorization link in your app box - this will spawn a small helper tool to create an authorization link for you.
  2. Leave the selector at the top on Guild.
  3. Choose the permissions your app needs to work. Do not request more permissions than you need to make a reputable impression to our users. If you need more permissions, you can later route the admins through the authorization page again. Don't be greedy.
  4. Copy the link at the bottom. You can use the same link for all guild authorization flows as the admins can select which server they want to authorize on the Authorization Page.

The Authorization Page will look like this and help our users understand what data your app can access and which actions it can perform. If they agree with your request, they only need to click the Authorize button, and your API token is immediately authorized to access the requested endpoints for that guild.

Auth page

Checking your app's status

We provide an endpoint to get your app main base data and a list of guilds it's authorized on, alongside with its respective permissions on each of them.

Like all API requests, this request must be authenticated. Please refer to Authentication to learn more.

GET
Get app data
https://yunite.xyz/api/v3/app
Query Parameters
NameValue typeDescription
withGuildNamesboolean as stringSet to true if you want to receive guild names and avatars with your response; do not add it or set to false if guild IDs are enough. Note that enabling this will significantly slow down your request

You can remove a guild from your app by un-authorizing it. Note that this is not permanent, unlike a ban - imagine it like a kick.

POST
Deauthorize a guild
https://yunite.xyz/api/v3/app/deauthorize?guildId={guildId}Query Parameters
NameValue typeDescription
guildIdsnowflake as stringThe id of the guild you want to remove from your app

It will respond with code 200 if the guild was removed or 404 if the guild has not authorized your app.

Authorizing an app to perform actions on behalf of users

To act on behalf of a user, every user you want to do this must opt into these operations. The flow is extremely similar to authorizing a guild. Please follow the steps above again, but change the selector mentioned in step 2 to User. Then, you can again choose the required permissions and copy the link. That link will be the same for all users as they need to authenticate themselves with their Discord account beforehand.

Auth page