---
title: "Generate site with AI (optionally based on template)"
method: POST
path: "/api/async-tasks/generate-site-with-ai"
tags: ["Async API tasks"]
---

# Generate site with AI (optionally based on template)

`POST /api/async-tasks/generate-site-with-ai`

## Request

- Base URL: `https://api.duda.co`
- URL: `https://api.duda.co/api/async-tasks/generate-site-with-ai`
- Auth: HTTP basic

Generate a site using AI. If template_id is provided, generates based on template; otherwise generates from scratch with AI.

## Request body

- GenerateSiteRDT
  - `additional_ai_context` AIContextRDT
    - `instructions` string
    - `max_pages` integer
    - `pages` AdditionalPageContextRDT[]
      - `description` string
      - `imageAttachmentUrl` string
      - `title` string
  - `business_data` BusinessDataDTO
    - `category` string
    - `data_controller` string
    - `description` string
    - `logo_alt_text` string
    - `logo_url` string
    - `name` string
    - `service_area` string
    - `tone_of_voice` 'CONVERSATIONAL' | 'HUMOROUS' | 'ENTHUSIASTIC' | 'INFORMATIVE' | 'PROFESSIONAL' | 'WITTY' | 'AUTHORITATIVE'
  - `custom_instructions` string
  - `default_domain_prefix` string
  - `do_not_gen_ssl` boolean
  - `excluded_urls` string[]
  - `included_urls` string[]
  - `labels` SiteLabelRDT[]
    - `name` string
  - `lang` string: Rejected when building from a vibe template.
  - `page_limit` integer
  - `site_data` DudaOneSiteRDT
    - `account_name` string
    - `editor` 'SIMPLE' | 'ADVANCED' | 'ADVANCED-2.0' | 'VIBE'
    - `external_uid` string
    - `google_tracking_id` string
    - `googletagmanager_container_id` string[]
    - `piwik_id` string: Rejected when building from a vibe template.
    - `removeBizInfos` boolean: Rejected when building from a vibe template.
    - `schemas` SiteSchemasRDT
      - `local_business` LocalBusinessSchemaRDT
        - `enabled` boolean
        - `missing_recommended_fields` string[]
        - `missing_required_fields` string[]
        - `status` string
    - `site_alternate_domains` SiteAlternateDomainsRDT
      - `domains` string[]
      - `is_redirect` boolean
    - `site_business_info` SiteBusinessInfo: A Site Business Info data structure is used by multiple Site APIs and is represented by the properties below. Providing this information during site creation improves the conversion of the mobile site and helps populate site data.
      - `address` Address: An Address data structure is used by multiple Site APIs and is represented by the following properties. Providing an address helps the site creation process by giving Duda more information about the location of the site. For example, if you provide an address we will automatically populate a mobile maps button and potentially find other resources online.
        - `city` string
        - `country` string
        - `state` string
        - `street` string
        - `zip_code` string
      - `agendize_info` AgendizeSiteInfo: An Agendize Info data structure is used by multiple Site APIs and is represented by the properties below. Providing this will create an Agendize widget and help Duda find more information about the website online.
        - `account_id` string
        - `company_id` string
      - `business_name` string
      - `email` string
      - `opentable_info` OpenTableInfo[]
        - `country` string
        - `location` string
        - `restaurant_id` string
      - `phone_number` string
    - `site_domain` string
    - `site_seo` SiteSEORDT
      - `description` string
      - `no_index` boolean
      - `og_image` string
      - `title` string
  - `source_url` string
  - `template_alias` string: Alias of the template to build from. A vibe template creates a vibe site, which rejects url, lang, xframe_options, a site_data.editor other than VIBE and any of site_data.{piwik_id, site_seo, removeBizInfos, schemas, site_business_info}. Omit it, and template_id, with site_data.editor VIBE to create a blank vibe site.
  - `template_id` integer: Deprecated, use 'template_alias'.
  - `theme` GlobalDesignRDT
    - `background` GlobalBackgroundRDT
      - `breakpoints` BackgroundBreakpointOverrides
        - `mobile` BackgroundBreakpointStyle
          - `color` string
          - `gradient` string
          - `image` PageBackgroundImageRDT
            - `attachment` 'fixed' | 'initial'
            - `display_mode` 'COVER' | 'CONTAIN' | 'TILE' | 'NO_REPEAT'
            - `position` 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right'
            - `url` string
        - `tablet` BackgroundBreakpointStyle
          - `color` string
          - `gradient` string
          - `image` PageBackgroundImageRDT
            - `attachment` 'fixed' | 'initial'
            - `display_mode` 'COVER' | 'CONTAIN' | 'TILE' | 'NO_REPEAT'
            - `position` 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right'
            - `url` string
      - `color` string
      - `gradient` string
      - `image` PageBackgroundImageRDT
        - `attachment` 'fixed' | 'initial'
        - `display_mode` 'COVER' | 'CONTAIN' | 'TILE' | 'NO_REPEAT'
        - `position` 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right'
        - `url` string
    - `buttons` GlobalButtonRDT
      - `primary` GlobalButtonStylesRDT
        - `background` GlobalButtonBackgroundRDT
          - `color` string
          - `gradient` string
          - `image` GlobalButtonBackgroundImageRDT
            - `display_mode` 'COVER' | 'CONTAIN' | 'TILE' | 'NO_REPEAT'
            - `position` 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right'
            - `url` string
        - `border` GlobalButtonBorderRDT
          - `color` string
          - `radius` string
          - `width` string
        - `box_shadow` string
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `hover` GlobalButtonHoverStylesRDT
          - `background` GlobalButtonHoverBackgroundRDT
            - `color` string
          - `border` GlobalButtonHoverBorderRDT
            - `color` string
          - `text` GlobalButtonHoverTextStylesRDT
            - `color` string
            - `font_style` string
            - `font_weight` string
            - `text_decoration` string
        - `icon` GlobalButtonIconStylesRDT
          - `color` string
        - `text` GlobalButtonTextStylesRDT
          - `color` string
          - `direction` 'ltr' | 'rtl'
          - `font_family` string
          - `font_size` string
          - `font_style` string
          - `font_weight` string
          - `text_align` 'left' | 'center' | 'right'
          - `text_decoration` string
      - `secondary` GlobalButtonStylesRDT
        - `background` GlobalButtonBackgroundRDT
          - `color` string
          - `gradient` string
          - `image` GlobalButtonBackgroundImageRDT
            - `display_mode` 'COVER' | 'CONTAIN' | 'TILE' | 'NO_REPEAT'
            - `position` 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right'
            - `url` string
        - `border` GlobalButtonBorderRDT
          - `color` string
          - `radius` string
          - `width` string
        - `box_shadow` string
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `hover` GlobalButtonHoverStylesRDT
          - `background` GlobalButtonHoverBackgroundRDT
            - `color` string
          - `border` GlobalButtonHoverBorderRDT
            - `color` string
          - `text` GlobalButtonHoverTextStylesRDT
            - `color` string
            - `font_style` string
            - `font_weight` string
            - `text_decoration` string
        - `icon` GlobalButtonIconStylesRDT
          - `color` string
        - `text` GlobalButtonTextStylesRDT
          - `color` string
          - `direction` 'ltr' | 'rtl'
          - `font_family` string
          - `font_size` string
          - `font_style` string
          - `font_weight` string
          - `text_align` 'left' | 'center' | 'right'
          - `text_decoration` string
    - `colors` GlobalColorRDT[]
      - `id` string
      - `label` string
      - `value` string
    - `columns` GlobalColumnRDT
      - `breakpoints` ColumnBreakpointOverrides
        - `mobile` ColumnBreakpointStyle
          - `spacing` SpacingValuesRDT
            - `padding_bottom` string
            - `padding_left` string
            - `padding_right` string
            - `padding_top` string
        - `tablet` ColumnBreakpointStyle
          - `spacing` SpacingValuesRDT
            - `padding_bottom` string
            - `padding_left` string
            - `padding_right` string
            - `padding_top` string
      - `spacings` SpacingValuesRDT
        - `padding_bottom` string
        - `padding_left` string
        - `padding_right` string
        - `padding_top` string
    - `inner_columns` GlobalInnerColumnRDT
      - `breakpoints` InnerColumnBreakpointOverrides
        - `mobile` InnerColumnBreakpointStyle
          - `spacing` SpacingValuesRDT
            - `padding_bottom` string
            - `padding_left` string
            - `padding_right` string
            - `padding_top` string
        - `tablet` InnerColumnBreakpointStyle
          - `spacing` SpacingValuesRDT
            - `padding_bottom` string
            - `padding_left` string
            - `padding_right` string
            - `padding_top` string
      - `spacings` SpacingValuesRDT
        - `padding_bottom` string
        - `padding_left` string
        - `padding_right` string
        - `padding_top` string
    - `sections` GlobalSectionRDT
      - `breakpoints` SectionBreakpointOverrides
        - `mobile` SectionBreakpointStyle
          - `spacing` SpacingValuesRDT
            - `padding_bottom` string
            - `padding_left` string
            - `padding_right` string
            - `padding_top` string
        - `tablet` SectionBreakpointStyle
          - `spacing` SpacingValuesRDT
            - `padding_bottom` string
            - `padding_left` string
            - `padding_right` string
            - `padding_top` string
      - `content_width` ContentWidthRDT
        - `default_content_mode` 'full_width' | 'constrained_width'
        - `default_max_width_constraint` string
      - `spacings` SpacingValuesRDT
        - `padding_bottom` string
        - `padding_left` string
        - `padding_right` string
        - `padding_top` string
    - `text` TextStylesRDT
      - `default` DefaultTextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `link` LinkStyleRDT
          - `color` string
          - `text_decoration` string
        - `link_active` LinkStyleRDT
          - `color` string
          - `text_decoration` string
        - `link_hover` LinkStyleRDT
          - `color` string
          - `text_decoration` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `h1` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `h2` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `h3` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `h4` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `h5` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `h6` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
      - `paragraph` TextStyleRDT
        - `breakpoints` BreakpointOverrides
          - `mobile` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
          - `tablet` BreakpointStyle
            - `text` TextBreakpointStyle
              - …
        - `color` string
        - `font_family` string
        - `font_size` string
        - `font_style` string
        - `font_weight` string
        - `letter_spacing` string
        - `line_height` string
        - `text_decoration` string
        - `text_direction` string
        - `text_transform` string
  - `url` string: Rejected when building from a vibe template.
  - `xframe_options` ApiXFrameOptions
    - `allowed_domains` string[]: Allowlisted parent origins when return_xframe_headers is true (typically insertion-ordered set).
    - `return_xframe_headers` boolean: When true, the site sends X-Frame-Options / frame-ancestors style restrictions.

## Response `200`

OK

- AsyncAPIResponseRDT
  - `created_at` string, date-time
  - `error` TaskErrorRDT
    - `message` string
  - `finished_at` string, date-time
  - `id` string
  - `result` TaskResultRDT
    - `type` string, required
  - `status` 'CREATED' | 'IN_PROGRESS' | 'FAILED' | 'COMPLETED'
  - `type` 'GENERATE_SITE_WITH_AI' | 'GENERATE_SITE_FROM_URL' | 'IMPORT_CONTENT_FROM_URL' | 'CLASSIC_TO_FLEX_MIGRATION'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `405`: Method Not Allowed
- `429`: Too many requests. The rate limit was exceeded.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/duda/apis/duda-partner-api.md) - [All operations](https://skmtc.dev/duda/apis/duda-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/duda/apis/duda-partner-api/revisions/52be4d41cb12?raw)
