> ## 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.

# App-builder integrations

> Add email to Lovable, Bolt, v0, and Replit apps via REST and webhooks.

Hosted builders (Lovable, Bolt, v0, Replit) cannot run the `gork-mcp` stdio server, so integrate over plain REST instead.

## Environment

Add these in your builder's env / secrets panel:

```bash theme={null}
GORK_API_KEY=gork_live_YOUR_KEY
GORK_BASE_URL=https://api.gork.email
```

## Send email

<CodeGroup>
  ```typescript fetch theme={null}
  await fetch(`${process.env.GORK_BASE_URL}/v1/messages/send`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.GORK_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      inboxId: "inb_YOUR_INBOX_ID",
      to: ["user@example.com"],
      subject: "Welcome aboard",
      text: "Thanks for signing up — here's what to do next.",
    }),
  });
  ```

  ```bash cURL theme={null}
  curl -X POST $GORK_BASE_URL/v1/messages/send \
    -H "Authorization: Bearer $GORK_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "inboxId": "inb_YOUR_INBOX_ID",
      "to": ["user@example.com"],
      "subject": "Welcome aboard",
      "text": "Thanks for signing up."
    }'
  ```
</CodeGroup>

## Receive email

Agents running inside hosted builders cannot receive push connections. Two options:

1. **Poll** — `GET /v1/messages?inboxId=inb_...&limit=20` on an interval.
2. **Webhooks to your own backend** — register a webhook URL you control (see the [webhooks overview](/api-reference/webhooks/overview)), verify the `X-Gork-Signature` header, and forward events into your builder app.

<Note>
  For local editors with MCP support (Cursor, Windsurf, Copilot), prefer the [MCP server](/protocols/mcp) over hand-rolled REST.
</Note>
