Authentication

Groundmail authenticates API requests with Bearer API keys that start with gm_.

Obtain a key

  1. Open the dashboard.
  2. Go to API Keys → Create.
  3. Copy the secret — it is shown once.
export GROUNDMAIL_API_KEY=gm_your_key_here

Keep 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.