Create an asset

This method creates an asset by uploading a file to the platform. Assets are reusable files that you can use in different workflows. The platform processes uploads asynchronously. This method returns immediately with the asset in the `processing` status, which then transitions to the `ready` status on success or to the `failed` status when the file is invalid, corrupt, or unreadable. Poll the [Retrieve an asset](/v1.3/api-reference/upload-content/direct-uploads/retrieve) endpoint until the status of the asset is `ready` before you use it. This applies to every upload, including small files. **Supported content**: - Video, audio, and image files. - PDF, text, and Markdown files. Filename extension matching is case-insensitive; for example, `notes.MD` and `notes.md` are treated the same. The platform rejects unsupported formats. For documents, it also rejects files whose extensions don't match the detected content. **Upload methods**: - **Local file**: Set the `method` parameter to `direct` and use the `file` parameter to specify the file. - **Publicly accessible URL**: Set the `method` parameter to `url` and use the `url` parameter to specify the URL of your file. **Upload limits**: - **Video and audio, local files**: Up to 200 MB - **Video and audio, public URLs**: Up to 4 GB - **Images**: Up to 32 MB - **Documents, local files**: Up to 200 MB - **Documents, public URLs**: Up to 512 MB Asset creation does not enforce a maximum duration for video and audio files. Each model applies its own file size and duration limits. For details, see the requirements below. **Additional requirements** depend on your workflow: - **Search**: [Marengo requirements](/v1.3/docs/concepts/models/marengo/marengo-3-0#video-file-requirements) - **Video analysis**: [Pegasus requirements](/v1.3/docs/concepts/models/pegasus#input-requirements) - **Entity search**: [Marengo image requirements](/v1.3/docs/concepts/models/marengo/marengo-3-0#image-file-requirements) - **Create embeddings**: [Marengo requirements](/v1.3/docs/concepts/models/marengo/marengo-3-5#input-requirements) <Note title="Note"> This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page. </Note>

Authentication

x-api-keystring
Your API key. <Note title="Note"> You can find your API key on the <a href="https://playground.twelvelabs.io/dashboard/api-keys" target="_blank">API Keys</a> page. </Note>

Request

This endpoint expects a multipart form containing an optional file.
methodenumRequired

Specifies the upload method for the asset. Use direct to upload a local file or url for a publicly accessible URL.

Allowed values:
filefileOptional

Specify this parameter to upload a file from your local file system. This parameter is required when method is set to direct.

Local video, audio, and documents support up to 200 MB. Image files support up to 32 MB.

urlstringOptional

Specify this parameter to upload a file from a publicly accessible URL. This parameter is required when method is set to url.

Public video and audio URLs support up to 4 GB. Image URLs support up to 32 MB. Document URLs support up to 512 MB.

filenamestringOptional1-255 characters
The filename of the asset. If you provide a filename, the platform preserves it. If you omit it, the platform determines one from the file or URL.
enable_hlsbooleanOptionalDefaults to false

When set to true, the platform generates an HLS playlist and segments for streaming. Applicable to video and audio assets only. The platform ignores this flag for other asset types.

Default: false.

enable_thumbnailbooleanOptionalDefaults to false

When set to true, the platform generates thumbnail images from the uploaded content.

For PDF files, the platform generates a representative thumbnail from the first page. Text and Markdown files do not produce thumbnails; the platform ignores this flag for them.

Default: false.

user_metadatastringOptional

Metadata that helps you categorize your assets. You can specify a list of keys and values. Keys must be of type string, and values can be of the following types: string, integer, float, or boolean. Send this value as a JSON-encoded string.

Response

The asset has been successfully created.
_idstringOptional
The unique identifier of the asset.
methodenumOptional

Indicates how the asset was uploaded or imported.

Values:

  • direct: Uploaded from your local file system
  • url: Uploaded from a publicly accessible URL
  • multipart: Uploaded using the multipart upload flow
  • connector: Imported through a data connector
statusenumOptional

Indicates the current processing status of the asset.

A newly uploaded asset starts in the processing status and transitions asynchronously to ready on success or to failed on error, typically within a few seconds to a few minutes. Poll the Retrieve an asset endpoint until the status is ready before you use the asset in different workflows.

Values:

  • processing: The asset is not yet usable. This can mean the upload is still in progress (for example, the platform is still fetching the file from a URL, or a multipart upload has not completed), or the upload has finished and the platform is validating the file. The technical_metadata field is omitted from the response.
  • ready: The platform validated the asset successfully, and the asset is ready to use.
  • failed: The platform could not process the file. The error field describes the reason, and the technical_metadata field may be partially populated.
filenamestringOptional
The name of the file used to create the asset.
file_typestringOptional

The MIME type of the asset file. For documents, this is application/pdf, text/plain, or text/markdown.

created_atstringOptionalformat: "date-time"

The date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the asset was created.

user_metadatamap from strings to anyOptional

User-defined metadata for this asset. This field is absent when no metadata has been set.

sourceobjectOptional

Describes where the asset came from. Present only for assets imported through a connector; absent for assets uploaded directly to the /assets endpoint.

Errors

400
Bad Request Error