단건·트랜잭션 발송

알림·영수증·에이전트가 만든 개별 메일도 같은 단가로 바로 보내요. html, text, 또는 design(블록 JSON) 중 하나를 줘요.

curl
curl -X POST https://send.ad/api/v1/send -H "Authorization: Bearer $SEND_API_KEY" -H "content-type: application/json" \
  -d '{"to":"kim@example.com","subject":"주문이 접수됐어요","html":"<p>{{first_name|고객}}님, 감사합니다.</p>","merge":{"first_name":"민수"}}'
# → { delivery_id, token, cost_krw }
curl https://send.ad/api/v1/deliveries/<token> -H "Authorization: Bearer $SEND_API_KEY"
Node.js
await fetch('https://send.ad/api/v1/send', { method: 'POST', headers: { authorization: `Bearer ${process.env.SEND_API_KEY}`, 'content-type': 'application/json' },
  body: JSON.stringify({ to: 'kim@example.com', subject: '주문이 접수됐어요', html: '<p>감사합니다.</p>' }) })

단건 발송에는 (광고) 접두와 법규 푸터가 붙지 않아요(거래·알림 메일용). 광고성 내용이면 캠페인으로 보내세요.

트랜잭션 API — 코드에서 바로(Mailchimp Transactional 호환)

서버·CI·AI 에이전트가 코드로 부를 때는 POST /api/v1/txn/send 이 더 편해요. Mailchimp Transactional(Mandrill) 의 messages/send 모양을 그대로 받고, *|TAG|* 머지 태그도 {{tag}} 로 바꿔줘요. 같은 단가·관문이 적용돼요.

curl
curl -X POST https://send.ad/api/v1/txn/send -H "Authorization: Bearer $SEND_API_KEY" -H "content-type: application/json" \
  -d '{"message":{"to":[{"email":"kim@example.com","merge":{"item":"무선 이어폰"}}],"subject":"주문이 접수됐어요","html":"<p>*|first_name|*님, *|item|* 주문이 접수됐어요.</p>"}}'
# → { results:[{email,status:"sent",id,delivery_id}…], cost_krw, ok }
Node.js
// search deliveries (Mandrill messages/search equivalent)
await fetch('https://send.ad/api/v1/txn/messages?status=sent&q=kim@example.com', { headers: { authorization: `Bearer ${process.env.SEND_API_KEY}` } })

이벤트 웹훅 — 열람·클릭·반송을 내 서버로

배송 이벤트(sent·delivered·open·click·bounce·complaint·unsubscribe·dropped·failed·deferred)를 등록한 URL 로 JSON POST 로 밀어드려요. 헤더 X-Send-Signature: sha256=HMAC(본문, 비밀키) 로 서명하니 비밀키로 검증하세요. 비밀키는 등록할 때 한 번만 보여요.

curl
# register (the secret is shown only this once)
curl -X POST https://send.ad/api/v1/txn/webhooks -H "Authorization: Bearer $SEND_API_KEY" -H "content-type: application/json" \
  -d '{"url":"https://myapp.example.com/hooks/send","events":["open","click","bounce"]}'

CLI 로도 같은 일을 할 수 있어요: sendad txn send · txn messages · txn webhooks · txn webhook-add <url> · txn webhook-remove <id>