Skip to content

Password

POST/send_reset_password_link

Used to email a password reset link to the account owner. The link opens /board/reset?token=<token>.

Request

Auth: None · Content-type: application/json

Request body:

The request body is JSON.

Field name Description Type
email Email address of the account str

Request example:

{
    "email": "user@example.com"
}

Response

{
    "success": "Reset password link has been sent to the user (user@example.com). Please follow the instructions in the email."
}

Unknown email address:

{
    "failed": "User does not exists"
}

Reset password

POST/reset_password

Used to set a new password with the token from the reset link. The token is cleared after use.

Request

Auth: None (uses the reset token) · Content-type: application/json

Request body:

The request body is JSON.

Field name Description Type
token Token from the reset link str
password New password str

Request example:

{
    "token": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5",
    "password": "new_secure_password"
}

Response

{
    "success": "Password updated successfully"
}

Unknown or already used token:

{
    "failed": "Invalid reset token"
}

Change password

POST/update/password

Used by a logged-in user to change their password. The current password must be supplied.

Request

Auth: api_key · Content-type: application/json

Request body:

The request body is JSON.

Field name Description Type
current_password The current password str
new_password The new password, at least 6 characters str

Request example:

https://spoilerinterface.com/interface/update/password?api_key=a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0

{
    "current_password": "secure_password",
    "new_password": "new_secure_password"
}

Response

{
    "success": "Password changed"
}

Possible failed messages: New password must be at least 6 characters., Current password is incorrect, Failed to change password.