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

# Create Design

> Create a new mail design

Create a new postcard design. You can provide custom HTML directly or a text prompt for AI-powered HTML generation.

**Instant generation:** Unlike image-based mailing APIs, design generation from a prompt is instant. The generated HTML is returned immediately in the response — no polling required.

<ParamField body="name" type="string" required>Design name</ParamField>
<ParamField body="prompt" type="string">AI prompt to generate an HTML design. Either `prompt` or `html_front` is required.</ParamField>
<ParamField body="html_front" type="string">Custom HTML for the front side. Either `prompt` or `html_front` is required.</ParamField>
<ParamField body="html_back" type="string">Custom HTML for the back side</ParamField>
<ParamField body="size" type="string" default="4x6">Postcard size: `4x6`, `6x9`, `6x11`</ParamField>
<ParamField body="orientation" type="string" default="landscape">Orientation: `landscape` or `portrait`</ParamField>
<ParamField body="layout" type="string">Layout preset (e.g., `l-left-image`, `l-split-equal`)</ParamField>
<ParamField body="theme" type="string">Theme preset (e.g., `professional`, `warm-friendly`)</ParamField>
<ParamField body="include_street_view" type="boolean" default="true">Include a Street View image placeholder in the design</ParamField>
<ParamField body="auto_publish" type="boolean" default="false">Automatically publish the design after creation</ParamField>

<RequestExample>
  ```bash cURL — From Prompt theme={null}
  curl -X POST https://api.v2.dealmachine.com/v1/mail/designs \
    -H "Authorization: Bearer dm_sk_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Seller Outreach Card",
      "prompt": "A professional postcard for homeowners interested in selling. Warm colors, friendly tone. Include property image.",
      "size": "4x6",
      "include_street_view": true,
      "auto_publish": true
    }'
  ```

  ```bash cURL — From HTML theme={null}
  curl -X POST https://api.v2.dealmachine.com/v1/mail/designs \
    -H "Authorization: Bearer dm_sk_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Custom Design",
      "html_front": "<div style=\"padding: 20px;\"><h1>Ready to Sell?</h1><p>We have buyers ready.</p></div>",
      "html_back": "<div style=\"padding: 20px;\"><p>Call us today!</p></div>",
      "auto_publish": true
    }'
  ```
</RequestExample>
