Skip to content
FiveCord Docs

Applications

An application is an OAuth2 client owned by one user account, and every bot account is registered under one. A user owns at most 25. The authorisation code grant, the scope registry, and the tokens issued to third-party clients belong to the OAuth2 resource.

Every route except Get public application requires a credential. A user-only route rejects a bot token and an OAuth2 bearer with 403 ACCESS_DENIED. Every route on this page accepts an account that has an outstanding required action.

The sudo-gated routes read X-FiveCord-Sudo-Mode-JWT. A valid sudo token in that header, issued to the authenticated account, satisfies sudo mode with no body proof. FiveCord returns the same token in the X-FiveCord-Sudo-Mode-JWT response header. FiveCord issues no token to an account holding neither a TOTP secret nor a registered WebAuthn credential, so that account proves sudo mode with password in the body.

A bucket whose name ends in ::client_id gives the authenticated user one allowance. Requests for every application that user owns count against that one allowance. List owned applications, Get current application, Get application, Get public application, and List OAuth2 authorisations all draw on one oauth_dev:clients:list allowance. Get bot application draws on the same bucket, keyed by the bot account the token names. That allowance is separate from the owner’s.

The application record as its owner sees it.

FieldTypeDescription
idsnowflakeThe ID of the application
namestringThe name of the application (1-100 characters)
redirect_uris1array[string]The redirect URIs registered for the application
bot_publicbooleanWhether any eligible user can install the bot
bot_require_code_grantbooleanWhether bot installation requires an OAuth2 code grant
client_secret?2stringThe client secret that authenticates token exchange, introspection, and revocation
bot?3application bot objectThe bot account the application owns

1 Always emitted, and an empty array when the application has registered none. Create application and Update application accept at most 10 entries

2 Present only in the response to Create application and Reset client secret, which are the only operations that issue one

3 Present in every response except Reset client secret, and absent for an application that owns no bot account or whose bot account record can no longer be read

{
"id": "1501314428688998182",
"name": "Party Parrot",
"redirect_uris": ["https://example.com/callback"],
"bot_public": true,
"bot_require_code_grant": false
}

The bot account an application owns. Create application creates exactly one bot account with the application, so the bot user snowflake always equals the application ID.

FieldTypeDescription
idsnowflakeThe ID of the bot user, always equal to the application ID
usernamestringThe username of the bot account, 1 to 32 ASCII letters, digits, or underscores
discriminatorstringThe discriminator of the bot account, always four decimal digits with leading zeroes
avatar?1 2?stringThe avatar hash of the bot account, or null when none is stored
banner?1 2?stringThe banner hash of the bot account, or null when none is stored
bio?stringThe profile biography of the bot account, or null when none is stored
token?3stringThe bot token issued for the account
mfa_enabled?4booleanWhether the bot account has an authenticator configured
authenticator_types?4array[integer]The authenticator types configured on the bot account
flags5integerBot flags

1 Declared optional by the schema and always emitted

2 An animated hash retains its a_ prefix, which is the animation indicator for this object. A bot account always holds the animated avatar and animated banner entitlements, so neither hash is ever stripped or suppressed

3 Present only in the response to Create application. Reset bot token returns the new token in the parent bot token reset object instead

4 Declared optional by the schema and always emitted, except on the public application object, which omits both. authenticator_types is an empty array when the account has no authenticator, and mfa_enabled is true exactly when that array is not empty

5 The bitfield is the account’s public user flags, and Update bot profile sets only the bot flags in it

An invalid bot token returns the same error whether or not its application exists.

The application as any caller sees it, including a caller that presents no credential.

FieldTypeDescription
idsnowflakeThe ID of the application
namestringThe name of the application
icon1?stringThe avatar hash of the bot account, used as the application icon
description?stringAlways null on this object
redirect_urisarray[string]The redirect URIs registered for the application
scopes2array[string]OAuth2 scopes the application can currently be authorised for
bot_public3booleanWhether the requester can install the bot
bot4?application bot objectThe bot account the application owns
current_user?5?partial user objectThe requesting account

1 Null when the application has no bot account or that account has no avatar. Otherwise it is the bot account’s stored avatar hash, and an animated hash keeps its a_ prefix

