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

# Create HTML interactive ads

> Generate one playable HTML ad per style for a product created with POST /api/links/. Each ad is a self-contained HTML file, compressed to fit max_size_mb, ready to upload to an ad network. Each successful ad costs 10 credits; failed ads are refunded.



## OpenAPI

````yaml post /api/html_interactive_ads/
openapi: 3.0.3
info:
  title: creatify.ai API
  version: 1.0.0
  description: API for creatify.ai
servers: []
security: []
paths:
  /api/html_interactive_ads/:
    post:
      tags:
        - html_interactive_ads
      description: >-
        Generate HTML interactive ads for one product, one ad per style.


        Create the product first with ``POST /api/links/`` or

        ``POST /api/link_with_params/``; this endpoint takes that link. Async
        only:

        POST returns the job immediately; poll the detail route or supply

        ``webhook_url``.
      operationId: html_interactive_ads_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIHtmlInteractiveAd'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/APIHtmlInteractiveAd'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/APIHtmlInteractiveAd'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIHtmlInteractiveAd'
          description: ''
      security:
        - X-API-ID: []
          X-API-KEY: []
components:
  schemas:
    APIHtmlInteractiveAd:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Created date
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Updated date
        link:
          type: string
          format: uuid
          description: >-
            The product to advertise: a link from POST /api/links/ (scraped from
            a URL) or POST /api/link_with_params/ (your own title and images).
            Fix its title, images and logo with PUT /api/links/{id}/ first,
            because the ads are built from exactly what the link holds.
        style_ids:
          type: array
          items:
            type: string
          description: >-
            The styles to use, one ad per style, from GET
            /api/html_interactive_ads/styles/.
          maxItems: 20
          minItems: 1
        promotion_info:
          type: string
          nullable: true
          description: Offer to feature in the ads, e.g. '20% off this week'.
        custom_prompt:
          type: string
          nullable: true
          description: Extra direction for the ads, e.g. tone or what to emphasize.
        max_size_mb:
          type: integer
          maximum: 15
          minimum: 5
          default: 5
          description: >-
            Largest file size per ad, in MB. Images are compressed to fit; an ad
            that still does not fit fails and is refunded.
        webhook_url:
          type: string
          format: uri
          nullable: true
          maxLength: 200
        status:
          allOf:
            - $ref: '#/components/schemas/Status26fEnum'
          readOnly: true
        failed_reason:
          type: string
          readOnly: true
          nullable: true
        ads:
          type: array
          items:
            $ref: '#/components/schemas/HtmlInteractiveAdItem'
          readOnly: true
        credits_used:
          type: number
          readOnly: true
          description: 10 credits per ad; failed ads are refunded.
      required:
        - ads
        - created_at
        - credits_used
        - failed_reason
        - id
        - link
        - status
        - style_ids
        - updated_at
    Status26fEnum:
      enum:
        - pending
        - running
        - done
        - failed
      type: string
      description: |-
        * `pending` - pending
        * `running` - running
        * `done` - done
        * `failed` - failed
    HtmlInteractiveAdItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        style_id:
          type: string
        status:
          $ref: '#/components/schemas/Status26fEnum'
        html_url:
          type: string
          format: uri
          nullable: true
          description: >-
            Self-contained HTML file with every asset inlined, ready to upload
            to an ad network. Tapping the ad opens the product URL.
        size_bytes:
          type: integer
          nullable: true
        failed_reason:
          type: string
          nullable: true
      required:
        - failed_reason
        - html_url
        - id
        - size_bytes
        - status
        - style_id
  securitySchemes:
    X-API-ID:
      type: apiKey
      in: header
      name: X-API-ID
      description: API ID, from your settings page.
    X-API-KEY:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API Key, from your settings page.

````