API Documentation
The UptimeTea API is easy to use and free for all plans.
Change password
Changes your password. The new one must be at least 8 characters.
PATCH
https://api.uptimetea.com/password
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN -
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
current_passwordREQUIREDSTRINGYour current password.
-
new_passwordREQUIREDSTRINGNew password, 8 characters or more.
Response body
{
"success": true
}
Code examples
curl -X PATCH "https://api.uptimetea.com/password" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"current_password": "securepassword",
"new_password": "newsecurepassword"
}'
// Change password
const response = await fetch('https://api.uptimetea.com/password', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + yourToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"current_password": "securepassword",
"new_password": "newsecurepassword"
})
});
const data = await response.json();
console.log(data);
# Change password
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.patch(
'https://api.uptimetea.com/password',
headers=headers,
json={
'current_password': 'securepassword',
'new_password': 'newsecurepassword'
}
)
print(response.json())
// Change password
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"current_password": "securepassword",
"new_password": "newsecurepassword"
}`)
req, _ := http.NewRequest("PATCH", "https://api.uptimetea.com/password", body)
req.Header.Set("Authorization", "Bearer "+yourToken)
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))
}
# Change password
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/password')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = "Bearer #{your_token}"
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"current_password": "securepassword",
"new_password": "newsecurepassword"
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Change password
$ch = curl_init('https://api.uptimetea.com/password');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $yourToken,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, <<<'JSON'
{
"current_password": "securepassword",
"new_password": "newsecurepassword"
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);