Skip to content

docs: add serve mode documentation (REST API + X-API-Key)#60

Merged
ziembor merged 1 commit into
mainfrom
copilot/check-gomailtesttool-instructions
May 1, 2026
Merged

docs: add serve mode documentation (REST API + X-API-Key)#60
ziembor merged 1 commit into
mainfrom
copilot/check-gomailtesttool-instructions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

gomailtest serve had no user-facing documentation — no startup instructions, no endpoint reference, no request/response examples, and no mention of the required X-API-Key header.

Changes

  • docs/protocols/serve.md — new doc covering:

    • Starting the server (--api-key / SERVE_API_KEY, --port, --listen)
    • X-API-Key auth: how to pass it, what a missing/invalid key returns
    • Endpoint table (GET /health, GET /, POST /smtp/sendmail, POST /msgraph/sendmail, POST /ews/sendmail)
    • Request body schemas for SMTP and MS Graph send endpoints
    • SMTP* and MSGRAPH* env vars consumed at startup
    • HTTP status code reference
    • curl and PowerShell examples
  • README.md — adds link to docs/protocols/serve.md in the Protocol Docs section

Example

export SERVE_API_KEY="mysecretkey"
export SMTPHOST="smtp.example.com" SMTPPORT="587"
export SMTPUSERNAME="user@example.com" SMTPPASSWORD="pass" SMTPFROM="sender@example.com"

gomailtest serve

curl -X POST http://localhost:8080/smtp/sendmail \
  -H "X-API-Key: mysecretkey" \
  -H "Content-Type: application/json" \
  -d '{"to":["recipient@example.com"],"subject":"Test","body":"Hello"}'
# → {"status":"ok"}

@ziembor ziembor marked this pull request as ready for review May 1, 2026 14:01
@ziembor ziembor merged commit b813501 into main May 1, 2026
6 of 7 checks passed
@ziembor ziembor deleted the copilot/check-gomailtesttool-instructions branch May 1, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants