Integrations

SendGrid migration

Map concepts: API keys, templates, event webhooks.

Mapping

SendGrid and Sendlib share similar primitives, but the naming differs. Here's the 80/20 mapping to get you migrated quickly.

SendGridSendlib
Mail Send APITransmissions (/v1/transmissions)
API Keys (scopes)API keys with scopes (least privilege)
Event WebhookWebhooks (/v1/webhooks)
Suppressions (global)Suppressions (/v1/suppressions)
TemplatesTemplates (/v1/templates)
Verified Sender / Domain AuthenticationSending domains verification

Migration checklist

  1. Verify sending domain (SPF + DKIM) before you flip traffic.
  2. Create scoped keys per environment (dev/stage/prod).
  3. Move sending traffic first, then move event ingestion.
  4. Validate suppressions are enforced (hard bounces, complaints, unsubscribes).
  5. Add idempotency for create-style endpoints to prevent duplicates.

Examples

SendGrid Mail Send → Sendlib transmission:

Shell
curl -X POST https://api.sendlib.com/v1/transmissions \
	-H "Authorization: Bearer $SENDLIB_API_KEY" \
	-H "Idempotency-Key: sendgrid-migration:test-1" \
	-H "Content-Type: application/json" \
	-d '{
		"recipients": [{"email": "user@example.com"}],
		"content": {
			"subject": "Hello",
			"text": "Migrated from SendGrid"
		}
	}'

Next