We are now verified! Husqy is now a verified bot in Discord making us visible in the app discovery and enabling bigger trust to users!
Want to help us translate the Husqy responses? We can't do it without you! Please visit our translations repo!
Skip to main content

Husqy API General

General

Endpoints related to general, uncategorized, functionality.

GET - /

Home endpoint for the General Husqy API. Returns only success message displaying that it is the home route.

GET - /settings

This endpoints returns the settings of the guild which is requested in the query string parameters of the request.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to fetch information for

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
PUT - /settings

This endpoint provides the ability to change the settings of the guild specified in the body data.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to fetch information for
languageyesstringThe new language for the guild
timezoneyesstringThe new timezone for the guild
auto_deleteyesintegerThe new auto delete for the guild
unit_systemyesstringThe new unit system for the guild
giveaway_save_timeoutyesintegerThe new giveaway save timeout for the guild
invite_linkyesstring(May be None) The new invite link for the guild
max_warnsyesintegerThe new max warns for the guild
auto_kick_enabledyesbooleanThe new auto kick enabled value for the guild
auto_kick_role_idyesinteger(May be None) The new ID for the auto kick role for the guild

Possible errors:

  • BadRequestError
  • InternalServerError
  • DatabaseError

Helpers

Endpoints related to helper functionality.

GET - /helpers/get-husqy-for-guild

This endpoint returns a list of guilds, depending on the guilds you give in the query parameters, confirming weather or not Husqy is in that guild or not.

Query string parameters:

fieldrequiredtypedescription
guild_idsyeslistA comma seperated list of guild IDs to check (f.e. guild_id1,guild_id2,guild_id3)

Possible errors:

  • BadRequestError
GET - /helpers/get-variable-replaced-content

This endpoint returns a the text where the Husqy variables are replaced with the desired values.

Query string parameters:

fieldrequiredtypedescription
contentyesstringThe content to replace
languageyesstringThe language to use when replacing the Husqy variables, preferrably the language set in the target guild
timezoneyesstringThe timezone to use when replacing the Husqy variables, preferrably the timezone set in the target guild
guild_idnointegerThe ID of the guild to use for Husqy variables related to guilds
user_idnointegerThe ID of the user to use for Husqy variables related to users
channel_idnointegerThe ID of the channel to use for Husqy variables related to channels

Possible errors:

  • BadRequestError
GET - /helpers/get-supported-languages

Endpoint to return the current supported languages by Husqy.

This endpoint will not return any errors.

GET - /helpers/get-supported-unit-systems

Endpoint to return the current supported unit systems by Husqy.

This endpoint will not return any errors.

GET - /helpers/get-supported-timezones

Endpoint to return the current supported timezones by Husqy.

This endpoint will not return any errors.

GET - /helpers/get-guild-info
warning

This endpoint will not return any Husqy settings for a guild, use the GET - /settings endpoint for that!

Returns the name (and ID) of the guild inserted in the query string parameters.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get information from

Possible errors:

  • BadRequestError
  • InternalServerError
  • DiscordApiInteractionError
GET - /helpers/get-guild-roles

Endpoint to get a list of names and ID's of the roles available in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get roles from

Possible errors:

  • BadRequestError
  • InternalServerError
GET - /helpers/get-guild-channels

Endpoint to get a list of names, ID's and types of the channels available in the specified guild. There is an option to filter channels based on specified types.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get roles from
typesnolistA comma separeted list of channel types to filter. Possible types are: text, voice, news, stage, category, forum

Possible errors:

  • BadRequestError
  • InternalServerError
GET - /helpers/get-guild-users

Endpoint to get a list of names and ID's of the members that are in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get members from

Possible errors:

  • BadRequestError
  • InternalServerError
GET - /helpers/get-guild-emojis

Endpoint to get a list of custom emojis that are available to use in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the custom emojis from

Possible errors:

  • BadRequestError
  • InternalServerError

Privacy

Endpoints related to privacy settings.

GET - /privacy/user-data-collection-overview

Endpoint to get the user data collection settings overview for the members in a guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the members user data collection settings overview from

Possible errors:

  • BadRequestError
  • InternalServerError

Authentication

Endpoints related to authentication.

POST - /auth/authorize

Endpoint to validate the access token used in a request.

Body data (JSON):

fieldrequiredtypedescription
access_tokenyesintegerThe access token or API key to validate

Possible errors:

  • BadRequestError
  • UnauthorizedError
POST - /auth/validate-user-permissions

Endpoint to validate if the user making a request to the Husqy API is authorized to do so.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to check the user for

Possible errors:

  • BadRequestError
  • InternalServerError

Privacy

Endpoints related to privacy and other parts of Husqy

GET - /privacy/get-user-entries
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy's Privacy configurator (/privacy) command.

Endpoint to get the amount of references to your user in other parts of Husqy.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the specified references in
privacy_member_idyesintegerThe ID of the member who wants to check their references

Possible errors:

  • BadRequestError
  • ForbiddenError
  • InternalServerError
DELETE - /privacy/delete-user-entries
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy's Privacy configurator (/privacy) command.

Endpoint to delete the references to your user in other parts of Husqy.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to delete the specified references in
privacy_member_idyesintegerThe ID of the member who wants to remove their references

Possible errors:

  • BadRequestError
  • ForbiddenError
  • InternalServerError