2 Contains bot when the application owns a bot account, and is otherwise empty

3 Reported as true for the application owner even when the bot is not public

4 Null when the application has no bot account. Its token, mfa_enabled, and authenticator_types are never set here

5 Declared optional by the schema and always emitted, and null when the request has no credential that resolves to an account

The application that issued the requesting bot token, as returned to that token.

FieldTypeDescription
idsnowflakeThe ID of the application
namestringThe name of the application
icon1?stringThe avatar hash of the bot account, used as the application icon
description1?stringThe biography of the bot account, used as the application description
bot_publicbooleanWhether any eligible user can install the bot
bot_require_code_grantbooleanWhether bot installation requires an OAuth2 code grant
verify_key2stringA compatibility placeholder
owner3partial user objectThe account that owns the application
bot?4application bot objectThe bot account the application owns
redirect_uris?5array[string]The redirect URIs registered for the application

1 Read from the bot account, so it changes with Update bot profile, and it is null when the application has no bot account

2 Always 64 0 characters, because no application signing key is available

3 The request fails with 401 INVALID_TOKEN when the owning account no longer exists

4 Absent when the application has no bot account, and its token is never set here

5 Declared optional by the schema and always emitted, and an empty array when the application has registered no redirect URI

The bot account’s profile fields after an update. Update bot profile is the only operation that returns this shape. The object has no token field.

FieldTypeDescription
idsnowflakeThe ID of the bot user
usernamestringThe username of the bot account
discriminatorstringThe discriminator of the bot account, always four decimal digits with leading zeroes
avatar1?stringThe avatar hash of the bot account, or null when none is stored
banner1?stringThe banner hash of the bot account, or null when none is stored
bio?stringThe profile biography of the bot account, or null when none is stored
flagsintegerBot flags

1 An animated hash retains its a_ prefix, which is the animation indicator for this object. A bot account’s stored banner is never suppressed

ValueNameDescription
1 << 4FRIENDLY_BOTThe bot accepts friend requests from users
1 << 5FRIENDLY_BOT_MANUAL_APPROVALThe bot requires manual approval for friend requests

These bits are a subset of the account’s public user flags, so a bot account that also has STAFF, PARTNER, BUG_HUNTER, or SPAMMER reports that bit in the same field. A client MUST ignore a bit it does not recognise.

The response to Reset bot token.

FieldTypeDescription
tokenstringThe newly issued bot token
bot1application bot objectThe bot account the token belongs to

1 The nested object omits its own token member

GET/v1/users/@me/applications

Returns every application object the current user owns.

StatusBodyCondition
200array[application object]The applications were returned
403error responseThe credential is a bot or bearer token (ACCESS_DENIED)

The listing is unpaginated because one user can own at most 25 applications. No entry has a client secret or bot token. The built-in FiveCord Admin application belongs to the system account and never appears here.

60 requests per minute for each authenticated user, on the oauth_dev:clients:list bucket.

GET/v1/oauth2/applications/@meBot

Returns the caller’s own applications, selected by credential type. A user session returns the same array as List owned applications. A bot token returns the current bot application object for the application that issued the token.

An OAuth2 bearer credential is rejected.

StatusBodyCondition
200array[application object] | current bot application objectThe current application data was returned
401error responseAuthentication is missing or invalid (UNAUTHORIZED)
401error responseThe presented bot token belongs to an application whose owner account no longer exists (INVALID_TOKEN)
403error responseThe credential is a bearer token (ACCESS_DENIED)

60 requests per minute for each authenticated user, on the oauth_dev:clients:list bucket.

GET/v1/applications/@meBot

Returns the current bot application object for the application that issued the presented bot token. The route accepts only the Bot scheme in the Authorization header.

StatusBodyCondition
200current bot application objectThe application was returned
401error responseThe header is absent or does not use the Bot scheme (INVALID_TOKEN)
401error responseThe header does not resolve to a live bot token (INVALID_TOKEN)
401error responseThe token names an application or owner account that no longer exists (INVALID_TOKEN)

Every rejection reports the same INVALID_TOKEN, so a caller cannot distinguish a malformed credential from a valid secret whose application has since been deleted.

