Repository navigation
Per-user API keys and a read-only /api/v1
Each user can now generate personal API keys under User Settings → Account → API Keys and use them from scripts and test suites to read their mail and webhook captures.
What's new
- API key management in the web app: generate a named key (shown once, copy button), see prefix / created / last used, delete.
GET /api/v1/mail—to,search,page,pageSize,sortBy,sortDirectionquery params; returns{ items, totalCount }.GET /api/v1/mail/{id},GET /api/v1/mail/boxesGET /api/v1/webhooks/buckets,/buckets/{name},/buckets/{name}/webhooks,/webhooks/{id}- Send the key as
X-Api-Key: <key>,Authorization: Bearer <key>orAuthorization: ApiKey <key>. - A key sees exactly what its owner sees in the UI (same mail-group and bucket rules) and is read-only: nothing under
/api/v1can modify or delete data, and personal keys are rejected on the session routes. - Only a SHA-256 hash of each key is stored (
UserApiKeytable, created automatically on startup). Deleting a key revokes it immediately.
Testing
KEY=mv_...
curl -H "X-Api-Key: $KEY" "https://<host>/api/v1/mail?pageSize=10"
curl -H "X-Api-Key: $KEY" https://<host>/api/v1/webhooks/bucketsDocker images: ghcr.io/timothydodd/mailvoid:54113e1 / :latest and ghcr.io/timothydodd/mailvoid-smtp:54113e1 / :latest (published by the Go workflow for this commit).