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

# Assets

> The files of your workspace library: uploads, imported URLs and generation outputs.

An **asset** is a file of your Argil library: an image, a video or an audio file. You create assets by importing a URL or uploading a file, and every generation output is an asset too. Wherever the API takes a file, it takes an asset id.

## Create an asset

`POST /v2/assets` creates one, whatever the way you send the file:

| You have | Send |
| - | - |
| A public URL | `{ "url": "https://…" }` |
| The file, up to 100 MB | `multipart/form-data` with `file` |
| The file, larger | `{ "filename": "demo.mp4", "content_type": "video/mp4" }`, then `PUT` the bytes to `upload.url` |

For a larger file, the asset comes back `pending_upload` with `upload`: a signed URL, valid 10 minutes, and the headers the `PUT` must carry.

```bash theme={null}
curl -X PUT "$UPLOAD_URL" -H "Content-Type: video/mp4" -H "x-amz-acl: public-read" --data-binary @demo.mp4
```

Argil picks the bytes up and processes the asset: there is no other call to make.

A file is at most 50 MB for an image, 2 GB for a video and 200 MB for an audio, however it is sent. A file sent in the request or a URL over the limit is refused at once; an upload over it ends `failed`, and its bytes are deleted.

Creating an asset for a URL, or for a file sent in the request, that your workspace already has returns that asset.

## Lifecycle

| `status` | Meaning |
| - | - |
| `pending_upload` | Waiting for the bytes on `upload.url`. |
| `processing` | Argil is downloading or reading the file (type, dimensions, duration). |
| `ready` | Usable everywhere; `url` is set. |
| `failed` | The file could not be read, never arrived, or is over its type’s limit. `error.code` says which: `file_too_large`, `upload_not_received`, `download_failed`, `unreadable`, or `processing_failed` (ours). Its stored bytes are deleted: send it again to retry. |

A generation that references a `processing` asset waits for it. One that references a `pending_upload` asset is refused with `409 asset_not_uploaded`: finish the upload first.

## URLs

Argil only imports public `https://` URLs: hosts that resolve to a private network, local addresses and redirects to them are refused. The type comes from the URL’s extension, or from the server’s `Content-Type` when there is none.

A URL passed directly to a generation is imported the same way, once per workspace.

## Outputs and downloads

Generation outputs are assets of your library, with `source: "generation"`; the generation lists them in its `outputs`. Assets are kept until you delete them, and their `url` does not expire (`expires_at` is `null`): download the file from it.

`DELETE /v2/assets/{id}` removes the asset from your library. Generations that used or produced it keep it in their history.

## Listing

`GET /v2/assets` lists your workspace’s assets, newest first; filter with `type=image|video|audio`. Argil’s public elements carry their images in their plates; they are not assets of your library.


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