60 requests per minute for each authenticated account, or for each client IP address when no account resolved, on the oauth_dev:clients:list bucket.

GET/v1/oauth2/applications/{id}/publicUnauthenticated

Returns the public application object for any application. Authentication is not required. A credential that resolves to an account also sets current_user, and one that resolves to the application owner reports bot_public as true even when the bot is not public.

FieldTypeDescription
idsnowflakeThe ID of the application
StatusBodyCondition
200public application objectThe application was returned
400error responseThe application ID is not a valid snowflake
404error responseThe application does not exist (UNKNOWN_APPLICATION)

This representation exposes the full registered redirect URI list and the bot profile to anonymous callers. It has no client secret, no bot token, no owner identity, and nothing about the owner’s MFA enrolment. An application owner should not register a redirect URI whose hostname is itself sensitive.

60 requests per minute for each authenticated user, or for each client IP address when the request has no credential, on the oauth_dev:clients:list bucket.

POST/v1/oauth2/applications

Creates an application together with its bot account. Returns the application object with the initial client secret and bot token.

An unclaimed account cannot create an application. An account is unclaimed while it holds no password credential, is not a bot, and has not been linked to a single sign-on identity.

FieldTypeDescription
X-Captcha-Token?1stringThe CAPTCHA proof for the request
X-Captcha-Type?2stringThe CAPTCHA provider to verify against, either hcaptcha or turnstile

1 A missing proof returns 400 CAPTCHA_REQUIRED and a rejected proof returns 400 INVALID_CAPTCHA. FiveCord skips verification when CAPTCHA is disabled for the instance, when the account has the CAPTCHA exemption flag, or when the instance’s account policy grants the caller’s email address the CAPTCHA exemption capability, as described by CAPTCHA handling

2 FiveCord verifies against the instance’s configured provider when the header is absent

FieldTypeDescription
name1stringThe name of the application (1-100 characters)
redirect_uris?2 3?array[string]The redirect URIs to register, at most 10
bot_public?booleanWhether any eligible user can install the bot (default true)
bot_require_code_grant?booleanWhether bot installation requires an OAuth2 code grant (default false)

1 Rejected with 403 CONTENT_BLOCKED when content moderation blocks the value

2 Null registers no redirect URI. Each entry is normalised and then bounded at 1 to 256 characters

3 Each URI must parse as an absolute URL with a host and must use HTTPS. HTTP is accepted only when the host is localhost, a .localhost subdomain, an IPv4 literal, or a bracketed IPv6 literal. A URI that content moderation blocks is rejected with 403 CONTENT_BLOCKED

StatusBodyCondition
200application objectThe application and its bot were created
400error responseThe body fails validation
400error responseCAPTCHA proof is missing (CAPTCHA_REQUIRED) or rejected (INVALID_CAPTCHA)
400error responseThe account is unclaimed4
400error responseThe owner already has 25 applications (MAX_APPLICATIONS)
403error responseThe credential is a bot or bearer token (ACCESS_DENIED)
403error responseThe name, a redirect URI, or the derived bot username is blocked (CONTENT_BLOCKED)
500error responseUnexpected internal failure occurs, including when no bot username can be allocated (BOT_USER_GENERATION_FAILED)

4 UNCLAIMED_ACCOUNT_CANNOT_CREATE_APPLICATIONS

FiveCord derives the bot username from the application name when that name yields an available tag, and otherwise assigns a random username. The resulting username and discriminator can both differ from the application name.

FiveCord creates the application and the bot account together. The bot starts with no avatar, banner, biography, or global display name. No Gateway Dispatch is emitted.

10 requests per hour for each authenticated user, on the oauth_dev:clients:create bucket.

GET/v1/oauth2/applications/{id}

Returns one application object. Only the owner can read it.

FieldTypeDescription
idsnowflakeThe ID of the application
StatusBodyCondition
200application objectThe application was returned
400error responseThe application ID is not a valid snowflake
403error responseThe credential is a bot or bearer token, or the caller does not own the application (ACCESS_DENIED)
404error responseThe application does not exist (UNKNOWN_APPLICATION)

An existing application owned by another account returns 403 ACCESS_DENIED.

60 requests per minute for each authenticated user, on the oauth_dev:clients:list bucket.

