Check whether an email is available to change to
const url = 'http://localhost:8000/api/me/email-available/?email=hello%40example.com';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8000/api/me/email-available/?email=hello%40example.com' \ --header 'Authorization: Bearer <token>'Pre-flight for the client-driven email change (ADR-0020 addendum 3). Firebase’s verifyBeforeUpdateEmail doesn’t reliably reject a duplicate (email-enumeration protection just sends the link), so the SPA checks here first and surfaces an inline error before initiating. available=false means another account already uses it (case-insensitive); Admin rows are 1:1 with Firebase users.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Candidate email to check.
Responses
Section titled “Responses”object
False when another account already uses the email.
Examplegenerated
{ "available": true}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examplegenerated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examplegenerated
{ "detail": "example"}