Attach Image To Page
media_attachAttach a ready media asset to the page. placement determines where: avatar (header), block_image (image inside a specific block — requires blockId), gallery_item (appended to a gallery — optional blockId targets a specific gallery; otherwise the first one is used), background (theme background).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The pageId returned by page_create. | |
| altText | No | Meaningful alt text for the image. | |
| blockId | No | Required when placement is block_image; optional for gallery_item (targets a specific gallery block). | |
| editToken | No | Required for anonymous demo pages. Use the editToken returned by page_create. | |
| placement | Yes | Where the image should be used. header_photo = business-card top photo, avatar = profile header avatar, block_image = image inside a block (requires blockId), gallery_item = appended to a gallery block, background = page background. | |
| mediaAssetId | Yes | The mediaAssetId returned by media_upload or media_upload_link_create. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| url | No | ||
| pageId | No | ||
| status | Yes | ||
| altText | Yes | ||
| content | No | ||
| attached | No | ||
| nextStep | No | ||
| variants | No | ||
| deletedAt | No | ||
| expiresAt | No | ||
| placement | Yes | ||
| revisionId | No | ||
| uploadedAt | No | ||
| mediaAssetId | Yes | ||
| uploadPageUrl | No | ||
| revisionVersion | No |