MailMagic

Advanced

API and webhooks for developers

Manage contacts and transactional emails from code, get notified of events.

API key

Create a key under Settings → API. The key is shown only once – store it safely. Send it in the header of every request:

Authorization: Bearer mm_...

Base URL: https://mailmagic.hu/api/v1; all requests and responses are JSON. Each key has a per-minute request limit.

Adding a subscriber

curl -X POST https://mailmagic.hu/api/v1/contacts \
  -H "Authorization: Bearer mm_..." -H "Content-Type: application/json" \
  -d '{"email":"anna@example.com","first_name":"Anna","lists":[1],"tags":["webshop"],"update_existing":true}'

Transactional email

Send individual emails (e.g. order confirmations) from your verified sender with POST /emails. Full reference and more examples are on the Settings → API page.

Webhooks

Under Settings → Webhooks you can set a URL we notify about events:

Every request is signed: the X-MailMagic-Signature header has the form t=…,v1=…, where v1 is the HMAC-SHA256 of {timestamp}.{body} with the webhook secret. Failed deliveries are retried several times with increasing delays.

Can't find the answer? Write to us and a real person will reply: hello@mailmagic.hu