PATCH/v1/oauth2/applications/{id}

Updates one application and returns the resulting application object. Only the owner can update it.

FieldTypeDescription
idsnowflakeThe ID of the application
FieldTypeDescription
name?1stringThe name of the application (1-100 characters)
redirect_uris?2?array[string]The redirect URIs to register, at most 10
bot_public?booleanWhether any eligible user can install the bot
bot_require_code_grant?booleanWhether bot installation requires an OAuth2 code grant

1 Rejected with 403 CONTENT_BLOCKED when content moderation blocks the value

2 Each entry is normalised, bounded at 1 to 256 characters, and validated on the same terms as Create application. A supplied array becomes the complete registered set, null clears every registered URI, and an omitted field leaves the current set unchanged

StatusBodyCondition
200application objectThe application was updated
403error responseThe credential is a bot or bearer token, or the caller does not own the application (ACCESS_DENIED)
403error responseThe name or a redirect URI is blocked (CONTENT_BLOCKED)
404error responseThe application does not exist (UNKNOWN_APPLICATION)

Each submitted field replaces the stored value of that field. Neither credential is rotated, and no Gateway Dispatch is emitted.

30 requests per minute for each authenticated user, on the oauth_dev:clients:update::client_id bucket, shared with Update bot profile.

PATCH/v1/oauth2/applications/{id}/bot

Updates the bot account an application owns and returns the resulting bot profile object. The caller must own the application.

FieldTypeDescription
idsnowflakeThe ID of the application
FieldTypeDescription
username?1stringThe new username for the bot account (1-32 characters)
discriminator?2string | integerThe discriminator, 1 to 4 decimal digits parsed as an integer
avatar?3?stringThe base64-encoded avatar image, or null to clear the stored avatar
banner?3?stringThe base64-encoded banner image, or null to clear the stored banner
bio?4?stringThe profile biography (0-1024 characters), or null to clear the stored value
bot_flags?5integerBot flags

1 Trimmed before validation and restricted to ASCII letters, digits, and underscores. The value cannot be everyone or here and cannot contain fluxer or system message. A change that alters more than letter case always reallocates the discriminator. A username the profile substring blocklist rejects returns 403 CONTENT_BLOCKED

2 Accepted only when it equals the bot’s current discriminator. Any other value returns the field code BOT_DISCRIMINATOR_CANNOT_BE_CHANGED

3 The value can include a data:...;base64, prefix, which FiveCord strips before it measures the payload. The remaining base64 payload is bounded at 13981016 characters for both fields, the encoded length of a full 10485760-byte image, and a longer value is rejected with the field code BASE64_LENGTH_INVALID

4 Rejected with 403 CONTENT_BLOCKED when content moderation or the profile substring blocklist blocks the value

5 FiveCord reads only the bot flags from the supplied bitfield and sets or clears each to match. It ignores every other bit

FiveCord checks the decoded bytes of avatar and banner against the instance’s avatar byte ceiling, which applies to both fields and defaults to 10 MiB. An image in a format the field does not accept, an animated image on a field that accepts no animation, and any animated AVIF return the field code INVALID_IMAGE_FORMAT. Pixel dimensions are never checked.

StatusBodyCondition
200bot profile objectThe profile was updated
400error responseThe path or body fails validation
400error responseNo discriminator can be allocated for the requested username (USERNAME_NOT_AVAILABLE)
400error responseThe discriminator differs from the current one
400error responseThe image is malformed, oversized, or an unsupported format
400error responseThe tag change allowance is exhausted
403error responseThe credential is a bot or bearer token, or the caller does not own the application (ACCESS_DENIED)
403error responseThe username or biography is blocked (CONTENT_BLOCKED)
404error responseThe application does not exist (UNKNOWN_APPLICATION), or it has no bot account (BOT_USER_NOT_FOUND)

This operation always clears the bot’s global display name, so a bot is always presented by its username. The write consumes the tag change allowance only when it changes the username or the discriminator. FiveCord reports an exhausted allowance as a body validation entry on username with the code USERNAME_CHANGED_TOO_MANY_TIMES, never as 429.

