Authentication

Root user programmatic signin

POST https://demo.notifuse.com/api/user.rootSignin

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"  # the first key when SECRET_KEY lists several
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}')

Body application/json

email string<email> required

The root user's email address (must match one of the configured ROOT_EMAIL addresses)

Example admin@example.com
timestamp integer<int64> required

Unix timestamp (seconds since epoch). Must be within 60 seconds of server time.

Example 1735600000
signature string required

HMAC-SHA256 signature computed as: HMAC-SHA256(email + ":" + timestamp, SECRET_KEY), with the first key when SECRET_KEY lists several. The signature should be hex-encoded.

Example a1b2c3d4e5f6...

Response

200 Authentication successful object
token string required

JWT authentication token for subsequent API requests

Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
user object required

User account information

Show 6 child attributes Hide 6 child attributes
id string required

Unique user identifier

Example usr_1234567890
email string<email> required

User's email address

Example admin@example.com
name string

User's display name

Example Admin User
language string

User's preferred locale for the console UI and system emails

Example en
created_at string<date-time>

Account creation timestamp

Example 2025-01-01T00:00:00Z
updated_at string<date-time>

Last update timestamp

Example 2025-01-01T00:00:00Z
expires_at string<date-time> required

Token expiration timestamp

Example 2025-01-01T12:00:00Z
400 Bad request - missing required fields object
error string required

Error message

401 Unauthorized - invalid credentials object
error string required

Error message

405 Method not allowed object
error string required

Error message