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

# Generate a video by id

> Use id to generate video.Generating a video this endpoint costs 3 credits.

### About Request Data Structure of Webhook

When the `gen_video` interface is requested, if the `webhook_url` is passed in the parameters, the program will initiate a POST request to this network address when the task succeeds or fails, with the following content:

```json theme={null}
{
  "id": "<string>",
  "type": "product_anyshot",
  "product_url": "<string>",
  "aspect_ratio": "16x9",
  "override_avatar": "<string>",
  "motion_style": "<string>",
  "product_showcase_url": "<string>",
  "image_prompt": "<string>",
  "video_prompt": "<string>",
  "status": "video_generating",
  "generated_video_url": "<string>",
  "generated_photo_url": "<string>",
  "created_at": "2025-05-30T04:11:05.449603-07:00",
  "updated_at": "2025-05-30T04:11:05.751592-07:00",
  "webhook_url": "<string>"
}
```

Arguments:

* `id` (string): Unique identifier of the ProductToVideo task.
* `failed_reason` (string): Explanation for failure if the task has failed.
* `type` (string): Type of product video generation flow. One of: `product_anyshot`, `product_avatar`.
* `product_url` (string): URL of the product being showcased or promoted.
* `aspect_ratio` (string): Expected aspect ratio of the generated media. One of: `1x1`, `16x9`, etc.
* `override_avatar` (string): ID of the creator/avatar to override the default (optional).
* `motion_style` (string): Style of motion used in avatar videos. One of: `talking`, `display`, or blank.
* `product_showcase_url` (string): Image URL used as the visual input for the generation process.
* `image_prompt` (string): User-defined prompt used to guide image generation.
* `video_prompt` (string): User-defined prompt used to guide video generation.
* `status` (string): Current status of the task. One of: `initializing`, `image_generating`, `image_generated`, `video_generating`, `video_generated`, `failed`.
* `generated_video_url` (string): URL of the generated video, if available.
* `generated_photo_url` (string): URL of the generated image, if available.
* `created_at` (string): Timestamp of task creation (ISO 8601 format).
* `updated_at` (string): Timestamp of the latest task update (ISO 8601 format).
* `webhook_url` (string): Optional webhook callback URL to notify upon task completion.


## OpenAPI

````yaml post /api/product_to_videos/{id}/gen_video/
openapi: 3.0.3
info:
  title: creatify.ai API
  version: 1.0.0
  description: API for creatify.ai
servers: []
security: []
paths:
  /api/product_to_videos/{id}/gen_video/:
    post:
      tags:
        - product_to_videos
      description: >-
        Mixin to provide a reusable `list` method for filtering and paginating
        queryset results.
      operationId: product_to_videos_gen_video_create
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this product to video.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PTVGenVideoInput'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PTVGenVideoInput'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PTVGenVideoInput'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductToVideo'
          description: ''
      security:
        - X-API-ID: []
          X-API-KEY: []
components:
  schemas:
    PTVGenVideoInput:
      type: object
      properties:
        motion_style:
          nullable: true
          default: null
          description: >-
            The motion style of the product avatar when start generate video.The
            prerequisite is that the image has an avatar.


            * `talking` - Talking

            * `display` - Display
          oneOf:
            - $ref: '#/components/schemas/MotionStyleEnum'
            - $ref: '#/components/schemas/NullEnum'
        video_prompt:
          type: string
          nullable: true
          description: User prompt for generate video description
        webhook_url:
          type: string
          format: uri
          nullable: true
          description: Webhook URL for status updates. Default is null.
          maxLength: 200
    ProductToVideo:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        type:
          allOf:
            - $ref: '#/components/schemas/Type93bEnum'
          default: product_anyshot
          description: |-
            The type of the product video flow.

            * `product_anyshot` - Product AnyShot
            * `product_avatar` - Product Avatar
        product_url:
          type: string
          format: uri
          description: >-
            URL of the product image to use for video generation (must be a
            direct image URL, e.g. PNG, JPG, WEBP).
          maxLength: 200
        aspect_ratio:
          allOf:
            - $ref: '#/components/schemas/AspectRatio338Enum'
          default: 16x9
          description: |-
            Aspect ratio of the image and video

            * `9x16` -  9X16
            * `16x9` -  16X9
            * `1x1` -  1X1
        override_avatar:
          type: string
          format: uuid
          nullable: true
          description: Override avatar for the video. Default is null.
        motion_style:
          nullable: true
          default: null
          description: >-
            The motion style of the product avatar when start generate video.The
            prerequisite is that the image has an avatar.


            * `talking` - Talking

            * `display` - Display
          oneOf:
            - $ref: '#/components/schemas/MotionStyleEnum'
            - $ref: '#/components/schemas/NullEnum'
        product_showcase_url:
          type: string
          nullable: true
          description: The sample diagram url of the product you wish to generate.
        image_prompt:
          type: string
          nullable: true
          description: User prompt for generate image description
        video_prompt:
          type: string
          nullable: true
          description: User prompt for generate video description
        status:
          allOf:
            - $ref: '#/components/schemas/ProductToVideoStatusEnum'
          description: >-
            Product to video task status: one of [initializing,
            image_generating, image_generated, video_generating,
            video_generated, failed]
          readOnly: true
        generated_video_url:
          type: string
          readOnly: true
          description: The generated video url.
        generated_photo_url:
          type: string
          readOnly: true
          description: The generated image url.
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Created date
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Updated date
        webhook_url:
          type: string
          format: uri
          nullable: true
          description: Webhook URL for status updates. Default is null.
          maxLength: 200
        failed_reason:
          type: string
          readOnly: true
          description: The generated image url.
        regen_type:
          type: string
          readOnly: true
          description: The generated image url.
        regen_source_id:
          type: string
          readOnly: true
          description: The generated video url.
      required:
        - created_at
        - failed_reason
        - generated_photo_url
        - generated_video_url
        - id
        - product_url
        - regen_source_id
        - regen_type
        - status
        - updated_at
    MotionStyleEnum:
      enum:
        - talking
        - display
      type: string
      description: |-
        * `talking` - Talking
        * `display` - Display
    NullEnum:
      enum:
        - null
    Type93bEnum:
      enum:
        - product_anyshot
        - product_avatar
      type: string
      description: |-
        * `product_anyshot` - Product AnyShot
        * `product_avatar` - Product Avatar
    AspectRatio338Enum:
      enum:
        - 9x16
        - 16x9
        - 1x1
      type: string
      description: |-
        * `9x16` -  9X16
        * `16x9` -  16X9
        * `1x1` -  1X1
    ProductToVideoStatusEnum:
      type: string
      enum:
        - initializing
        - image_generating
        - image_generated
        - video_generating
        - video_generated
        - failed
  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.

````