NightmailDocs
Docs
Guide

Keys and tokens

API keys, SMTP logins, agent tokens and app passwords.

Which one do I need?

CredentialWhat it doesWhere
API keyYour server, a script or an agent uses it: the whole workspace, sending only, or just chosen addresses or one inbox.API keys → Create key
Agent tokenAn agent such as OpenCode or Claude Code signed in as you over MCP, and the short-lived tokens it makes. Revoking it revokes them all.Create key → Agent token
SMTP loginAn API key that only sends, from chosen domains or addresses, for an app that sends over SMTP.SMTP & IMAP → SMTP
App passwordLets a mail app (IMAP or SMTP) open a persistent inbox.SMTP & IMAP → IMAP

Keys are shown once when they’re made. Store them on your server, never in a browser. Revoke any of them in API keys.

To change an API key’s access or expiry, choose Edit in its row’s menu. It keeps its secret, so nothing is redeployed.