Direct uploads
The Assets interface provides methods to upload your media files to the platform. This method creates an asset that you can use in different workflows.
Workflow
Upload your file using the assets.create method. You receive the asset ID in the response.
Monitor the indexing status using the assets.retrieve method until it’s ready.
What you do next depends on your use case:
- For creating embeddings (videos, audio, images): Use the asset ID with the Embed API v2.
- For entity search (images): Use the asset ID to create entities.
- For search and analysis (videos): Index your asset using the asset ID.
Methods
Create an asset
Description: This method creates an asset by uploading a file to the platform. Assets are media files that you can use in downstream workflows, including indexing, analyzing video content, and creating entities.
Supported content: Video, audio, and images.
Upload methods:
- Local file: Set the
methodparameter todirectand use thefileparameter to specify the file. - Publicly accessible URL: Set the
methodparameter tourland use theurlparameter to specify the URL of your file.
File size: 200MB maximum for local file uploads, 4GB maximum for URL uploads.
Additional requirements depend on your workflow:
- Search: Marengo requirements
- Video analysis: Pegasus requirements
- Entity search: Marengo image requirements
- Create embeddings: Marengo requirements
Function signature and example:
Parameters:
Return value: Returns a Promise that resolves to an Asset object representing the created asset.
The Asset interface contains the following properties:
API Reference: Create an asset
List assets
Description: This method returns a list of assets in your account.
The platform returns your assets sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters:
Return value: Returns a Promise that resolves to a Page<Asset> object that allows you to iterate through the paginated asset results. For details about the Asset interface see the Create an asset section above.
The Page<T> interface contains the following properties and methods:
API Reference: List assets
Retrieve an asset
Description: This method retrieves details about the specified asset.
Function signature and example:
Parameters:
Return value: Returns a Promise that resolves to an Asset object containing details about the specified asset. For details about the Asset interface see the Create an asset section above.
API Reference: Retrieve an asset
Delete an asset
Description: This method deletes the specified asset. This action cannot be undone.
Function signature and example:
Parameters:
Return value: Returns a Promise that resolves to void.
API Reference: Delete asset