Insert an image
insert_imageAdd an inline image to a Google Doc from a public URL, positioned at a specified index or at the document's end. Specify display size in points for precise layout.
Instructions
Inserts an inline image fetched from a PUBLIC URL at an index (or at the end of the body when index is omitted). The URL must be reachable by Google without auth, at most 50 MB and 25 megapixels, in PNG, JPEG or GIF; there is no upload channel — a local file must be hosted somewhere public first. width_pt/height_pt set the displayed size in points (omit both for natural size capped to the page width; when only one is given the API scales the other to keep the aspect ratio). Returns the created objectId in the reply — keep it for replace_image. Delete an image by deleting its range with delete_range (it occupies one index).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes | Public image URL (PNG/JPEG/GIF, <=50 MB, <=25 MP; fetched by Google, not this server). | |
| index | No | Insertion index (from read_document_text). Omit to append at the end. | |
| tab_id | No | Tab to target (from list_tabs). Omit for the first/only tab. | |
| width_pt | No | Displayed width in points. | |
| height_pt | No | Displayed height in points. | |
| segment_id | No | Header/footer/footnote segment id (from get_document). Omit for the document body. | |
| document_id | Yes | The document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output. |