The Husqy premium subscription is now live! Please head over to our Discord store page to get started!
We are verified! Husqy is 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 Giveaways module

General

Endpoints related to general Husqy Modules giveaways.

GET - /modules/giveaways/

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

GET - /modules/giveaways/settings

Get the settings of the giveaways module for the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the settings of

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
PUT - /modules/giveaways/settings

Endpoint to change the settings of the giveaways module for the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to change the giveaways module settings for
save_duration_timeoutyesintegerThe amount of seconds to wait after ending a giveaway
delete_ended_giveawaysyesbooleanIf ended giveaways should be deleted from discord channels

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • DatabaseError
DELETE - /modules/giveaways/settings/delete

Delete all settings of the giveaways module for a specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to delete the settings from

Possible errors:

  • BadRequestError

Status

Endpoints related to the status of the module.

GET - /modules/giveaways/status

Get the status of the giveaways module for the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to check the status of

Possible errors:

  • BadRequestError
  • SettingsError
POST - /modules/giveaways/enable

Endpoint to enable the giveaways module for the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to enable the giveaways module for

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleEnabledError
  • DatabaseError
POST - /modules/giveaways/disable

Endpoint to disable the giveaways module for the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to disable the giveaways module for

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • DatabaseError

Giveaways

Endpoint related to giveaways.

GET - /modules/giveaways/entries

Endpoint to get the known giveaways.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the known giveaways from
pagenointegerThe page number to get (default = 1)
page_sizenointegerThe amount of giveaways to return in one page (default = 10)

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
POST - /modules/giveaways/entries

Endpoint to create a new giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to create the giveaway in
channel_idyesintegerThe ID of the channel to create the giveaway in
giveaway_owner_idyesintegerThe ID of the owner of the giveaway
end_timeyesstringThe wait duration (in format {delay}{d/h/m/s}) or the end time in ISO format
prizeyesstringThe prize of the giveaway
descriptionyesstringThe description of the giveaway. Can be None.
winner_countyesintegerThe amount of winners of the giveaway
application_idyesintegerThe ID of the application interaction. Can be None
tokenyesstringThe token of the interaction. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
GET - /modules/giveaways/entry/{giveaway_id}

Endpoint to get the specified giveaway.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the giveaway from

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
DELETE - /modules/giveaways/entry/{giveaway_id}

Endpoint to delete an existing giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to remove the giveaway in
application_idyesintegerThe ID of the application interaction. Can be None
tokenyesstringThe token of the interaction. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
PUT - /modules/giveaways/entry/{giveaway_id}

Endpoint to update an existing giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to remove the giveaway in
new_prizeyesstringThe new prize of the giveaway
new_descriptionyesstringThe new description of the giveaway. Can be none
new_winner_countyesintegerThe new amount of winners for the giveaway
application_idyesintegerThe ID of the application interaction. Can be None
tokenyesstringThe token of the interaction. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
POST - /modules/giveaways/entry/{giveaway_id}/reroll

Endpoint to reroll a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to reroll the giveaway in
application_idyesintegerThe ID of the application interaction. Can be None
tokenyesstringThe token of the interaction. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
POST - /modules/giveaways/entry/{giveaway_id}/enter

Endpoint to enter a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to enter the giveaway in
application_idyesintegerThe ID of the application interaction. Can be None
tokenyesstringThe token of the interaction. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
POST - /modules/giveaways/entry/{giveaway_id}/leave

Endpoint to leave a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to leave the giveaway in
application_idyesintegerThe ID of the application interaction. Can be None
tokenyesstringThe token of the interaction. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},

Handler

GET - /modules/giveaway/handler

Home endpoint for the Modules Giveaway Entries Husqy API. Returns only success message displaying that it is the Modules Giveaway Entries API route.

POST - /modules/giveaways/handler/create
danger

Do not use this endpoint yourself! To create a giveaway use the POST - /modules/giveaways/entries endpoint.

Endpoint to create a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to create
channel_idyesintegerThe ID of the channel where the giveaway is located
message_idyesintegerThe ID of the giveaway message
end_timeyesstringThe time when the giveaway is ended
delete_atyesstringThe time when the giveaway is deleted
prizeyesstringThe prize of the giveaway
descriptionyesstringThe description of the giveaway. Can be None
winner_countyesintegerThe amount of winners of the giveaway
owner_idyesintegerThe ID of the owner of the giveaway
languageyesstringThe language of the server where the giveaway is located
auto_deleteyesintegerThe auto delete of the server where the giveaway is located

Possible errors:

  • BadRequestError
DELETE - /modules/giveaways/handler/delete
danger

Do not use this endpoint yourself! To delete a giveaway use the DELETE - /modules/giveaways/entry/{giveaway_id} endpoint.

Endpoint to delete a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to delete

Possible errors:

  • BadRequestError
POST - /modules/giveaways/handler/reroll
danger

Do not use this endpoint yourself! To reroll a giveaway use the POST - /modules/giveaways/entry/{giveaway_id}/reroll endpoint.

Endpoint to reroll a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to reroll

Possible errors:

  • BadRequestError
POST - /modules/giveaways/handler/edit
danger

Do not use this endpoint yourself! To edit a giveaway use the PUT - /modules/giveaways/entry/{giveaway_id} endpoint.

Endpoint to edit a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to edit
prizeyesstringThe new prize of the giveaway
descriptionyesstringThe new description of the giveaway
winner_countyesintegerThe new winner count of the giveaway

Possible errors:

  • BadRequestError
POST - /modules/giveaways/handler/edit-winners
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy when needed.

Endpoint to edit a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to edit
winnersyeslistThe new list of winner IDs

Possible errors:

  • BadRequestError
POST - /modules/giveaways/handler/enter
danger

Do not use this endpoint yourself! To enter a giveaway use the POST - /modules/giveaways/entry/{giveaway_id}/enter endpoint.

Endpoint to enter a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to edit
user_idyesintegerThe ID of the user to enter the giveaway

Possible errors:

  • BadRequestError
POST - /modules/giveaways/handler/leave
danger

Do not use this endpoint yourself! To enter a giveaway use the POST - /modules/giveaways/entry/{giveaway_id}/leave endpoint.

Endpoint to leave a giveaway in the Discord server.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesstringThe ID of the giveaway to edit
user_idyesintegerThe ID of the user to leave the giveaway

Possible errors:

  • BadRequestError

Privacy

Endpoints related to privacy and the polls module

GET - /modules/polls/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 in the polls module to your user.

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 - /modules/polls/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 in polls module to your user.

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