Working with Assets
Workshop videos can include images, logos, and audio files. Upload assets to the API, then reference them in your .ws scripts.
Uploading an Asset
Upload a file using multipart form-data:
bash
curl -X POST https://api.ws.video/api/assets \
-H "x-api-key: YOUR_API_KEY" \
-H "x-org-id: YOUR_ORG_ID" \
-F "file=@logo.png"
json
{
"assetId": "1707900000000-abc123.png",
"path": "/tmp/workshop-assets/1707900000000-abc123.png",
"size": 45231,
"mimetype": "image/png"
}
The returned assetId is what you reference in your .ws script.
Supported Formats
| Category | Formats |
|---|---|
| Images | PNG, JPG, JPEG, GIF, WebP |
| Vector | SVG |
| Audio | MP3, WAV |
| Video | MP4 |
Maximum file size is 50 MB by default.
Referencing Assets in Scripts
Use the asset path in show image or show logo elements:
text
Scene "Hero"
show logo "1707900000000-abc123.png"
position: center
size: large
Scene "Product"
show image "product-screenshot.png"
enter: fade
Asset Expiry
Uploaded assets are temporary. They expire after 1 hour. For production workflows, upload assets immediately before compiling and rendering.
Assets are ephemeral. If you need to re-render a video after the TTL expires, you must re-upload the assets.
Download a previously uploaded asset by its ID. This endpoint is public and does not require authentication:
bash
curl -o logo.png https://api.ws.video/assets/1707900000000-abc123.png
Next Steps
- Content Elements — full reference for
show image,show logo, and other element types - Assets API — upload and retrieval endpoint details