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

# Upload Asset

> Upload an image or video asset via URL for use as B-roll

Upload an image or video by providing a publicly accessible URL. The asset is downloaded and processed asynchronously.

## Usage Flow

1. Call `POST /assets` with the asset URL, name, and type
2. Receive the asset ID with `status: PROCESSING`
3. Poll `GET /assets/{id}` until `status` is `READY`
4. Use the asset ID in `POST /videos` with `broll.type: UPLOAD`

## Example

```bash theme={null}
# 1. Upload
curl -X POST https://api.argil.ai/v1/assets \
  -H "Authorization: ApiKey YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "product-demo",
    "type": "VIDEO",
    "url": "https://example.com/demo.mp4"
  }'

# 2. Poll until ready
curl https://api.argil.ai/v1/assets/ASSET_ID \
  -H "Authorization: ApiKey YOUR_KEY"

# 3. Use as B-roll in a video
curl -X POST https://api.argil.ai/v1/videos \
  -H "Authorization: ApiKey YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-video",
    "type": "moments",
    "moments": [{
      "transcript": "Check out our product",
      "avatarId": "...",
      "voiceId": "...",
      "broll": {
        "type": "UPLOAD",
        "assetId": "ASSET_ID"
      }
    }]
  }'
```

***


## OpenAPI

````yaml post /assets
openapi: 3.0.1
info:
  title: Argil API
  description: API for AI clone video generation
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.argil.ai/v1
security:
  - ApiKeyAuth: []
paths:
  /assets:
    post:
      summary: Upload an asset
      description: >
        Upload an image or video asset by providing a publicly accessible URL.
        The asset is downloaded and processed asynchronously.


        Poll `GET /assets/{id}` until `status` is `READY` before using the asset
        as B-roll in a video.


        **Size limits:** 50 MB for images, 2 GB for videos.


        **Accepted formats:** JPEG, PNG, GIF, WEBP, AVIF for images. MP4, MOV
        for videos.


        **Concurrent limit:** Maximum 5 assets processing at a time per
        workspace.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - type
                - url
              properties:
                name:
                  type: string
                  description: Display name for the asset
                  minLength: 1
                  maxLength: 256
                type:
                  type: string
                  enum:
                    - IMAGE
                    - VIDEO
                  description: Asset type. Audio upload is not supported.
                url:
                  type: string
                  format: uri
                  description: Publicly accessible URL to download the asset from
              additionalProperties: false
            example:
              name: my-broll-clip
              type: VIDEO
              url: https://example.com/clip.mp4
      responses:
        '200':
          description: Duplicate asset found — existing asset returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '201':
          description: Asset created and processing started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '400':
          description: >-
            Validation error (unsupported format, file too large, URL
            unreachable)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many assets processing concurrently (max 5)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Asset:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - AUDIO
            - IMAGE
            - VIDEO
        status:
          type: string
          enum:
            - PROCESSING
            - READY
            - FAILED
          description: Processing status. Poll until READY before using as B-roll.
        fileUrl:
          type: string
          nullable: true
          description: URL to access the asset. Null while processing.
        thumbnailUrl:
          type: string
          nullable: true
          description: URL to a thumbnail image. Null while processing.
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key to be included in the x-api-key header

````