API Documentation
The UptimeTea API is easy to use and free for all plans.
Reset password
Sets a new password with the token from the reset email. Every existing token of the user is revoked and a fresh one is returned. An unknown or expired token answers 404.
POST
https://api.uptimetea.com/auth/password/change
Headers
-
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
tokenREQUIREDSTRINGToken from the password reset email.
-
passwordREQUIREDSTRINGNew password.
Response body
{
"id": "uuid",
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"avatar_url": null,
"locale": "en",
"timezone": "UTC",
"theme": "light",
"team_id": "uuid",
"team_name": "Acme",
"team_role": "owner",
"suspended": false,
"billing_plan": "free",
"email_verified": true,
"token": "your-api-token"
}
Code examples
curl -X POST "https://api.uptimetea.com/auth/password/change" \
-H "Content-Type: application/json" \
-d '{
"token": "reset-token-from-email",
"password": "newsecurepassword"
}'
// Reset password
const response = await fetch('https://api.uptimetea.com/auth/password/change', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"token": "reset-token-from-email",
"password": "newsecurepassword"
})
});
const data = await response.json();
console.log(data);
# Reset password
import requests
response = requests.post(
'https://api.uptimetea.com/auth/password/change',
json={
'token': 'reset-token-from-email',
'password': 'newsecurepassword'
}
)
print(response.json())
// Reset password
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"token": "reset-token-from-email",
"password": "newsecurepassword"
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/auth/password/change", body)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(data))
}
# Reset password
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/auth/password/change')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"token": "reset-token-from-email",
"password": "newsecurepassword"
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Reset password
$ch = curl_init('https://api.uptimetea.com/auth/password/change');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, <<<'JSON'
{
"token": "reset-token-from-email",
"password": "newsecurepassword"
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);