> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gork.email/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Resend

> Move sending, domains, and webhooks from Resend to Gork.

Resend covers outbound-only sending. Gork adds agent-native inboxes, inbound mail, threading, and MCP tools on top of a `/v1` REST API. Migration is a clean swap in three passes.

## 1. Map the API calls

| Resend                          | Gork                                                          | Notes                                                                                                   |
| ------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `POST /emails` (api.resend.com) | `POST /v1/messages/send` (api.gork.email)                     | Same shape: `from` becomes `inboxId`, `to/subject/html/text` carry over, `reply_to` becomes `inReplyTo` |
| `POST /emails/batch`            | Loop `messages/send` with `Idempotency-Key` per recipient     | Gork caps 50 recipients per request; sandbox is single-recipient                                        |
| `GET /emails/{id}`              | `GET /v1/messages/{id}`                                       | Full body + attachments metadata                                                                        |
| Domains endpoints               | `POST /v1/domains` → add DNS → `POST /v1/domains/{id}/verify` | See [Custom domains](/domains)                                                                          |
| Webhooks                        | `POST /v1/webhooks`                                           | Event names differ — see next section                                                                   |
| API keys (`re_...`)             | `POST /v1/keys` (`gork_live_...`)                             | Rotate: create Gork key, deploy, revoke Resend key                                                      |

The SDK swap is one import:

```typescript theme={null}
// Before (Resend)
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({ from: "agent@domain.com", to, subject, html });

// After (Gork)
import { Gork } from "@gork/sdk";
const gork = new Gork({ apiKey: process.env.GORK_API_KEY });
await gork.messages.send({ inboxId: "inb_...", to, subject, html });
```

```python theme={null}
# After (Gork, Python)
from gork import Gork
gork = Gork()
gork.send_message(inbox_id="inb_...", to=[...], subject=..., html=...)
```

## 2. Remap webhooks

| Resend event               | Gork event                                       |
| -------------------------- | ------------------------------------------------ |
| `email.sent`               | `email.sent`                                     |
| `email.delivered`          | (covered by `email.sent` — accepted by upstream) |
| `email.bounced`            | `email.bounced`                                  |
| `email.complained`         | `email.complained`                               |
| `email.opened` / `clicked` | Opt-in `trackOpens` pixel (no click tracking)    |

Gork signs every delivery (`X-Gork-Signature`, HMAC-SHA256) — verify with `verifyGorkWebhook` instead of Resend's Svix verifier. See [Verify webhook requests](/webhooks/verify-requests). Retry policy: 5 attempts over 30s → 1h, 4xx terminal. See [Retries](/webhooks/retries).

## 3. Move suppressions and domains

1. Export bounces/complaints/unsubscribes from Resend and replay them into `POST /v1/suppressions` (`{email, reason}`) so day-one sends respect prior opt-outs. See [Suppressions](/suppressions).
2. Add the domain in Gork, install the DNS records alongside Resend's (both can coexist), verify, then cut traffic over gradually — keep both sending paths live during the transition and compare delivery in [Email activity](https://gork.email/dashboard/messages).
3. Update SPF to include both providers during migration (`include:amazonses.com`), then remove the old one.

<Warning>
  Gork has no bulk-campaign objects (Resend Audiences/Broadcasts map to per-recipient `messages/send` calls). If you send newsletters, budget the per-request loop and watch [Rate limits](/rate-limits): 240 req/min per workspace.
</Warning>
