upload_asset_file
mutationSince v1.0Attach a file to an existing asset by pointing Metapad at a public URL. The server downloads the file, stores it, and everyone with the model open sees it appear. Note this fetches from a URL — it does not take raw file bytes. To upload a file directly from your machine, use the REST API's Upload Asset endpoint instead.
Attaching a file to an asset that already has one replaces it. Pass a locale to attach a language-specific variant (a German screenshot alongside the English one); leave it out for the default file. Maximum 100 MB, http and https only. Call create_asset first to get an asset id.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
locale | String | — | Attach this file as the variant for one language (for example 'de'). Leave it out to set the default file. | |
filename | String | — | Name to store the file under. If left out, it is taken from the URL. | |
asset_id | String | ✓ | The existing asset to attach the file to, as returned by create_asset. | |
source_url | String | ✓ | Public http or https URL of the file to fetch. Metapad downloads it server-side, so the URL must be reachable from the internet — a file on your own machine will not work. |
Example Request
{"asset_id": "7b12...", "source_url": "https://example.com/architecture.png", "filename": "architecture.png"}Example Response
{"success": true, "operation_count": 1, "versions": [65]}This content was written collaboratively with AI.