NevarMail

Authentication

API keys, session authentication, and authorization scopes for the NevarMail API.

NevarMail supports two authentication methods: session-based authentication for the dashboard, and API key authentication for programmatic access.

Session authentication

When you sign in through the NevarMail dashboard, a session cookie is automatically managed. All requests from the dashboard UI use this session for authentication. No additional configuration is required.

API key authentication

For programmatic access, include your API key in the request headers:

curl -X POST https://your-instance.com/api/email/send \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"to":"user@example.com","subject":"Hello","text":"Hi there"}'

Generating API keys

API keys can be generated from the Settings page in the dashboard. Each key can be scoped to specific permissions.

Key scopes

ScopeDescription
email:sendSend emails to subscriber lists
templates:readRead templates
templates:writeCreate and update templates
senders:readRead sender identities
senders:writeCreate and update sender identities
analytics:readAccess analytics and reports
campaigns:readRead campaigns and campaign analytics
lists:readRead subscriber lists
domains:readRead sending domains and DNS status
domains:writeAdd and verify sending domains
contacts:readRead contacts
contacts:writeCreate and update contacts
providers:readRead configured provider status
org:readRead organization details
org:writeUpdate organization details
*Full access (all scopes)

Request headers

All API requests should include:

HeaderRequiredDescription
Content-TypeYes (POST/PUT)Must be application/json
AuthorizationYesBearer YOUR_API_KEY

Response format

Success responses use a standard envelope with the result under data, a requestId for support/debugging, and pagination on list endpoints:

{
  "data": { "id": "...", "status": "sent" },
  "requestId": "req_...",
  "pagination": { "page": 1, "perPage": 25, "total": 3 }
}

Error responses always return an error field with a human-readable message. Errors from v1 endpoints also include a machine-readable code and the requestId; authentication failures return only error:

{
  "error": "Template not found",
  "code": "NOT_FOUND",
  "requestId": "req_..."
}

Rate limiting

API requests are subject to rate limits based on your plan tier. See Rate Limits for details.

Security best practices

  • Rotate keys regularly -- Generate new API keys periodically and revoke old ones
  • Use minimal scopes -- Only grant the permissions each key actually needs
  • Keep keys secret -- Never expose API keys in client-side code or public repositories
  • Use environment variables -- Store keys in environment variables, not in code

On this page