API POST Methods
This api implements various API POST methods for managing user accounts and administrative actions. Below are the details of these methods:
/account/create
Explanation:
- Creates a new user account if the provided invitation code is valid and the account name doesn't already exist.
Arguments:
name
(string): The name of the new account.password
(string): The password for the new account.invite
(string): An invitation code required for account creation.
Possible Returns:
- Success (200): Account creation successful. Returns the
uid
and authenticationtoken
for the newly created account. - Bad Request (400): Account already exists or invalid invite code.
- Internal Server Error (500): Internal server error.
/account/login
Explanation:
- Allows an existing user to log in by verifying their password.
Arguments:
name
(string): The name of the account.password
(string): The password for the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).
Possible Returns:
- Success (200): Account login successful. Returns the authentication
token
for the account. - Bad Request (400): Wrong password or username/uid.
- Internal Server Error (500): Internal server error.
/account/delete
Explanation:
- Deletes an existing user account.
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).
Possible Returns:
- Success (200): Account deletion successful.
- Bad Request (400): Account deletion failed (authentication token mismatch).
- Internal Server Error (500): Internal server error.
/account/resetpassword
Explanation:
- Resets the password of an existing user account.
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).password
(string): The new password.
Possible Returns:
- Success (200): Account password reset successful.
- Bad Request (400): Account password reset failed (authentication token mismatch).
- Internal Server Error (500): Internal server error.
/account/getuid
Explanation:
- returns the uid of the account
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).
Possible Returns:
- Success (200): Account uid.
- Bad Request (400): Wrong password or username/uid (authentication token mismatch).
- Internal Server Error (500): Internal server error.
/account/isadmin
Explanation:
- returns if the user is admin or not
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).
Possible Returns:
- Success (200): admin status.
- Bad Request (400): Wrong password or username/uid (authentication token mismatch).
- Internal Server Error (500): Internal server error.
/admin/delete
Explanation:
- Deletes an existing user account by an admin.
Arguments:
name
(string): The name of the admin user.token
(string): The authentication token of the admin user.uid
(string, optional): The unique ID of the admin user (alternative to using thename
).targetuid
(string): The unique ID of the account whose HWID is to be reset.targetname
(string, optional): The name of the account whose HWID is to be reset (alternative to usingtargetuid
).
Possible Returns:
- Success (200): Target account deletion successful.
- Bad Request (400): Deletion failed (authentication token mismatch, admin privileges required, or target account not found).
- Internal Server Error (500): Internal server error.
/admin/resethwid
Explanation:
- Resets the hardware ID (HWID) of an account by an admin.
Arguments:
name
(string): The name of the admin user.token
(string): The authentication token of the admin user.uid
(string, optional): The unique ID of the admin user (alternative to using thename
).targetuid
(string): The unique ID of the account whose HWID is to be reset.targetname
(string, optional): The name of the account whose HWID is to be reset (alternative to usingtargetuid
).
Possible Returns:
- Success (200): Target account's HWID reset successful.
- Bad Request (400): Reset failed (authentication token mismatch, admin privileges required, or target account not found).
- Internal Server Error (500): Internal server error.
/admin/toggleadmin
Explanation:
- toggles admin privileges to a user account by an admin.
Arguments:
name
(string): The name of the admin user.token
(string): The authentication token of the admin user.uid
(string, optional): The unique ID of the admin user (alternative to using thename
).targetuid
(string): The unique ID of the account to be made an admin.targetname
(string, optional): The name of the account to be made an admin (alternative to usingtargetuid
).
Possible Returns:
- Success (200): Target account's admin status.
- Bad Request (400): Granting admin privileges failed (authentication token mismatch, admin privileges required, or target account not found).
- Internal Server Error (500): Internal server error.
/admin/createinvite
Explanation:
- Generates an invitation code by an admin.
Arguments:
name
(string): The name of the admin user.token
(string): The authentication token of the admin user.uid
(string, optional): The unique ID of the admin user (alternative to using thename
).
Possible Returns:
- Success (200): Generated invite code.
- Bad Request (400): Invitation code generation failed (authentication token mismatch or admin privileges required).
- Internal Server Error (500): Internal server error.
/auth/sethwid
Explanation:
- Sets the hardware ID (HWID) of an account.
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).hwid
(string): The new HWID to set.
Possible Returns:
- Success (200): HWID set successfully.
- Bad Request (400): Setting HWID failed (authentication token mismatch or HWID cannot be changed).
- Internal Server Error (500): Internal server error.
/auth/updateip
Explanation:
- Updates the IP address associated with an account.
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).
Possible Returns:
- Success (200): IP address updated successfully.
- Bad Request (400): IP address update failed (authentication token mismatch).
- Internal Server Error (500): Internal server error.
/auth/authorize
Explanation:
- Authorizes an account based on HWID and IP address.
Arguments:
name
(string): The name of the account.token
(string): The authentication token of the account.uid
(string, optional): The unique ID of the account (alternative to using thename
).hwid
(string): The HWID to check.uid
(string): The unique ID of the account.
Possible Returns:
- Success (200): Authorization successful.
- Bad Request (400): Authorization failed (invalid token, wrong username/uid, wrong HWID, or IP address mismatch).
- Internal Server Error (500): Internal server error.
Account creation is limited by once every 12 hours and account login is 5 every hour all other requests are rate limited at 50 requests per hour combined (excluding account creation and login)