AuthRequest a magic link

Request a magic link

Sends a magic link to the email address via Cloudflare Email binding. Those who can sign in: existing users and invited users (who have a pending invitation); a hook blocks registration without an invitation. After clicking the link, the user is redirected to the frontend (FRONTEND_URL): an existing user to /dashboard, a new user to /welcome, an error to /login. Absolute URLs, since the frontend is on a different domain.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/auth/magic-link" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "email": "user@example.com"
}'
{
  "status": true
}
POST
/api/v1/auth/magic-link
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Session token. Mobile/services. The web uses a cookie.

Session token. Mobile/services. The web uses a cookie.
API Key (cookie: session_token)
session_tokenstring
Required

API key (sent in cookie)

Content-Typestring
Required

The media type of the request body

Options: application/json
emailstring
Required
Format: email • Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Session token. Mobile/services. The web uses a cookie.

path
parameterstring
Required

API Key for authentication. Provide your API key in the cookie.

Body

application/json
emailstring
Required
Example:
user@example.com

Responses

statusboolean
Required