API Documentation
The UptimeTea API is easy to use and free for all plans.
Confirm email
Verifies a new account's email with the token from the welcome email.
POST
https://api.uptimetea.com/auth/confirm
Headers
-
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
tokenREQUIREDSTRINGToken from the confirmation link.
Response body
{
"success": true,
"message": "Email verified successfully"
}
Code examples
curl -X POST "https://api.uptimetea.com/auth/confirm" \
-H "Content-Type: application/json" \
-d '{
"token": "confirmation-token-from-email"
}'
// Confirm email
const response = await fetch('https://api.uptimetea.com/auth/confirm', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"token": "confirmation-token-from-email"
})
});
const data = await response.json();
console.log(data);
# Confirm email
import requests
response = requests.post(
'https://api.uptimetea.com/auth/confirm',
json={
'token': 'confirmation-token-from-email'
}
)
print(response.json())
// Confirm email
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"token": "confirmation-token-from-email"
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/auth/confirm", 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))
}
# Confirm email
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/auth/confirm')
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": "confirmation-token-from-email"
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Confirm email
$ch = curl_init('https://api.uptimetea.com/auth/confirm');
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": "confirmation-token-from-email"
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);