FiveCord applies the supplied profile fields to the bot account. Replaced avatar and banner assets stop appearing after the update. A username change that alters more than letter case also replaces the discriminator with a random free one for the new username. The operation emits a User Update Gateway Dispatch to the bot account’s own sessions.

30 requests per minute for each authenticated user, on the oauth_dev:clients:update::client_id bucket, shared with Update application, and a change to the resulting tag is also limited to 5 changes per 3 hours for each bot account.

POST/v1/oauth2/applications/{id}/bot/reset-tokenMFA

Rotates the bot token and returns the bot token reset object with the new token. The caller must own the application and must prove sudo mode.

FieldTypeDescription
idsnowflakeThe ID of the application

The body is a sudo verification object. Its fields are not required when the request already has a valid proof.

StatusBodyCondition
200bot token reset objectThe token was rotated
400error responseThe path or sudo body fails validation, or the supplied password or MFA code is wrong
403error responseThe credential is a bot or bearer token, or the caller does not own the application (ACCESS_DENIED)
403error responseSudo mode is required and was not proven (SUDO_MODE_REQUIRED)
404error responseThe application does not exist (UNKNOWN_APPLICATION), or it has no bot account (BOT_USER_NOT_FOUND)

A running bot reconnects only after its operator installs the returned token.

FiveCord stores the new token and ends every live main Gateway session the bot account holds. The bot’s guild memberships, group direct message memberships, and OAuth2 grants are unchanged, and no resource Dispatch is emitted.

10 requests per hour for each authenticated user, on the oauth_dev:clients:rotate_secret::client_id bucket, shared with Reset client secret.

POST/v1/oauth2/applications/{id}/client-secret/resetMFA

Rotates the OAuth2 client secret and returns the application object with the new secret. The caller must own the application and must prove sudo mode.

FieldTypeDescription
idsnowflakeThe ID of the application

The body is a sudo verification object. Its fields are not required when the request already has a valid proof.

StatusBodyCondition
200application objectThe client secret was rotated
400error responseThe path or sudo body fails validation, or the supplied password or MFA code is wrong
403error responseThe credential is a bot or bearer token, or the caller does not own the application (ACCESS_DENIED)
403error responseSudo mode is required and was not proven (SUDO_MODE_REQUIRED)
404error responseThe application does not exist (UNKNOWN_APPLICATION)

The returned application object has the new client_secret and no bot member. A caller that needs both reads Get application afterwards.

Token exchange, introspection, and revocation stop accepting the previous client secret immediately. Existing access and refresh tokens remain valid until they expire or are revoked, and no Gateway Dispatch is emitted.

10 requests per hour for each authenticated user, on the oauth_dev:clients:rotate_secret::client_id bucket, shared with Reset bot token.

DELETE/v1/oauth2/applications/{id}MFA

Deletes one owned application and anonymises its bot account, then returns 204 with an empty body. The caller must own the application and must prove sudo mode.

Removing the bot from its guilds emits one Guild Member Remove Gateway Dispatch per guild, and each removal also delivers Guild Delete to the bot’s own Gateway sessions.

FieldTypeDescription
idsnowflakeThe ID of the application

The body is a sudo verification object. Its fields are not required when the request already has a valid proof.

StatusBodyCondition
204emptyThe application was deleted
400error responseThe path or sudo body fails validation, or the supplied password or MFA code is wrong
403error responseThe credential is a bot or bearer token, or the caller does not own the application (ACCESS_DENIED)
403error responseSudo mode is required and was not proven (SUDO_MODE_REQUIRED)
404error responseThe application does not exist (UNKNOWN_APPLICATION)

A 204 response means the removal has finished. Repeating the request afterwards returns 404 UNKNOWN_APPLICATION.

The bot’s messages remain attributed to a deleted account, and its tag becomes available for reuse. The bot is removed from every guild and its profile is anonymised as DeletedUser#0000, with the global name Deleted User.

The bot token and client secret stop working. Token exchange, refresh, introspection, and revocation also fail. An existing access token can still authenticate a scope-gated route until it expires, but Get current OAuth2 authorisation and Get OAuth2 user information return 401 INVALID_TOKEN.

10 requests per hour for each authenticated user, on the oauth_dev:clients:delete::client_id bucket.