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.

Don't migrate without webhooks

If you cut over sending but keep the old event pipeline, you'll be blind to delivery outcomes. Webhooks are the canonical stream for production behavior.

Examples

SendGrid Mail Send → SendLib transmission:

bash
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