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

# Loops

> Export Brew emails as editable Loops drafts, or download a ZIP to keep your rendered design when uploading a custom email.

Export a Brew email as an editable campaign draft in Loops. Use a ZIP upload when you want to keep the rendered Brew design.

## Requirements

* A Loops team with Content API access enabled
* A sending domain configured in Loops

A valid API key alone does not enable campaign creation. ZIP download does not need API access and has separate plan requirements below.

## Connect Loops

<Steps>
  <Step title="Create an API key">
    In Loops, open **Settings → API**, create a key and copy it.
  </Step>

  <Step title="Connect the brand in Brew">
    Select your brand in Brew and open **Integrations → Loops → Setup**. Paste the key and click **Connect**. Brew checks the key and campaign access without creating a draft.
  </Step>
</Steps>

## Create an Editable Draft

1. Open your email in Brew and choose **Send → Export template → Loops**.
2. Check the name, subject and preview text, then click **Create draft**.
3. Click **See draft** to open the campaign in Loops.
4. Review the layout, personalization, sender and audience in Loops before sending.

Export creates a draft. It does not send or schedule the campaign, and does not copy your contacts or audiences.

The editable export supports text, headings, links, buttons, lists and static images. Simple contact properties and fallback values transfer with the design.

Brew adapts layouts to the Loops editor:

* Nested cards become flat editable sections, keeping their text, links and inner card colors
* Nested column rows stack within their parent column, and wider rows split into groups of up to four columns
* Table data stays editable as row content
* Decorative Brew textures use their solid fallback color; other inline background artwork becomes an image above its text

Review spacing, corner shapes and background artwork in the Loops draft. Use the ZIP option below when you need the rendered Brew design.

Editable exports have these limits:

* 100KB of LMX content
* Public HTTPS PNG, JPEG, GIF or WebP images
* 4MB per image and 20MB of images per export

Unsupported personalization and stylesheet-only background images need changes before export. Brew checks these limits before creating a campaign.

Loops uses the company details configured in its marketing footer. Imported `{{ organization.name }}` and `{{ organization.full_address }}` placeholders in the email body use that footer.

Static address text and footer links stay in the design. Check the company details, unsubscribe link and final preview in Loops.

## Keep the Design With a ZIP

This option requires a paid Brew plan. It does not require a connected Loops account in Brew.

1. In Brew, choose **Send → Export template → Loops ZIP** and click **Download ZIP**.
2. In your Loops email, choose **Code styling** and upload the downloaded ZIP.
3. Confirm the subject and preview text in Loops. Preview the email and send yourself a test before using it with your audience.

Images keep their public HTTPS URLs. Keep those hosted files available after uploading. Replace local or embedded images before exporting.

Move stylesheet rules that reference `html` or `body` onto an inner table or container, and use plain CSS selectors. Brew rejects stylesheets it cannot preserve when MJML replaces the document shell.

Replace Brew merge tags and fallbacks with the appropriate Loops tags before downloading a ZIP. Existing Loops tags stay in the file. Brew uses Loops' unsubscribe link in the exported footer.

ZIP download and upload are manual steps. For programmatic creation, use the editable draft export.

## From an Agent or Code

Connect Loops to the brand in the app first. Then call `export_email` over [MCP](/api-reference/mcp/tools), or send `POST /v1/emails/{emailId}/export` with `provider` set to `loops`.

```bash theme={null}
curl --request POST "https://api.brew.new/v1/emails/EMAIL_ID/export" \
  --header "Authorization: Bearer $BREW_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: UNIQUE_EXPORT_KEY" \
  --data '{"provider":"loops","templateName":"Welcome","dryRun":true}'
```

The dry run checks the connection, design and images without creating a Loops draft. It does not prove that Loops will accept a later write. Set `dryRun` to `false` to create the draft.

The response's `templateId` is the Loops campaign ID. If an error includes a partial draft ID, inspect that draft in Loops before starting another export. Follow the [idempotency guidance](/api-reference/api/idempotency) when retrying.

The TypeScript SDK accepts `client.emails.export({ emailId, provider: 'loops' })`. The CLI accepts `brew-cli emails export EMAIL_ID --provider loops`. Use a release that includes Loops export support.

## Related

* [Export Troubleshooting](/api-reference/api/errors#export-provider-error)
* [Merge Tags](/create-emails/merge-tags)
* [Loops API Keys](https://loops.so/docs/api-reference/api-key)
* [Upload a Custom Email to Loops](https://loops.so/docs/creating-emails/uploading-custom-email)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.