Skip to main content

Invalid Email

invalid_email422

Validation · Affects all endpoints

The email value isn't a valid address. Check format and try again.

What this means

A field that's typed as an email address received a value that doesn't pass email validation. We check basic email format (local-part, @, domain with at least one dot) and reject disposable email providers. The request was rejected before any account creation, magic-link send, or other email-dependent operation.

When you'll see this

  • A user typed an email with no @ symbol or no domain.
  • An email contains forbidden characters or whitespace.
  • The domain is a known disposable email provider (mailinator, guerrillamail, etc.).
  • A field that expected an email got something else entirely (a name, a username, garbage).
Learn more about how this works

Email validation is intentionally strict on the Asterwise side. We reject disposable emails because accounts created with them tend to be throwaway and skew our usage analytics. The check uses RFC 5322 format plus a disposable-domain blocklist; addresses that pass both checks are treated as valid by default.

The most common gotcha: this error fires on RFC-invalid emails and on policy-rejected ones (disposable domains). The error response doesn't disclose which check failed — both look the same to the caller. If you're sure the format is valid and you're still hitting this, the domain is probably on the blocklist.

Example response

{
"success": false,
"error": "invalid_email",
"message": "Please provide a valid email address.",
"details": [],
"retry_after": null,
"doc_url": "https://docs.asterwise.com/reference/errors/invalid_email",
"request_id": "req_01HXYZABCDEFGH",
"timestamp": "2026-05-25T12:34:56Z"
}
NEW TO APIS?
Quick fix
  1. Verify the email has the basic [email protected] shape.
  2. Check for stray whitespace, quotes, or special characters that snuck in via copy-paste.
  3. If the format is correct, try a different email address — disposable domains aren't accepted.
PRODUCTION ENGINEER
Recovery pattern

Surface as a field-level error in the UI. Don't auto-retry — the email won't get more valid through repetition.

Python:

Production handler

import httpx

def submit_email(email, base_url, headers):
response = httpx.post(
f"{base_url}/v1/auth/magic-link",
headers=headers,
json={"email": email},
timeout=10,
)
if response.status_code == 422:
body = response.json()
if body.get("error") == "invalid_email":
return {
"ok": False,
"field_error": {
"email": "Please use a valid permanent email address.",
},
}
response.raise_for_status()
return {"ok": True}

Avoid this error by

  • Validate emails client-side before submission with a simple regex. Most malformed emails are catchable in the UI.
  • Don't accept emails from disposable domains in your own forms either — there's a reason we reject them too.
  • For B2B integrations, prefer corporate email addresses. Personal disposable inboxes are usually a signal of low engagement.
  • Trim whitespace before submission. Email fields commonly pick up leading/trailing spaces from copy-paste.