API
API authentication
Authenticate Segment-compatible calls and native webhooks without exposing connection credentials.
Updated 2026-08-236 min
Accepted server authentication
| Method | Format | Best use |
|---|---|---|
| HTTP Basic | Write key as username, empty password | Segment-compatible server clients |
| Bearer | Authorization: Bearer <write-key> | Plain server HTTP integrations |
| X-Write-Key | X-Write-Key: <write-key> | Compatible server gateways |
| X-AttuneMail-Webhook-Secret | Header value is the connection secret | Existing AttuneMail canonical integrations |
| Native webhook URL | Secret embedded in the one-time URL | Stripe, Clerk, and Supabase |
Store and rotate safely
- 01
Copy once
Store the revealed credential in your existing server-side secret manager.
- 02
Scope by source and environment
Use separate credentials for each producer and deployment environment.
- 03
Rotate on exposure
Generate a new connection credential, update the producer, verify traffic, then retire the exposed value.
Authentication examples
POST /v1/track
CopycURLNode.jsPython
curl -u 'ame_replace_me:' -H 'Content-Type: application/json' -d '{"messageId":"evt_123","userId":"cus_123","event":"trial.started"}' https://www.attunemail.com/v1/trackNever expose a write key
- ✓Do not embed it in a web page, browser bundle, mobile binary, or tag manager
- ✓Do not paste it into tickets, chat, logs, screenshots, or analytics
- ✓Do not reuse it across customers or environments
- ✓Do not place native webhook URLs in source control