Authentication
Groundmail authenticates API requests with Bearer API keys that start with gm_.
Obtain a key
- Open the dashboard.
- Go to API Keys → Create.
- Copy the secret — it is shown once.
export GROUNDMAIL_API_KEY=gm_your_key_hereKeep keys server-side only. Never ship them in browser bundles or public repos.
Request header
Send the key on every management and send request:
curl https://api.groundmail.dev/emails \
-H "Authorization: Bearer $GROUNDMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "you@yourdomain.com",
"to": "user@example.com",
"subject": "Hello",
"html": "<p>It works.</p>"
}'Node SDK
import { Groundmail } from 'groundmail'
const client = new Groundmail(process.env.GROUNDMAIL_API_KEY)CLI
export GROUNDMAIL_API_KEY=gm_your_key_here
npx -y --package=groundmail-cli -- groundmail emails send \
--from you@yourdomain.com \
--to user@example.com \
--subject "Hello" \
--html "<p>It works.</p>"Base URLs
| Surface | URL |
|---|---|
| API | https://api.groundmail.dev |
| Dashboard | https://app.groundmail.dev |
Unauthorized responses
Missing or invalid keys return 401 with:
{
"error": {
"message": "Unauthorized"
}
}See Errors for the full error shape.