> ## Documentation Index
> Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Asset Upload

> Begin a direct-to-S3 upload. Returns an asset_id and a presigned upload_url; PUT the file bytes to upload_url, then call POST /v3/assets/{asset_id}/complete. Unlike POST /v3/assets (which proxies the bytes), this never sends the file through the API.



## OpenAPI

````yaml /openapi/external-api.json post /v3/assets/direct-uploads
openapi: 3.1.0
info:
  title: HeyGen External API
  version: 1.0.0
  description: >-
    HeyGen's external API for programmatic AI video creation. See
    https://docs.heygen.com for full documentation.
  contact:
    name: HeyGen Product Infra
    url: https://heygen.com
servers:
  - url: https://api.heygen.com
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Video
    description: >-
      Create videos from a prompt or an avatar, then list, fetch, deliver and
      delete them
  - name: Avatar
    description: >-
      Create avatars and looks, record consent, and generate with the Avatar 6
      model
  - name: Voice
    description: Text to speech, speech to speech, and voice cloning
  - name: Audio
    description: Music, sound effects, transcription, stem separation and audio analysis
  - name: Image
    description: Generate images
  - name: Video editing
    description: >-
      Translate, lipsync, clip, analyze and remove filler words or backgrounds
      from existing videos
  - name: Video Agent
    description: Create videos from a prompt with an agent that plans, writes and edits
  - name: Templates
    description: Generate videos from reusable templates by replacing their variables
  - name: HyperFrames
    description: Render HyperFrames compositions into video
  - name: Brand
    description: >-
      Brand kits (colors, fonts, logos) and brand glossaries (term translations
      and pronunciations)
  - name: Assets and folders
    description: Upload files and organize them in folders
  - name: Batches
    description: Submit and track videos, translations, lipsyncs and uploads in bulk
  - name: Webhooks
    description: Manage webhook endpoints and events
  - name: Feedback
    description: Tell HeyGen how a generated result turned out
  - name: Account and usage
    description: Your account, the current API key, request logs and usage
