Import an image (hosted copy)
import_imageCopies a photo from a public URL (e.g. the business's own website) into Pagetool's image store and returns its hosted url. Use that url in content_json (hero/about/card/gallery image), in edit_section src, or in for create_site_from_html - external image URLs are otherwise dropped. JPEG, PNG, WebP, GIF or AVIF up to 10 MB; resized to 1600px WebP and safety-checked. No public URL (e.g. photos the owner took)? Send data_base64 instead - downscale large photos first. Counts against the site owner's image allowance.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "import_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public http(s) URL of a JPEG, PNG, WebP, GIF or AVIF image (e.g. a photo on the business's own website). Never SVG. Max 10 MB. Give url OR data_base64, not both. | |
| format | No | Stored format. Default "webp" (smallest). Use "jpeg" for an image you will set as og_image_url (a link-preview share card), because some preview scrapers do not render WebP. | |
| filename | No | Optional original file name, for your own reference; the type is detected from the bytes. | |
| site_key | No | The site the image is for; it counts against that site owner's image allowance. Defaults to the caller's current draft site when omitted. | |
| data_base64 | No | The image itself, base64-encoded (or a data:image/...;base64, URL) - for photos with no public URL, e.g. ones the owner took. Same types and 10 MB limit; downscale large photos before sending. Give url OR data_base64, not both. | |
| draft_token | No | The draft token returned by draft_create, if you are working on an anonymous draft. Only needed when your client cannot send the x-pagetool-draft-token header. |