curl --request POST \
--url https://{notifuseDomain}/api/user.rootSignin \
--header 'Content-Type: application/json' \
--data '
{
"email": "admin@example.com",
"timestamp": 1735600000,
"signature": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}
'import requests
url = "https://{notifuseDomain}/api/user.rootSignin"
payload = {
"email": "admin@example.com",
"timestamp": 1735600000,
"signature": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'admin@example.com',
timestamp: 1735600000,
signature: 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456'
})
};
fetch('https://{notifuseDomain}/api/user.rootSignin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{notifuseDomain}/api/user.rootSignin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'admin@example.com',
'timestamp' => 1735600000,
'signature' => 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{notifuseDomain}/api/user.rootSignin"
payload := strings.NewReader("{\n \"email\": \"admin@example.com\",\n \"timestamp\": 1735600000,\n \"signature\": \"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{notifuseDomain}/api/user.rootSignin")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"admin@example.com\",\n \"timestamp\": 1735600000,\n \"signature\": \"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/user.rootSignin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"admin@example.com\",\n \"timestamp\": 1735600000,\n \"signature\": \"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzEyMzQ1Njc4OTAiLCJzZXNzaW9uX2lkIjoic2VzXzEyMzQ1Njc4OTAiLCJleHAiOjE3MzU2ODY0MDB9.signature",
"user": {
"id": "usr_1234567890",
"email": "admin@example.com",
"name": "Admin User",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"expires_at": "2025-01-01T12:00:00Z"
}Root user programmatic signin
Authenticates the root user using HMAC signature for programmatic access. This endpoint is designed for automation scenarios like Infrastructure-as-Code deployments, CI/CD pipelines, and automated testing where magic link authentication is impractical.
Security Features:
- HMAC-SHA256 signature verification using the application’s secret key
- 60-second timestamp window to prevent replay attacks
- Rate limited to 5 attempts per 5 minutes per email
- Only works for a configured root email address (ROOT_EMAIL may list several, comma/semicolon-separated)
How to generate the signature:
SECRET_KEY="your-notifuse-secret-key"
ROOT_EMAIL="admin@example.com"
TIMESTAMP=$(date +%s)
MESSAGE="${ROOT_EMAIL}:${TIMESTAMP}"
SIGNATURE=$(echo -n "$MESSAGE" | openssl dgst -sha256 -hmac "$SECRET_KEY" | awk '{print $2}')
curl --request POST \
--url https://{notifuseDomain}/api/user.rootSignin \
--header 'Content-Type: application/json' \
--data '
{
"email": "admin@example.com",
"timestamp": 1735600000,
"signature": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}
'import requests
url = "https://{notifuseDomain}/api/user.rootSignin"
payload = {
"email": "admin@example.com",
"timestamp": 1735600000,
"signature": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'admin@example.com',
timestamp: 1735600000,
signature: 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456'
})
};
fetch('https://{notifuseDomain}/api/user.rootSignin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{notifuseDomain}/api/user.rootSignin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'admin@example.com',
'timestamp' => 1735600000,
'signature' => 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{notifuseDomain}/api/user.rootSignin"
payload := strings.NewReader("{\n \"email\": \"admin@example.com\",\n \"timestamp\": 1735600000,\n \"signature\": \"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{notifuseDomain}/api/user.rootSignin")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"admin@example.com\",\n \"timestamp\": 1735600000,\n \"signature\": \"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/user.rootSignin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"admin@example.com\",\n \"timestamp\": 1735600000,\n \"signature\": \"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNyXzEyMzQ1Njc4OTAiLCJzZXNzaW9uX2lkIjoic2VzXzEyMzQ1Njc4OTAiLCJleHAiOjE3MzU2ODY0MDB9.signature",
"user": {
"id": "usr_1234567890",
"email": "admin@example.com",
"name": "Admin User",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"expires_at": "2025-01-01T12:00:00Z"
}Body
Request payload for root user programmatic signin using HMAC signature
The root user's email address (must match one of the configured ROOT_EMAIL addresses)
"admin@example.com"
Unix timestamp (seconds since epoch). Must be within 60 seconds of server time.
1735600000
HMAC-SHA256 signature computed as: HMAC-SHA256(email + ":" + timestamp, SECRET_KEY) The signature should be hex-encoded.
"a1b2c3d4e5f6..."
Response
Authentication successful
Successful authentication response containing JWT token and user details
