Insert an image
insert_imageInsert an inline image into a Google Doc from a URL or local file, positioning it at the top, end, or after specific text, and controlling size and alignment. Set the segment to "header" to add a letterhead logo that repeats across pages.
Instructions
Insert an inline image from a public URL or a local file (uploaded to Drive, embedded, then the temp upload removed). Position via at (top/end/or a unique text anchor), size via width/height (points), and align left/center/right. Set segment:"header" for a letterhead logo — that is where a repeating, correctly-sized logo belongs, and it is why a template’s logo is invisible to a body read. A direct edit, not a tracked suggestion. Note: floating/text-wrapped images are not supported by the Docs API.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | "top", "end", or a unique text snippet to insert after (default top) | |
| tab | No | Target a specific tab by tabId or title (from list_tabs). Defaults to the first tab. | |
| uri | Yes | public image URL, or a path to a local image file (absolute, or relative to baseDir) | |
| page | No | which header/footer, when a doc defines more than one (default-page, first-page, even-page). Omit to use whichever exists. | |
| align | No | ||
| width | No | points | |
| height | No | points | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| baseDir | No | absolute dir to resolve a relative local `uri` against | |
| segment | No | which content tree to target: body (default), or the page header/footer. Header/footer content is invisible to a body read — a letterhead logo lives there. | |
| documentId | Yes | ||
| createSegment | No | when segment is header/footer and the doc has none, create it first (the letterhead case). Only the default header/footer can be created via the API. |