Theme API
Write CallReplaceShopMedia1
Replace one image or video of a shop with an uploaded file, or remove it. Affects the shop's customer-facing pages at once.
| Kind | Write API call |
|---|---|
| Method | POST |
| URL | https://app.bubblehouse.com/api/v2023061/<shop>/ReplaceShopMedia1 |
| Authentication | Shop TokenStaff Token |
Needs the media edit permission or theme edit. Get the key and revision from ListShopMedia1 first; any image or video it lists with filter all can be set.
Through MCP, call create_file_upload, POST the file to upload_url, then pass file: {preuploaded_file_id}. Over HTTP, send one multipart file part named file. Images and videos in Bubblehouse formats are accepted, at most 30 MiB; entity images take images only, and wallet pass images PNG only. remove clears the image instead, without a file.
A theme change is checked like other theme writes: if it adds configuration errors, nothing is saved. dry_run checks the file and the change without storing or saving anything. The file is stored before the configuration is saved; if the configuration changed meanwhile, nothing is saved, so read again and upload again.
Input
-
keystring requiredThe key from
ListShopMedia1. -
removeboolean optionalRemove the image or video instead of replacing it; pass no file.
-
expected_revisionstring requiredrevisionfrom the latest list call. If the configuration was saved since, the call fails without saving; read again. -
dry_runboolean optionalCheck the change and report what it would do, without saving.
-
allow_new_errorsboolean optionalSave even when the change adds configuration errors. They are still returned in
new_errors.
Output
-
savedboolean requiredWhether anything was saved. False for a dry run and when no value differed from what was saved.
-
revisionstring requiredThe configuration's revision after the call.
-
What changed, in key order.
-
new_errorsarray requiredConfiguration errors the change adds. Empty for a saved change unless
allow_new_errorswas set. -
fixed_errorsarray requiredConfiguration errors the change removes.
-
warningsarray requiredThings that were accepted but look off, such as an enum value outside its options.
Usage Examples
A new tier hero image
Request
{
"expected_revision": "1086983a00000003:2:7:3",
"file": {
"preuploaded_file_id": "1086983a00000999"
},
"key": "tier.1086983a00000123.hero.image"
}
Response
{
"changes": [
{
"key": "tier.1086983a00000123.hero.image",
"new": "s1086983a00000003-f1086983a00000999-p3r8t2v6y9.png",
"old": "s1086983a00000003-f1086983a00000789-k2m9q4w7x1.png"
}
],
"fixed_errors": [],
"new_errors": [],
"revision": "1086983a00000003:2:8:3",
"saved": true,
"warnings": []
}
Specific Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 400 | bad_data |
The key is not an image or video of this shop, the configuration changed since it was read, or the change would add configuration errors. Nothing was saved. For example: |
| 422 | invalid_uploaded_file |
The file is missing, of the wrong type or too large, or the temporary upload is unknown, used or expired. |
| 403 | access_denied |
Your permissions do not allow this call. |
Global Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 401 | invalid_token |
The provided authentication token is invalid or has expired. For example: |