Get your API key
API reference

Auth

Create an account or log in. Each returns the session token the management API uses. See Server-side login for a guided walk-through.

Auth: Public · Base URL: https://api.mailkite.dev

Endpoints

Each row expands to its request and response schema. The address bar follows along, so any endpoint can be linked to directly.

POST /api/auth/signup Create an account. Returns a session token.

Create an account. Returns a session token.

Request body

signup-request.json
FieldTypeNotes
email req stringAccount email — receives the verification link.
password req stringAccount password.
refstringReferral code of the account that referred this signup, when any.
channelstringDistribution-channel slug the signup came through (e.g. wordpress-plugin) — the where to ref's who. Invalid values are dropped, never an error.
referrerstringFirst-touch landing referrer URL (external document.referrer captured on first visit). Invalid values are dropped, never an error.

Response body

auth-token-response.json

Signup, login, and OAuth sign-in all resolve to this: a session token plus the account it belongs to. Send the token as `Authorization: Bearer <token>` on /api/* calls.

FieldTypeNotes
token req stringSession JWT.
user req objectThe signed-in account.
user.id req stringAccount id (usr_…).
user.email req stringAccount email.
user.isAdmin req booleanTrue for MailKite staff accounts.
user.emailVerified req booleanWhether the account email has been confirmed.
user.avatarUrlstring · nullAvatar image URL, when the identity provider supplied one.
POST /api/auth/login Log in with email + password. Returns a session token.

Log in with email + password. Returns a session token.

Request body

login-request.json
FieldTypeNotes
email req stringAccount email.
password req stringAccount password.

Response body

auth-token-response.json

Signup, login, and OAuth sign-in all resolve to this: a session token plus the account it belongs to. Send the token as `Authorization: Bearer <token>` on /api/* calls.

FieldTypeNotes
token req stringSession JWT.
user req objectThe signed-in account.
user.id req stringAccount id (usr_…).
user.email req stringAccount email.
user.isAdmin req booleanTrue for MailKite staff accounts.
user.emailVerified req booleanWhether the account email has been confirmed.
user.avatarUrlstring · nullAvatar image URL, when the identity provider supplied one.
POST /api/auth/google Sign in with a Google auth code. Returns a session token.

Sign in with a Google auth code. Returns a session token.

Request body

google-auth-request.json
FieldTypeNotes
code req stringOne-time authorization code from Google's redirect.
redirectUri req stringThe redirect URI the code was issued to — must match a registered URI.
refstringReferral code, when any (Google sign-in doubles as signup).

Response body

auth-token-response.json

Signup, login, and OAuth sign-in all resolve to this: a session token plus the account it belongs to. Send the token as `Authorization: Bearer <token>` on /api/* calls.

FieldTypeNotes
token req stringSession JWT.
user req objectThe signed-in account.
user.id req stringAccount id (usr_…).
user.email req stringAccount email.
user.isAdmin req booleanTrue for MailKite staff accounts.
user.emailVerified req booleanWhether the account email has been confirmed.
user.avatarUrlstring · nullAvatar image URL, when the identity provider supplied one.