Upload asset
upload_assetUpload an image into the asset library so it can go on ads. Send the bytes base64-encoded in data (with an optional file_name), or a url to copy from — fetched once and stored, so a link that expires keeps working. JPEG, PNG, WebP or GIF up to 10 MB; Growomat reads the type, width and height from the file itself and counts it against the plan's storage. Returns the asset: url is its stable address (bind that), previewUrl a short-lived link you can open. Then attach it with attach_asset_to_ad (role MARKETING_IMAGE puts it on a card) or attach_asset_to_campaign. A chat card needs one image of at least 640 × 640. Scoped to the active Space — see set_active_space to switch, or pass space_id to override for this one call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | A public http(s) URL to copy the image from. Send this or data. | |
| data | No | The image, base64-encoded (a data: URL is accepted). Send this or url. | |
| name | No | Display name in the library. | |
| tags | No | Free-form tags for finding the asset later. | |
| type | No | What the asset is used as. Default IMAGE. | |
| alt_text | No | Alternative text describing the image. | |
| space_id | No | Override the active Space for this one call. Defaults to the active Space set via set_active_space (or GROWOMAT_SPACE_ID on the server). Pass to read/write a different Space without changing the session binding. | |
| file_name | No | The stored file's name (with data). Defaults to image. |