paths:
  /v3/assets/direct-uploads:
    post:
      tags:
        - Assets and folders
      summary: Create Asset Upload
      description: >-
        Begin a direct-to-S3 upload. Returns an asset_id and a presigned
        upload_url; PUT the file bytes to upload_url, then call POST
        /v3/assets/{asset_id}/complete. Unlike POST /v3/assets (which proxies
        the bytes), this never sends the file through the API.
      operationId: createAssetUpload
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAssetUploadRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CreateAssetUploadResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired API key. Verify your x-api-key header.
                  param: null
                  doc_url: null
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: rate_limit_exceeded
                  message: >-
                    Too many requests. Retry after the duration specified in the
                    Retry-After header.
                  param: null
                  doc_url: null
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional client-supplied key for safely retrying mutations. Subsequent
        calls within 24 hours that share this key replay the original response —
        even if the request body differs slightly (a warning is logged). A retry
        that arrives while the original is still in flight gets a 409
        `request_in_progress`. Keys must be 1–255 characters from
        `[A-Za-z0-9_:.-]`; a UUID is a safe default. Scope is per-endpoint and
        per-resource: the same key on a different route or path parameter is
        independent.
      schema:
        type: string
        pattern: ^[A-Za-z0-9_\-:.]{1,255}$
        maxLength: 255
        minLength: 1
      example: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    CreateAssetUploadRequest:
      description: >-
        Request to begin a presigned direct-to-S3 upload (POST
        /v3/assets/direct-uploads).
      properties:
        filename:
          description: >-
            Original filename for reference/metadata. The stored object's
            extension is derived from content_type.
          title: Filename
          type: string
        content_type:
          description: >-
            Declared MIME type (e.g. 'video/mp4', 'image/png', 'audio/mpeg',
            'application/pdf', 'application/zip'). Verified against the stored
            bytes at completion.
          title: Content Type
          type: string
        size_bytes:
          description: >-
            Exact byte size of the file. Signed into the upload URL so it cannot
            be exceeded.
          title: Size Bytes
          type: integer
        checksum_sha256:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Optional SHA256 of the file as hex. When provided, S3 enforces it on
            upload.
          title: Checksum Sha256
        multipart:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Ask for an upload in parts. Honoured for files over 16 MiB of a type
            that is checked on upload; otherwise the response is the usual
            single PUT. S3 does not enforce checksum_sha256 on an upload in
            parts.
          title: Multipart
          x-mcp-visible: false
      required:
        - filename
        - content_type
        - size_bytes
      title: CreateAssetUploadRequest
      type: object
    CreateAssetUploadResponse:
      description: Presigned upload instructions.
      properties:
        asset_id:
          description: >-
            Reusable asset identifier. Becomes usable after POST
            /v3/assets/{asset_id}/complete.
          title: Asset Id
          type: string
        upload_url:
          description: Presigned S3 URL. PUT the raw file bytes here.
          title: Upload Url
          type: string
        upload_headers:
          additionalProperties:
            type: string
          description: Headers that must be sent verbatim on the PUT request.
          title: Upload Headers
          type: object
        expires_in_seconds:
          description: Seconds until the upload URL expires.
          title: Expires In Seconds
          type: integer
        max_bytes:
          description: >-
            Maximum allowed upload size in bytes for this content type: 2 GiB
            (2,147,483,648 bytes) per video or audio file and for
            application/zip project archives; 200 MiB (209,715,200 bytes) for
            other files.
          title: Max Bytes
          type: integer
        status:
          const: pending_upload
          description: Upload lifecycle status. Always 'pending_upload' here.
          title: Status
          type: string
        multipart:
          anyOf:
            - $ref: '#/components/schemas/MultipartUploadPlan'
            - type: 'null'
          default: null
          description: >-
            Present when the upload is in parts: upload_url is then empty, and
            part URLs come from POST /v3/assets/{asset_id}/parts.
      required:
        - asset_id
        - upload_url
        - upload_headers
        - expires_in_seconds
        - max_bytes
        - status
      title: CreateAssetUploadResponse
      type: object
    StandardAPIError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: invalid_parameter
        message:
          type: string
          description: Human-readable error message
          example: Video not found
        param:
          type:
            - string
            - 'null'
          description: Which request field caused the error
        doc_url:
          type:
            - string
            - 'null'
          description: Link to error documentation
        errors:
          type: array
          description: >-
            Per-item error details for batch/multi-node failures (e.g. graph
            compilation errors by node).
          items:
            $ref: '#/components/schemas/StandardAPIErrorDetail'
        request_id:
          type: string
          description: >-
            Request identifier, also returned in the X-HeyGen-Request-Id
            response header. Include it when contacting support.
          example: 8c4f0b9e1d2a4f6b9e3c7a1d5f2b8e40
      required:
        - code
        - message
    MultipartUploadPlan:
      description: How an upload in parts is cut.
      properties:
        multipart_upload_id:
          description: 'Retain it: every call about the parts names it.'
          title: Multipart Upload Id
          type: string
        part_size_bytes:
          description: Size of every part but the last.
          title: Part Size Bytes
          type: integer
        part_count:
          description: Number of parts, numbered from 1.
          title: Part Count
          type: integer
      required:
        - multipart_upload_id
        - part_size_bytes
        - part_count
      title: MultipartUploadPlan
      type: object
    StandardAPIErrorDetail:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: unknown_node_type
        message:
          type: string
          description: Human-readable error message
          example: Unknown node type
        node_id:
          type: string
          description: Graph node id this error pertains to, if applicable
        port:
          type: string
          description: Port name on the node this error pertains to, if applicable
        path:
          type: string
          description: Field path within the item this error pertains to, if applicable
      required:
        - code
        - message
  responses:
    IdempotencyInProgress:
      description: >-
        A prior request with this Idempotency-Key is still in progress. Wait for
        the original request to complete, then retry.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                $ref: '#/components/schemas/StandardAPIError'
          example:
            error:
              code: request_in_progress
              message: >-
                A request with this Idempotency-Key is already in progress.
                Retry shortly.
              param: null
              doc_url: null
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: HeyGen API key. Obtain from your HeyGen dashboard.
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth2 bearer token.

````

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